Jump to content

Phaser Shooting.


JokerJESUS
 Share

Recommended Posts

Hello, i have a problem with shooting in my game, similar problem is in this example:

http://www.phaser.io/examples/v2/games/tanks

 

As you can see, when pointer is far of point when bullets are spawning than this is working fine, but when you get you pointer close to point where bullets are spawning than bullets are getting in a SLOWMOTION! They are moving really slow, sorry for my english.

Link to comment
Share on other sites

I suggest you start reading Phaser API. There you will find good documentation for Phaser that will help you with this kind of issues.
http://phaser.io/docs/2.4.4/Phaser.Physics.Arcade.html#moveToPointer
If you take a closer look for that last parameter you will notice that it's a fixed time to dictate time it will take for object to arrive at target.
So, if you set this for, let's say 500ms (0.5s) and your cursor is 400 pixels away from the gun, object will travel that 400 pixels in 500ms. Now if your cursor is 10pixel away, it will still take 500ms to travel that short distance of 10px and thats why it looks like "slowmotion".

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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