Jump to content

How to collide with tweened object?


valueerror
 Share

Recommended Posts

(or "how to best predefine a route for a physics body"   :ph34r: )

 

there are several reasons to create predefined route for an enemy in a typical platformer game..   (rember super mario - the sparks crawling around cloud-platforms in a loop)

 

right now it looks like you have to fetch the x and y coordinates of each enemy each step and if its on a specific x or y position - change it's direction to wherever you want it to go..

 

but that's what tweens are for - aren't they?

 

the problem is -  you can not (or at least I didn't find out how to ) tween physics bodies in a way they can still collide with my player..

 

:unsure:

Link to comment
Share on other sites

 game.add.tween(movingplatformvertical.body.velocity).to( { x: 0, y: 100 }, 1500, Phaser.Easing.Elastic.Out ).to( { x: 0, y: -100 }, 1500, Phaser.Easing.Elastic.Out).yoyo().loop().start();

not exactly what i was loocking for since i can not give it exact x or y koordinates but it is a tween - and it is a physics body :)   investigating this further ^^

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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