Jump to content

Phaser Shooting.


Recommended Posts

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



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.
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

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...