Jump to content

Phaser.Signal: listener is a required param of add() and should be a Function.


tobymcfly
 Share

Recommended Posts

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: "image.png.713ebf7450d93b259a089689b77eb0b1.png" 

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;
        }

image.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...