O
Otacon Emmerich
Guest
not sure what im doing wrong here?
it all looks like it should work but nothing is happening?
my goal right now is to have the player hold on to the wall with the key that was pressed to jump onto the wall and the key in the opposite direction is pressed jump away, if nothing is pressed for a few seconds or jump key pressed go back to move state.
it all looks like it should work but nothing is happening?
my goal right now is to have the player hold on to the wall with the key that was pressed to jump onto the wall and the key in the opposite direction is pressed jump away, if nothing is pressed for a few seconds or jump key pressed go back to move state.
Code:
-create event-
wall_jump = false;
-alarm[0]-
wall_jump = false;
-step event-
//input
key_left = keyboard_check(ord('A');
-move_state -
var key_righthold = keyboard_check(ord('D'));
var key_lefthold = keyboard_check(ord('A'));
//moving left-------------------------------------------------------------------------
if (key_left)
{
dir = -1;
if (hspd > spd)
{
hspd -= fric;
}
else
{
hspd = -spd;
}
//left wall jump
if ((on_leftwall && key_lefthold) && (!on_ground && !key_right)) && wall_jump = false{
wall_jump = true;
vspd = 0;
state = scr_walljump_left;
sprite_index = spr_wallgrab_left;
alarm[0] = 180;
}
}
scr_walljump_left
///scr_walljump_left;
var key_lefthold = keyboard_check_released(ord('A'));
vspd = 0;
if (key_right)
{
dir = 0;
wall_jump = false;
vspd = -jspd
state = scr_move_state;
}
if (key_jump) || key_lefthold
{
wall_jump = false;
state = scr_move_state;
}
Last edited by a moderator: