Sunday 15 January 2012

lua - Getting an item to bounce off an arbitrary plane in a 2.5D game -


In my Corona SDK game I want to drop an item from the sky and bounce up and down some time before settling down, say at a randomly specified point on the screen that I have an object x = 500 and Y = 0 I'll leave it on I specify a drop-off point on Y = 700, where the item is Y = 700, bounce back up, then down, and after some time (depending on the bouncyness), all the way out To the area and live there.

This game is 2.5D, so the bottom will not work if there is a static physics ground.

To do this, I have come up with two options, and whoever worked well:

Make a floating invisible, 2x1 physics platform at this point, Where I want to hit the item and want to back up and down. This platform is built when I leave the item, and the item is removed from the settled (Sleep).

When the item passes a certain point, force or change the speed of the spacing.

However, because my gravity has been set to 40 (the normal gravity of 9.8 also was flipped), once it stops bouncing on the platform, and from 20 to -40 (variation) Will come in the middle of the velocities, do not go to sleep

The injection force method has also caused a strange result, because the code examines the velocities for the entrance event, so the results are not consistent.

I think invisible times are most understood. I play gravity back with normal bounce and density to get something that is close to normal and bouncy.

No comments:

Post a Comment