Jumper platformer enemy ai question

I am working on a platformer game (non side scrolling) where a player jumps on enemies heads to kill them. (Think Mario like the image below, but the level never moves) The enemies should also be able to jump on the player and kill him, but I am not sure the best approach for enemy movement.
I have been looking at Jumper for A* pathing but I’m not sure how to translate walkable/obstruction spaces into air/ground. If a player is on a 3rd level platform, for instance, I understand how to move the enemy to the player, but I don’t know how to tell the enemy “Jump on this platform to get to the next level”. Any thoughts or references to a tutorial would be greatly appreciated.

So i’m guessing the game uses physics? 

So why don’t you make a function that watches for a collision at the end of the level?

In the picture below the box has to jump to the top and when it touches the red line you go to next level.

Is that what you want?

–SonicX278

The game does you physics. My question is really more about determining when to jump to the next platform. In your picture, if the box is moving right, how do you determine you are at the edge of the platform and how do you determine where other platforms are that the box is capable of jumping up to?

To clarify, this is enemy movement I am talking about, so it is automated. Not user controlled movement.

Shameless plug: I modified a Jumper fork to work out-of-the-box with Corona:

http://www.panc.co/code/jumper-logic-modified-for-corona-sdk

Remember that Jumper requires a 2D array to operate correctly. There is no way for the Jumper lib to know where your platforms are or are not, nor can it detect physics objects. It needs to index a grid of some kind. You could certainly use Jumper for this, and generate a grid that corresponds to your platforms and empty space. 

Instead of using Jumper, you could have your level data loaded into a table, and each time an enemy collides with a platform, store the enemy’s x/y coordinates and velocity, update the enemy’s x/y and velocity at runtime, and simultaneously check that against the x/y of the platform. When the enemy gets too close to the edge (or you just arbitrarily want it to jump) you can check the other platforms to see which one is the most viable landing point, and initiate your “enemy jump” logic to propel that enemy to that platform. I just came up with that off the top of my head so I can’t vouch for it working.

There are many different ways you can accomplish what you’re looking for, and neither of the above are likely the best one. It’s always good to experiment and see what is going to work best for your specific usecase.

So i’m guessing the game uses physics? 

So why don’t you make a function that watches for a collision at the end of the level?

In the picture below the box has to jump to the top and when it touches the red line you go to next level.

Is that what you want?

–SonicX278

The game does you physics. My question is really more about determining when to jump to the next platform. In your picture, if the box is moving right, how do you determine you are at the edge of the platform and how do you determine where other platforms are that the box is capable of jumping up to?

To clarify, this is enemy movement I am talking about, so it is automated. Not user controlled movement.

Shameless plug: I modified a Jumper fork to work out-of-the-box with Corona:

http://www.panc.co/code/jumper-logic-modified-for-corona-sdk

Remember that Jumper requires a 2D array to operate correctly. There is no way for the Jumper lib to know where your platforms are or are not, nor can it detect physics objects. It needs to index a grid of some kind. You could certainly use Jumper for this, and generate a grid that corresponds to your platforms and empty space. 

Instead of using Jumper, you could have your level data loaded into a table, and each time an enemy collides with a platform, store the enemy’s x/y coordinates and velocity, update the enemy’s x/y and velocity at runtime, and simultaneously check that against the x/y of the platform. When the enemy gets too close to the edge (or you just arbitrarily want it to jump) you can check the other platforms to see which one is the most viable landing point, and initiate your “enemy jump” logic to propel that enemy to that platform. I just came up with that off the top of my head so I can’t vouch for it working.

There are many different ways you can accomplish what you’re looking for, and neither of the above are likely the best one. It’s always good to experiment and see what is going to work best for your specific usecase.