RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

[GM] Jumping...

Started by Rathalos888, September 03, 2007, 03:45:58 PM

0 Members and 1 Guest are viewing this topic.

Rathalos888

Can someone please help me, step by step, how I can make a character jump Right now I have:
Check whether in the air.
If a position is collision free x:0 y:0
Set the gravity to 50 in direction down
Else
Set the gravity to 0 in direction 0
Limit the vertical speed.
If vspeed is larger than 12 (variable)
Set the vertical speed to 12

I am sure this sounds retarted, but I just can't get it, as right now what happens is He'll jump, but won't come back down x_x. Please help.

Also, I read the platforming tutorial, I was so confused >_< ???

Thanks

J-Crew

Well 1st of all, you need to check if there's a collision below your character, not on the character, So change the  "If a position is collision free x:0 y:0" to "If a position is collision free x:0 y:1" Also you've set the gravity really high compared to your max vertical speed. Try setting the gravity to 2 or 2.5. Thats may help. If all this doesn't work, I'll be here to help if you need it.

LostNSpace

I'm having a problem with the character landing, it lands about 4-8 pixels above the ground, but if I move the character will land on the "ground". Here is how I have my events/actions set:

                                        (Character)Mario_Right_0(stationary Mario pic)

Create: Set Grav to 2 at 270 Degrees(How come there is no degree key on a keyboard? sorry, back to the point)
Collision with L_Edge_Grass_01: Set Grav to 0 at 270 Degrees
Collision with C_Grass_01: Set Grav to 0 at 270 Degrees
Collision with R_Edge_Grass_01: Set Grav to 0 at 270 Degrees
Press(Space): Jump to given position X,0 Y,-48
                     : If a position is collision free X,0 Y,1
                     : Set Grav to 2 at 270 Degrees
Press(Left): If a position is collision free X,0 Y,1
                 : Set Grav to 2 at 270 Degrees
                 : Change Sprite to Mario_Left_1(animated gif of mario moving left)
                 : Start moving in a direction(Left)
Press(Right): If a position is collision free X,0 Y,1
                   : Set Grav to 2 at 270 Degrees
                   : Change Sprite to Mario_Right_1(animated gif of mario moving right)
                   : Start moving in a direction(Right)
Release(Left): If a position is collision free X,0 Y,1
                   : Set Grav to 2 at 270 Degrees
                   : Change Sprite to Mario_Left_0(Stationary pic facing left)
                   : Start moving in a direction(Stop)
Release(Right): If a position is collision free X,0 Y,1
                   : Set Grav to 2 at 270 Degrees
                   : Change Sprite to Mario_Right_0(Stationary right facing pic)
                   : Start moving in a direction(Stop)


Well that sums up what I have so far. It's just not working quite like I would like and I didn't want to make a seperate topic since this already dealt some with jumping.

Lab_Zero

first, to Rathalos888: you also need to set you gravity 0f 270 to 0

second to LostNSpace: why not use (no Key) in the events under keyboard(not pressed or released.