Witam.
Jako, że to mój pierwszy post to przydałoby się przywitac, więc Witam Wszystkich.
Mam sobie ludzika, który może strzelac w 8 kierunkach.
Ale nie o to chodzi. Chcę zrobic, by po uderzeniu pocisku w ścianę nastąpiła animacja wybuchu.
Kod:
while( speed > 0)
{
speed--;
frame++;
if( frame > 800)
{
frame=0;
}
}
if( frame<50) { draw_sprite(bufor, wybuchnaboj01, naboj1_x, naboj1_y); }
else if( frame>=50 && frame<100) { draw_sprite(bufor, wybuchnaboj02, naboj1_x, naboj1_y); }
else if( frame>=100 && frame<150) { draw_sprite(bufor, wybuchnaboj03, naboj1_x, naboj1_y); }
else if( frame>=150 && frame<200) { draw_sprite(bufor, wybuchnaboj04, naboj1_x, naboj1_y); }
else if( frame>=200 && frame<250) { draw_sprite(bufor, wybuchnaboj05, naboj1_x, naboj1_y); }
else if( frame>=250 && frame<300) { draw_sprite(bufor, wybuchnaboj06, naboj1_x, naboj1_y); }
else if( frame>=300 && frame<350) { draw_sprite(bufor, wybuchnaboj07, naboj1_x, naboj1_y); }
else if( frame>=350 && frame<400) { draw_sprite(bufor, wybuchnaboj08, naboj1_x, naboj1_y); }
else if( frame>=400 && frame<450) { draw_sprite(bufor, wybuchnaboj09, naboj1_x, naboj1_y); }
else if( frame>=450 && frame<500) { draw_sprite(bufor, wybuchnaboj10, naboj1_x, naboj1_y); }
else if( frame>=500 && frame<550) { draw_sprite(bufor, wybuchnaboj11, naboj1_x, naboj1_y); }
else if( frame>=550 && frame<600) { draw_sprite(bufor, wybuchnaboj12, naboj1_x, naboj1_y); }
else if( frame>=600 && frame<650) { draw_sprite(bufor, wybuchnaboj13, naboj1_x, naboj1_y); }
else if( frame>=650 && frame<700) { draw_sprite(bufor, wybuchnaboj14, naboj1_x, naboj1_y); }
else if( frame>=700 && frame<750) { draw_sprite(bufor, wybuchnaboj15, naboj1_x, naboj1_y); }
else if( frame>=750 && frame<800) { draw_sprite(bufor, wybuchnaboj16, naboj1_x, naboj1_y); }
Wszystko pięknie działa, tylko chodzi mi o to, żeby ta animacja się nie powtarzała!
Macie jakieś pomysły?
Pozdrawiam.
wrobelbiz