Can I Jump does not work on sprites

Hi guys,

Can you please help me with following issue.

I am implementing jump/run/jump logic in my game.

As long as I am using Rect as a player object (display.newRect) everything works perfectly.

As soon as I replace Rect with Sprite object (display.newSprite) jump logic does not work.

self.canJump  variable is never “1” as when I use Rect object (I have checked that using print method).

I have also checked is foot sensor long/wide enough to touch the ground using “debug” mode, and everything is OK, I have even prolonged foot sensor shape to be safe.

When I get back to Rect everything is OK again (jump works).

My Sprite simulate OK, but jump does not work.

You can find more details here:

https://coronalabs.com/blog/2013/02/19/more-physics-tricks-explained/

Can you please tell me how to use “foot” sensor on sprites?

Many thanks!

Ivan

Hi Ivan,

There is really no difference between a vector rectangle and a sprite in this instance. Check your code carefully and make sure that you didn’t accidentally delete an important line, for example, initially assigning the “.canJump” property to the sprite when you create it.

Brent

Hi Brent,

Many thanks for a quick reply.

I forgot to insert sprite in a group, and jump action was handled for group elements.

I apologize.

Many thanks.

Ivan

Hi Ivan,

There is really no difference between a vector rectangle and a sprite in this instance. Check your code carefully and make sure that you didn’t accidentally delete an important line, for example, initially assigning the “.canJump” property to the sprite when you create it.

Brent

Hi Brent,

Many thanks for a quick reply.

I forgot to insert sprite in a group, and jump action was handled for group elements.

I apologize.

Many thanks.

Ivan