Mononoke011
Member
I'm very new to programming, and as for jumping so far, I'm able to get my character to jump on a common wall object that's below me. I've since implemented a ladder (using Shaun Spaldings tutorials) and I'm able to climb up and down it, and left and right, but haven't been able to work out jumping off of it (or onto it).
What I'm aiming for, jumping wise, is the ability to:
- jump vertically whilst on the ladder
- hold left or right whilst jumping off the ladder.
- jump onto the ladder and 'cling' onto it (I have no clue how to work this out).
-------------------------------------------------------------------
Failed Attempt - Jumping part in red below
(Changing states command from states.normal)
if (place_meeting(x, y, oLadder)) && (key_down) || (key_up)
{
hsp = 0;
vsp = 0;
state = states.ladder;
}
(states.ladder is shown)
scr_getinputs();
scr_normal_animation();
scr_collideandmove();
//Ladder Movement
hsp = 2 * (key_right - key_left); // Moving left and right
vsp = 2 * (key_down - key_up); // Moving up and down
if (key_jump)
{
vsp = -6
}
// Currently won't jump left or right at all. Pressing jump by itself causes character to instantly move up 6 frames.
// Change state back to states.normal
if (!place_meeting(x,y,oLadder))
{
hsp = 0;
vsp = 0;
state = states.normal;
}
-------------------------------------------------------------------
If anyone knows any online tutorials for this (I couldn't find anything), or could help me out, I'd be very thankful!!!! Sorry for my lack of programming knowledge
What I'm aiming for, jumping wise, is the ability to:
- jump vertically whilst on the ladder
- hold left or right whilst jumping off the ladder.
- jump onto the ladder and 'cling' onto it (I have no clue how to work this out).
-------------------------------------------------------------------
Failed Attempt - Jumping part in red below
(Changing states command from states.normal)
if (place_meeting(x, y, oLadder)) && (key_down) || (key_up)
{
hsp = 0;
vsp = 0;
state = states.ladder;
}
(states.ladder is shown)
scr_getinputs();
scr_normal_animation();
scr_collideandmove();
//Ladder Movement
hsp = 2 * (key_right - key_left); // Moving left and right
vsp = 2 * (key_down - key_up); // Moving up and down
if (key_jump)
{
vsp = -6
}
// Currently won't jump left or right at all. Pressing jump by itself causes character to instantly move up 6 frames.
// Change state back to states.normal
if (!place_meeting(x,y,oLadder))
{
hsp = 0;
vsp = 0;
state = states.normal;
}
-------------------------------------------------------------------
If anyone knows any online tutorials for this (I couldn't find anything), or could help me out, I'd be very thankful!!!! Sorry for my lack of programming knowledge
Last edited: