Hey.
So im trying to make a game where you can pickup this box with a chicken. This is the code i use to create the box, but it says error: ""
What's going on?
I've a version where i dont have any states for the game, and it's working fine. But when i try to implement my code inside the game with states code, it comes up with this error. The rest of the code is working fine
for (var i = 0; i < 1; i++)
{
//box
var b = boxGroup.create(0, 0, 'box');
b.name = 'box' + i;
b.exists = false;
b.visible = false;
b.checkWorldBounds = true;
b.events.onOutOfBounds.add(function(){resetBox, this};
var idle = b.animations.add('idle');
b.animations.play('idle', 10, true);
b.body.drag = new Phaser.Point(100, 100);
b.body.drag.y = -400;
b.anchor.setTo(0.5, 0.5);
b.scale.setTo(0.6, 0.6);
b.body.setSize(231.6, 226.8, 50);
b.body.collideWorldBounds = true;
}