Skip to content

Commit c4fb1ca

Browse files
committed
fix: updated vz200 sprite tutorial
1 parent b37ef99 commit c4fb1ca

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Publish/tutorials/VZ200/tutorials/tutorial15_sprites_unrolled.ras

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ program UnrolledSprites;
66

77
var
88
const N : byte = 4;
9-
xp: array[N] of byte = buildtable("i*4");
9+
// x position of each sprite
10+
xp: array[N] of integer = buildtable("0");
1011
i,j : byte;
1112

1213
@spritecompiler "images/sprites1.flf" "tank" 3 0 16 8
@@ -32,12 +33,12 @@ begin
3233
for i:=0 to N do
3334
begin
3435
if (i<N/2) then
35-
tank(0, #screen, xp[i],20+i<<3)
36+
tank(0, #screen, xp[i]>>2,20+i<<3)
3637
else
37-
stuff(0, #screen, xp[i],20+i<<3);
38+
stuff(0, #screen, xp[i]>>2,20+i<<3);
3839

39-
xp[i] +=1;
40-
if (xp[i]>=128) then xp[i]:=0;
40+
xp[i] +=1+i;
41+
if (xp[i]>=127*4) then xp[i]:=0;
4142
if (i=N-1) then xp[i]+=1;
4243
end;
4344
Screen::WaitForVerticalBlank();

0 commit comments

Comments
 (0)