elsimate Posted December 14, 2014 Share Posted December 14, 2014 Hello! Do you guys happen to know how one would make a platform, that, when steppen on by the player, animates, and on complete destroys itself, and drops the player, but activates a timer that will reincarnate it? I have this for now://prethis.load.spritesheet('platform1', 'assets/platform1.png', 28, 50);this.load.spritesheet('platform0', 'assets/platform0.png', 28, 50);//createthis.pl1.sprite.add(100,100, 'platform1');this.pl1.animation.add('drop', [0, 1, 2], 10, false);this.pl1.enableBody = true;this.physics.arcade.enable(this.pl1);this.pl1.body.allowGravity = false;//updatethis.physics.arcade.collide(this.player, this.pl1);if (this.pl1.body.touching.up) { this.pl1.play('drop'); this.pl1.animation.onComplete ????}how do i toggle the collide? what is the onComplete synthax? Would it be wise to use groups for multiple platforms? Platform0 is the animation that is to be triggered after the timer expires and is ready to create a new platform. Help please Link to comment Share on other sites More sharing options...
lewster32 Posted December 17, 2014 Share Posted December 17, 2014 There's quite a lot you should be doing to get this working well, so I've made a fiddle to demonstrate how I'd do it: http://jsfiddle.net/lewster32/3buz8dLv/ Dread Knight 1 Link to comment Share on other sites More sharing options...
Recommended Posts