barodapride

Circle collision and Precise jumping

Recommended Posts

Hi all, I'm very new to phaser and I have a couple questions before I continue with my project:

 

1. Is there a way to make circular objects and check collisions with them? If not, can I create a larger rectangular sprite (with a circular display of the image) with a smaller hitbox to provide the illusion of accurate hit detection?

 

2. Is there a way to provide accurate jumping based on time holding the jump key? In the examples, a simple initial y velocity is applied to the player upon jump. In Mario, and just about any platformer ever made, the velocity is constant or changes slightly over the first couple seconds of jumping depending on how long the jump button is pressed.

 

Thanks for any insight you can add.

Share this post


Link to post
Share on other sites

1) Not yet... Rich mentioned something about the new physics system that is not yet implemented being able to do more than the current AABB only.

 

2) Perhaps:
When jump is pressed, remove gravity from player, set velocity.

When jump is released, or if it is held down for a period of time, gravity is reapplied.

Just thought this up, haven't implemented it at all, but I have seen others post a similar question, if they happen along, perhaps they can share what they ended up with...

Share this post


Link to post
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.

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

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.