Open facundopires opened 6 years ago
I don't know why i'm doing wrong
this is the code: var juego = new Phaser.Game(200, 300, Phaser.AUTO, 'bloque_juego');
var estadoPrincipal = { preload: function(){ //carga toda la wea recursables juego.stage.backgroundColor = "#000"; }, create: function(){ //mostrar pantalla recursos cargados en preload }, update: function(){ //actualiza } };
juego.state.add('principal', estadoPrincipal); juego.state.start('principal');
When i ran it, console say: "Uncaught TypeError: Cannot read property 'add' of undefined at principal.js:16" Someone can tell me what i'm doing wrong?
Uhh firstly, you've made an issue for slick, not phaser.
Secondly, Cannot read property 'add' of undefined means that state is undefined, as in there is no such thing as state on juego.
Cannot read property 'add' of undefined
I don't know why i'm doing wrong
this is the code: var juego = new Phaser.Game(200, 300, Phaser.AUTO, 'bloque_juego');
var estadoPrincipal = { preload: function(){ //carga toda la wea recursables juego.stage.backgroundColor = "#000";
}, create: function(){ //mostrar pantalla recursos cargados en preload }, update: function(){ //actualiza } };
juego.state.add('principal', estadoPrincipal); juego.state.start('principal');
When i ran it, console say: "Uncaught TypeError: Cannot read property 'add' of undefined at principal.js:16" Someone can tell me what i'm doing wrong?