Jump to content

Self-destroying platforms


elsimate
 Share

Recommended Posts

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

 Share

  • Recently Browsing   0 members

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