Jump to content

Moving a sprite with P2 - Wrong initial directions


Legedric
 Share

Recommended Posts

Hi all,

 

I am pretty new to Phaser and already created a top down car game using Arcade Physics but as the collision detection is not what I want I am switching over to P2 now and I ran into some trouble.

 

Issue 1:

I already managed to get my car moving but where Arcade is moving a sprite to the right by default as soon as it gets velocity, P2 is moving it up instead.

I don't want to rebuild all my Spritesheets turning them by 90 degrees so I come here to ask if there is a way to tell Phaser (or P2) to what direction it should move a sprite when it gets thrust/velocity?

 

Issue 2:

In addition, I'd like to set a start angle for my car object as every level will has its on start position for the car and I don't want the player have to turn the car by himself when its spawn is too close to the right level border for example.

In Arcade mode I was able to set player.body.angle to whatever I configure for my level but for P2 this somehow doesn't work.

 

I already searched the web  for all 2 issues but either I am blind or my needs are somewhat "special" ;)

 

Any help is much appreciated!

 

Regards,

 

Legedric

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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