valueerror Posted March 15, 2014 Share Posted March 15, 2014 (or "how to best predefine a route for a physics body" ) 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.. Link to comment Share on other sites More sharing options...
valueerror Posted March 17, 2014 Author Share Posted March 17, 2014 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 More sharing options...
waateur Posted March 17, 2014 Share Posted March 17, 2014 Hello,I'm looking on something a bit similar. I Sprite.scale.setTo(x,y) and i don't know how to make the body scale too. Might be the same solution to our problem Link to comment Share on other sites More sharing options...
Recommended Posts