Z
Zakarul
Guest
Hi,
i have, maybe, a stupid problem...
basically i am trying to make my character climb up a ledge. For now my character can stand on a ledge(withing a script) and jump up(leaving the script) but prefer to play a fixed animation of him climbing it and standing on it. just like this
https://media.giphy.com/media/l0MYAXkWeyON64x3y/giphy.gif
i was able to do something by teleport my character up and left/right by using the timeline(by assigning a number to x and y in different steps). i don't want it to teleport, but move it so i can play the correct sprite.
giving a number my vsp and hsp do nothing in the timeline (i don't want to use hspeed and vspeed even if they work)
what is the best way to it?
Thank you!!
the creation code for my character (obj_player)
this is the ledge grab script:
i have, maybe, a stupid problem...
basically i am trying to make my character climb up a ledge. For now my character can stand on a ledge(withing a script) and jump up(leaving the script) but prefer to play a fixed animation of him climbing it and standing on it. just like this
https://media.giphy.com/media/l0MYAXkWeyON64x3y/giphy.gif
i was able to do something by teleport my character up and left/right by using the timeline(by assigning a number to x and y in different steps). i don't want it to teleport, but move it so i can play the correct sprite.
giving a number my vsp and hsp do nothing in the timeline (i don't want to use hspeed and vspeed even if they work)
what is the best way to it?
Thank you!!
the creation code for my character (obj_player)
Code:
///INIT
grav = 0.4;
hsp = 0;
hsp_carry = 0;
vsp = 0;
jumpspeed = 9;
walljump = true;
movespeed = 4;
wallspeed = 2;
facingRight = true;
hp = 100;
key_down = 0;
can_move_block = false
grounded = false
state = scr_player_movestate
this is the ledge grab script:
Code:
///scr_ledge_grab_state()
scr_player_input()
var key_jump = keyboard_check_pressed(vk_space)
var key_down = keyboard_check(vk_down)
var key_up = keyboard_check_pressed (vk_up)
if ((key_jump && key_left) && (place_meeting(x+1,y,obj_wall))) || ((key_jump && key_right) && (place_meeting(x-1,y,obj_wall)))
{
vsp = -jumpspeed;
state = scr_player_movestate;
}
if (key_down) {
state = scr_player_movestate;
}
if (key_up) && (place_meeting(x-1,y,obj_wall) || place_meeting(x+1,y,obj_wall))
{
timeline_index = tml_climbup_action;
timeline_position = 0;
timeline_running = true;
timeline_loop = false;
}
Last edited by a moderator: