Animacoes com rastro
bom consegui sincronizar a animação mas agora surgiu um prblema classico analizem o códico
procedure TFrmAkuma.Anima;
begin
inc(indice);
if getkeystate(39) < 0 then begin
if indice= 11 then indice:=6;
akuma.PosX:= akuma.PosX +5;
canvas.Draw(Akuma.PosX ,Akuma.posY,bmp[indice]);
end
else if getkeystate(37) < 0 then begin
akuma.PosX:= akuma.PosX - 5;
canvas.Draw(Akuma.PosX,akuma.PosY,bmp[indice]);
if indice= 11 then indice:=6;
end
else begin
if indice >= 6 then indice:= 0;
canvas.Draw(Akuma.PosX ,Akuma.posY,bmp[indice]);
end;
end;
tinha tudo pra dar certo mas as imagems dos loops anteriores não somen deijando um rastro isso é muito irritante
procedure TFrmAkuma.Anima;
begin
inc(indice);
if getkeystate(39) < 0 then begin
if indice= 11 then indice:=6;
akuma.PosX:= akuma.PosX +5;
canvas.Draw(Akuma.PosX ,Akuma.posY,bmp[indice]);
end
else if getkeystate(37) < 0 then begin
akuma.PosX:= akuma.PosX - 5;
canvas.Draw(Akuma.PosX,akuma.PosY,bmp[indice]);
if indice= 11 then indice:=6;
end
else begin
if indice >= 6 then indice:= 0;
canvas.Draw(Akuma.PosX ,Akuma.posY,bmp[indice]);
end;
end;
tinha tudo pra dar certo mas as imagems dos loops anteriores não somen deijando um rastro isso é muito irritante
Newbye
Curtidas 0
Respostas
Navoid
22/02/2003
cara isso acontece pq vc num manda o form repintar a tela
antes de pintar a nova posição vc tem que chamar a função repaint assim
****
repaint;
// seu código do desenho
****
até
antes de pintar a nova posição vc tem que chamar a função repaint assim
****
repaint;
// seu código do desenho
****
até
GOSTEI 0
Iskatrek
22/02/2003
usa double buffer
GOSTEI 0