akanarika Posted April 22, 2014 Share Posted April 22, 2014 in function create(): create 15 cubes on the top of gameworld: stars = game.add.group();for (var i = 0; i < 15; i++) { var star = stars.create(375, -50, 'star'); game.physics.arcade.enable(star); star.enableBody = true; star.body.collideWorldBounds = true; star.body.immovable = true; }timer:game.time.events.loop(Phaser.Timer.SECOND, updateCounter, this);in function updateCounter, make the cubes fall down one by one:if(i<15){live = stars.getAt(i);live.body.immovable = false;live.body.gravity.y = GRAVITY;//live.body.velocity.y = 90;i++;} Link to comment Share on other sites More sharing options...
drhayes Posted April 22, 2014 Share Posted April 22, 2014 Are you calling the right collide method in your update function for the group? E.g. game.physics.arcade.collide(stars)? Link to comment Share on other sites More sharing options...
Recommended Posts