tobymcfly

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

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.