Hi,
Meanwhile I've managed to simplify down my DoAnimate yes or no logic.... here is the new code :
Code:
procedure TMain.LoadLevel;
var i,j : integer;
begin
for j := 0 to 14 do
begin
for i := 0 to 19 do
begin
BackGround[i,j] := TBackGround.Create(SpriteEngine);
BackGround[i,j].ImageName:= 'Empty.image';
BackGround[i,j].X:=i*32;
BackGround[i,j].Y:=j*32;
BackGround[i,j].Z:=1;
BackGround[i,j].AnimStart:=1;
BackGround[i,j].AnimCount:=3;
BackGround[i,j].AnimSpeed:=0.01;
BackGround[i,j].AnimLooped:=true;
end;
end;
end;
procedure TMain.DrawLevel;
var i, j: Integer;
begin
for j := 0 to 14 do
begin
for i := 0 to 19 do
begin
Used_Tile := Images.Item[map.data[i,j+Offset]];
BackGround[i,j].ImageName:= Used_Tile.Name;
if BackGround[i,j].PatternCount = 1 then
begin
BackGround[i,j].DoAnimate:=false;
end
else
begin
BackGround[i,j].DoAnimate:=true;
end;
BackGround[i, j].Draw;
end;
end;
end;
The problem still persists.... my water tile animation are no longer synced....how can I sync them? It does not matter if all animation would be synced, since I will use the map.anim to specify from which frame to start the animation , and add the map.animspeed to the mix, to make things like lights etc... be "unique" .
Greetings
Robert
Bookmarks