Phaser duda basica problema cargar imagen

Radram

Acabo de empezar a utilizar phaser.

Y me tira todo el rato este error Phaser.Cache.getImage: Key "player" not found in Cache.


var mainState = {
      preaload: function()  {
      game.load.image('player', 'assets/player.png');        
},
create: function() { game.stage.backgroundColor = '#3498db'; game.physics.startSystem(Phaser.Physics.ARCADE); var player = game.add.sprite(250, 170, 'player'); }, update: function() { },

}; var game = new Phaser.Game(500, 340, Phaser.AUTO, 'gameDiv');
game.state.add('main', mainState); game.state.start('main');
r2d2rigo

#1 tienes un typo, has puesto preaload en lugar de preload.

Usuarios habituales

  • r2d2rigo
  • Radram