(Nie chcę zakładać nowego tematu, a doublepost by ktoś zauważył)
Wszystko pięknie ładnie ale dzieję się takie coś:
( Ten ostatni skok )
http://www.youtube.com/watch?v=gn8WQw0i7HM
W o_hero , w evencie step mam:
GML
if (!keyboard_check(vk_left) and !keyboard_check(vk_right))or(sprite_index=s_up
or sprite_index=s_up_l or sprite_index=s_up_p ) and !place_free(x,y+1) //zamiast s_up moze byc na skos w prawo
sprite_index=stoj
if place_free(x,y+1)
vspeed+=1
if (keyboard_check_pressed(vk_left))or(keyboard_check(vk_left)and (sprite_index=stoj or sprite_index=s_bohate_prawo))
and !place_free(x,y+1){
sprite_index=s_bohater_lewo
}else
if (keyboard_check_pressed(vk_right))or(keyboard_check(vk_right)and (sprite_index=stoj or sprite_index=s_bohater_lewo))
and !place_free(x,y+1){
sprite_index=s_bohate_prawo
}
if keyboard_check(vk_up) and !place_free(x,y+1){
vspeed-=10
if sprite_index=s_bohate_prawo{
hspeed=7
sprite_index=s_up_p // tu tez
}else
if sprite_index=s_bohater_lewo{
hspeed=-7
sprite_index=s_up_l // tu tez
}else
sprite_index=s_up
}
if keyboard_check(vk_left) and !keyboard_check(vk_right) and !place_free(x,y+1) and place_free(x-5,y)
x-=5
if keyboard_check(vk_right) and !keyboard_check(vk_left) and !place_free(x,y+1) and place_free(x+5,y)
x+=5
if keyboard_check(vk_left) and keyboard_check(vk_right) and !place_free(x,y+1)
sprite_index=stoj
A w o_ziemia w kolizji z bohaterem:
GML
with(other){
if vspeed>0{
move_contact_solid(270,vspeed)
speed=0
}
}
Co jest nie tak ?