Hello comrades,
I'm new to phaser and I can't seem to create new objects to the group "capetinhas", even though I can load the sprite through game.add.sprite. Here's the code:
var game = new Phaser.Game(448, 448, Phaser.AUTO, '', { preload: preload, create: create, update: update });
function preload () {
game.load.image('tabuleiro','assets/tabuleiro.png')
game.load.spritesheet('devil','assets/devil.png',32,32);
var capetinhas;
}
function create (){
capetinhas = game.add.group();
game.add.sprite(window.width,0,'tabuleiro');//loading the background
game.add.sprite(128,128,'devil'); // this works
capetinhas.create(32,32,'devil'); // this doesnt
}
function update (){
}
Any helpe would be really apreciated.
Thanks in advance.