I had a big brain mix up.

Non-platform specific questions.

I had a big brain mix up.

Postby Hblade » Sat Mar 17, 2007 6:22 pm

Lol, I havn't made a pla form game in so long. platform game in so long, that forgot how to make a good jump. Lol. I forgot how to repeat false the jump, meaning, you can opnly jump one time. I can't believe I forgot how to do that. Can someone please tell me how I can make a 1 jump thing? Lol.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Postby DilloDude » Sat Mar 17, 2007 10:27 pm

I've discovered a new method which works really well, allthough not so well on slopes (probably). I'll tell you soon, because I have to go now.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby DilloDude » Sun Mar 18, 2007 12:53 am

Here is what you do: first, you make a set of ground tiles. Make them whatever size you want. Then, mak another sort of tile: these should have the same width as the ground tiles, but be only one pixel high. Tile out the ground tiles in your level. Then, tile the othr tiles (call it topSense or something like that) so it's sitting just on top of the ground tile. It should be occupying th pixels just above the ground tiles, not the top row of the tiles. Your player has a collision event with the top side of the ground tiles (or any actor and check variables) which sets a jump variable to onGround (whatever value you want) and does the physical response. Add a collision finish event with the topSense tiles which sets the jump variable to inAir. In the player's draw actor, put a code the checks if you are in the air and yvelocity is less than a certain value, and increases the yvelocity:
Code: Select all
if (jumpState == inAir && yvelocity < 30)
{
    yvelocity += .5;
}
The good thing about this is that it only makes you fall when you are not on the platform, so ou aren't repeatedly calculating the collision. When you want to jump, check if the jumpState variable is onGround, and if it is, activate the jump code.
Hope this helps. If you have problems, just ask.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest