Skocz do zawartości

spozniona animacja


pilar36

Rekomendowane odpowiedzi

<_< otoz mam taki kod w stepie:

// kozystam z przykladu "znajdowanie drogi"

 

if direction=0 then sprite_index=n_e;

if direction=45 then sprite_index=n_ne;

if direction=90 then sprite_index=n_n;

if direction=135 then sprite_index=n_nw;

if direction=180 then sprite_index=n_w;

if direction=225 then sprite_index=n_sw;

if direction=270 then sprite_index=n_ss;

if direction=315 then sprite_index=n_se;

 

 

if(mouse_check_button_pressed(mb_left))

{

Ready = true;

path_end();

direction=( point_direction(x,y,mouse_x,mouse_y) div 45 ) *45;

with(P)instance_destroy();

mp_grid_path(g,p0,x,y,(mouse_x div 32*32)+16,(mouse_y div 32*32)+16,true);

for(i=1;i<path_get_number(p0);i+=1)

{

xx = path_get_point_x(p0,i);

yy = path_get_point_y(p0,i);

instance_create(xx,yy,P);

}

 

}

if(mouse_check_button_pressed(mb_right) && Ready)

{

Ready = false;

path_start(p0,szybkosc,0,1);

 

}

 

Wszystko jest ok tylko ze zmiana animacji nastempuje z sekundowym opuznieniem, co zrobic aby takiego opuznienia nie bylo?

Odnośnik do komentarza
Udostępnij na innych stronach

Nie wiem, może spróbuj zamienić kolejność, tj. to:

if direction=0 then sprite_index=n_e;
if direction=45 then sprite_index=n_ne;
if direction=90 then sprite_index=n_n;
if direction=135 then sprite_index=n_nw;
if direction=180 then sprite_index=n_w;
if direction=225 then sprite_index=n_sw;
if direction=270 then sprite_index=n_ss;
if direction=315 then sprite_index=n_se;

przenieść na sam koniec.

Odnośnik do komentarza
Udostępnij na innych stronach

daj tak:

// kozystam z przykladu "znajdowanie drogi"



if(mouse_check_button_pressed(mb_left))
{
Ready = true;
path_end();
direction=( point_direction(x,y,mouse_x,mouse_y) div 45 ) *45;
with(P)instance_destroy();
mp_grid_path(g,p0,x,y,(mouse_x div 32*32)+16,(mouse_y div 32*32)+16,true);
for(i=1;i<path_get_number(p0);i+=1)
{
xx = path_get_point_x(p0,i);
yy = path_get_point_y(p0,i);
instance_create(xx,yy,P);
}

}
if(mouse_check_button_pressed(mb_right) && Ready)
{
Ready = false;
path_start(p0,szybkosc,0,1);

}

if direction=0 then sprite_index=n_e;
if direction=45 then sprite_index=n_ne;
if direction=90 then sprite_index=n_n;
if direction=135 then sprite_index=n_nw;
if direction=180 then sprite_index=n_w;
if direction=225 then sprite_index=n_sw;
if direction=270 then sprite_index=n_ss;
if direction=315 then sprite_index=n_se;

nie mogę z was :P

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...