Hello everybody,
I need help with a triggers that I detail below:
I have a cannon that when firing, moves 5 points further back and to return it to its position I move it with the up arrow key and what I need is to set a limit of points that I can move it, so as not to move it too far forward.
this is the code that moves it when it shoots ... (this code goes inside another code that handles the cannon)
and this is the code to move it with the key ... thanks in advance.
I need help with a triggers that I detail below:
I have a cannon that when firing, moves 5 points further back and to return it to its position I move it with the up arrow key and what I need is to set a limit of points that I can move it, so as not to move it too far forward.
this is the code that moves it when it shoots ... (this code goes inside another code that handles the cannon)
Code:
(try_begin),
(scene_prop_get_instance,":cannon_naval_instance1", "spr_sp_cannon_bote", 0),
(prop_instance_get_position,pos1,":cannon_naval_instance1"),
(position_move_y,pos1,-5),
(prop_instance_animate_to_position,":cannon_naval_instance1",pos1,1),
(try_end),
Code:
(try_begin),
(key_is_down, key_up),
(scene_prop_get_instance,":cannon_instance", "spr_sp_cannon_bote", 0),
(prop_instance_get_position,pos1,":cannon_instance"),
(position_move_y,pos1,2),
(prop_instance_animate_to_position,":cannon_instance",pos1,25),
(else_try),
Last edited by a moderator: