Commit 2fd43e9c authored by bocianu's avatar bocianu

visual improvements, mostly

parent 745c58d6
- better random dir
- level select
- sound for goal reached
- sound for goal reached and fruit
- 2 hard levels to reach 30
- wacka-wacka sound?
- locks ??
......
No preview for this file type
......@@ -619,23 +619,24 @@ var
pac_sprites: array [0..4] of pointer = (@pac_up, @pac_right, @pac_down, @pac_left, @pac_up);
ghost_sprites: array [0..4] of pointer = (@ghost_up, @ghost_right, @ghost_down, @ghost_left, @ghost_escape);
fences: array [0..15] of word = (
fences: array [0..16] of word = (
$4f4f, // 0 none
$4F4F, // 1 T
$5050, // 2 B
$5151, // 2 B
$5151, // 3 TB
$4f52, // 4 L
$4F54, // 5 TL
$5056, // 6 BL
$5156, // 6 BL
$5158, // 7 LTB
$534f, // 8 R
$554F, // 9 TR
$5750, // 10 BR
$5751, // 10 BR
$5951, // 11 TBR
$5352, // 12 LR
$5554, // 13 TLR
$5756, // 14 BLR
$5958 // 15 LTBR
$5958, // 15 LTBR
$504F // 16 rbCORNER
);
tiles: array [0..19] of word = (
......
......@@ -2,7 +2,6 @@ program pacmad;
uses datamatrix, _atari, mypmg, dlist, rmt;
{$I globals.inc}
{$I assets/sprites.inc}
......@@ -182,8 +181,6 @@ end;
procedure UpdateLives;
begin
Str(lives, s);
//Str(boardLastLine, s);
asm {
ldy #1
@ lda adr.s,y
......@@ -200,13 +197,10 @@ end;
procedure UpdateLevel;
begin
Str(startingLevel+1, s);
//Str(boardLastLine, s);
asm {
ldy #1
@ lda adr.s,y
sub #32
sta TXT_RAM+40*15+30,y
iny
dec adr.s
......@@ -421,7 +415,7 @@ begin
end;
procedure PaintBoard;
var row, col, cell: byte;
var row, col, cell, t: byte;
voffset, boffset, tile: word;
begin
voffset := GFX_RAM;
......@@ -429,18 +423,22 @@ begin
boardLastLine := 0;
dotCount := 0;
for row := 0 to BOARDHEIGHT - 1 do begin
if (board[boffset] = TILE_VOID) then
tile := fences[GetNeighbours(0,row) and 15]
else
if (board[boffset] = TILE_VOID) then begin
tile := fences[GetNeighbours(0, row) and 15];
if (Hi(tile) = $4f) and canMoveTo(1, row+1) then tile := fences[16];
end else
tile := tiles[board[boffset]];
Poke(voffset, Hi(tile));
Inc(voffset);
Inc(boffset);
for col := 1 to BOARDWIDTH - 2 do begin
cell := board[boffset];
if cell = TILE_VOID then
tile := fences[GetNeighbours(col,row) and 15]
else begin
if cell = TILE_VOID then begin
t := GetNeighbours(col,row) and 15;
tile := fences[t];
if (Hi(tile) = $4f) and CanMoveTo(col+1, row+1) then
tile := (tile and $00ff) or $5000;
end else begin
tile := tiles[cell];
if (cell = TILE_DOT) then Inc(dotCount);
boardLastLine := row;
......@@ -583,7 +581,6 @@ begin
Inc(ghostCount);
end;
procedure KillGhost(ghostNumber: byte);
begin
g := ghosts[ghostNumber];
......@@ -617,7 +614,6 @@ begin
result := n2dir[result];
end;
function Reverse(dir: byte): byte;
begin
result := dir;
......@@ -708,7 +704,6 @@ begin
if ((g^.dir = DIR_RIGHT) or (g^.dir = DIR_DOWN)) then g^.step := g^.step + step;
if ((g^.dir = DIR_LEFT) or (g^.dir = DIR_UP)) then g^.step := g^.step - step;
if Abs(g^.step) = 8 then begin // moved into new position
if (Abs(shortInt(g^.y-pac.y))<GHOST_DESPAWN_DISTANCE) then g^.despawn := 0
else g^.despawn := g^.despawn + 1;
......@@ -876,7 +871,6 @@ begin
end;
procedure CheckIfPacTurns;
begin
if (pac.dir <> DIR_NONE) then begin; // if pac was, moving check if it's able to continue movement
case pac.dir of
......@@ -921,7 +915,6 @@ begin
viewportMoveDir := -1; // start scroll screen down
end;
end;
end;
function PacColider: byte;
......@@ -1027,7 +1020,6 @@ begin
ReadSecret;
case titleStage of
0: begin
for i:=0 to 3 do begin
......@@ -1328,7 +1320,6 @@ begin
_COLOR3_ := level.colors[3];
_COLOR4_ := level.colors[4];
PaintBoard;
InitView;
dotCount := dotCount - level.dotLimit;
......@@ -1343,7 +1334,6 @@ begin
UpdateLives;
end;
procedure GameRestore;
begin
InitView;
......@@ -1538,8 +1528,7 @@ begin
ClearGhosts;
SongStart(SONG_WIN)
end;
level.colors[4] := (frame shl 2) and %11110000;
_COLOR4_ := level.colors[4]; // blink colors
level.colors[1] := ((frame shl 2) and %11110000) or 6;
pac.frame := 2; // spin pac
pac.dir := (frame shr 2) and 3;
pac.sprite := pac_sprites[pac.dir];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment