Código: Selecionar todos
#region INPUTS
input_left = keyboard_check(vk_left);
input_right = keyboard_check(vk_right);
input_jump = keyboard_check_pressed(ord("Z"))
#endregion
#region MOVIMENTAÇÃO E COLISÃO
move = +input_right -input_left;
hspd = move*spd;
if place_meeting(x+hspd, y, obj_block){
while !place_meeting(x+sign(hspd), y, obj_block){
x+=sign(hspd);
}
hspd = 0;
}
x+= hspd;
if place_meeting(x, y+vspd, obj_block){
while !place_meeting(x, y+sign(vspd), obj_block){
y+=sign(vspd);
}
vspd = 0;
}
y+= vspd;
if place_meeting(x, y+1, obj_block){
if input_jump{
vspd = jspd;
hspd = 3;
}
} else {
vspd += grav;
}
#endregion
#region
var wall = place_meeting(x+sign(hspd), y, obj_block);
if (wall){
???
}