Skocz do zawartości

Rekomendowane odpowiedzi

Opublikowano

<_< 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?

Opublikowano

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.

Opublikowano

Moze jednak ktos sie jakos jeszcze wypowie w tej sprawie?? :boxed:

Dodatkowy problem: kod nie animuje mi postaci....

HEEEELP! :sp_ike: :sp_ike: :sp_ike: :sp_ike:

Opublikowano

<_< heh, czyli nie pozostaje mi nic niz czekac na mistrza Tymona badz na laske oswiecenia...... :(

:sp_ike: :sp_ike: :sp_ike: :sp_ike: :sp_ike: :sp_ike: :sp_ike:

Opublikowano
raczej niet^^ jeszcze tego nie robilem *nie bylo takiej potrzeby xD

Lol to se zmień - będzie wygodniej... no chyba żę nie umiesz bo wtedy nie będziesz wiedział co zmienić w przykładzie żeby działało <_<

Opublikowano

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

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ę...