OBS:Não adiantou mexer na colissao.
Código: Selecionar todos
right = keyboard_check(vk_right) or keyboard_check(ord("D"))
left = keyboard_check(vk_left) or keyboard_check(ord("A"))
jump = keyboard_check_pressed(vk_space) or keyboard_check_pressed(vk_up)
move= right - left
hsp = spd * move
if place_meeting(x + hsp, y,obj_wall){
while !place_meeting(x + sign(hsp), y,obj_wall){
x+= sign(hsp)
}
hsp = 0;
}
x+= hsp
if place_meeting(y+ vsp, y,obj_wall){
while !place_meeting(x , y+ sign(vsp),obj_wall){
y+= sign(vsp)
}
vsp = 0;
}
y+= vsp
if place_meeting(y+ 1, y,obj_wall) and (jump){
vsp+=-10
}else{
vsp+=grv
}