Jump to content

Self-destroying platforms


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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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