Here's a short video of a Centipeed clone that I'm almost finished with. I had started this a while ago, first with Borland Pascal running in DOSBOX and then I tweaked it in Larzarus. I had stopped working on it because I was getting too much flickering from the centipeed rendering, but I redid the animation process using page flipping and now it's much better. Yesterday I added the flea and today I added the spider. I have both dropping into gameplay after 100 points just for debugging purposes (no pun intended

). I have to do some more research on the triggers for both of these and then see what other critters should be added to the game.
https://www.youtube.com/watch?v=XMdtCe_po9YI had watched Centipeed gameplay on YouTube quite a few times over the last couple of days and I was wondering how I was going to do the spider movement and then I realized I could script the movements. I made 4 strings of a small command set consisting of the following:
U = straight up
V = diagonal right up
D = straight down
E = diagonal left down
R = right
W = diagonal left up
L = left
A = diagonal down left
And I made sure the strings had enough commands to bring the spider from one side of the game matrix to the other side. I track the index of the selected "script" in the spider data record and in the drawspider procedure I use a case to set the row/column changes.
Here are procedures to set the initial position and script string and the drawing routine just to illustrate the script reading. The initial setting of spider.pathstring is done with a call to Setspider(random(maxrow-5)+1,0,random(4)+1); if the spider goes out of matrix range it is declared dead.
I'll post a video of the finished game. I'm going to see about adding sound effects.
Also here is a sample of one of the scripts:
Const
spath2 = 'RRREERRRRUUUUWWWWAAAARRRRREEEEEERREEERVVVVUUUUUUDDDDDDDDRRRVVVVEEEDDDDRRRVVWWVRRR';
Procedure SetSpider(R,c,WhichPath:integer);
begin
With spider do
begin
Sindex := 1;
Row := r;
Column := c;
Dead := false;
Case WhichPath of
1:Pathstring := Spath1;
2:PathString := Spath2;
3:PathString := Spath3;
4:PathString := Spath4;
end;
end;
end;
Procedure DrawSpider;
var
rd,cd:integer;
rr,cc:integer;
P:PointType;
s:string;
ch:char;
begin
cd := 0; rd:= 0;
with spider do
begin
if not dead then
begin
s := copy(pathstring,sindex,1);
ch := s[1];
case ch of
'U':RD := -1;
'D':RD := 1;
'V':BEGIN
RD := -1;
CD := 1;
END;
'E':BEGIN
RD := 1;
CD := 1;
end;
'R':CD := 1;
'L':CD := -1;
'W':begin
cd := -1;
rd := -1;
end;
'A':BEGIN
cd := -1;
rd := 1;
end;
end;// CASE
whereisRC(row,column,p); // translates row,column to a PointType of variable.
for rr := 0 to 7 do
for cc := 0 to 5 do
if spiderchar[rr,cc] <> 0 then putpixel(p.x+cc,p.y+rr,spiderchar[rr,cc]);
if gamegrid[row,column].Occupant = mushroom then gamegrid[row,column].Occupant:= empty;
row := row+rd;
column := column+cd;
If row > maxrow then dead := true;
if column > maxcol then dead := true;
If row < 0 then dead := true;
if column <0 then dead := true;
end;
inc(sindex);
if sindex > length(pathstring) then dead := true;
end; // with spider
frametick(180);
end;