kenwheeler / slick

the last carousel you'll ever need
kenwheeler.github.io/slick
MIT License
28.49k stars 5.89k forks source link

Phaser problem?¿?¿ #3350

Open facundopires opened 6 years ago

facundopires commented 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?

spartanatreyu commented 6 years ago

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.