## Tiny Pacman 2: Pacman Strikes Back

Level five of Pacman Strikes Back

Program listing on 48K Spectrum. All additional concepts and implementation for this version by Einar Saukas

### Text Listing

 ```1 BORDER 0: POKE 23693,1: CLS : DIM p(10): FOR l=0 TO 4: RESTORE : READ w,s,m\$,m\$: FOR a=1 TO 10: LET p(a)=85-9*a: PRINT AT a,0;m\$(a*w-11 TO a*w): NEXT a: LET m\$(p(1)+1)="": LET k=CODE INKEY\$-48: FOR a=1 TO l+2: LET g=p(a): LET i=8*RND-4: LET i=(a=1)*((k=7)-(k=6)+w*((k=8)-(k=9)))+SGN (ABS i-2+SGN (p(1)-g))*(1+11*(i>0))*(g<>p(1)): LET c=CODE m\$(g+i+1)-45: LET p(a)=g+i*(c<2)-i*(m\$(g-i+1)<"O")*(c>1)*(a>1): PRINT AT g/w+.5,g-w*INT (g/w);m\$(g+1);AT w,0;l*58+s;AT p(a)/w+.5,p(a)-w*INT (p(a)/w); INK 7-a;"c@@@@@"(a): LET s=s+(a=c): BEEP (a=1)/99,c/2+l*4: IF a=1 OR p(a)-p(1) THEN NEXT a: POKE (s<58)*23620,w: NEXT l: DATA 12,1,"OOOOOOOOOOOOO...O......OO.O..OO.OO.OO.OO.....O.OO....OO....",m\$+m\$(w TO )+m\$ ```

Note on above listing: The game uses the '(c)' copyright character as found in the ZX-Spectrum character set to represent the pacman character. This has been replaced with the standard ASCII 'c' in the above listing.

The first sequel to the game "Tiny Pacman". This version is now more difficult since there are no powerpills to protect pacman. It's also more difficult as the AI for the ghosts is greatly improved. There's still a random element to their movement, but they will sometimes appear to follow the pacman during play. All concepts and implementation for this version were done by Einar saukas, for which I am very grateful. Einar has added also sound to the game in this version, which varies depending on whether or not pacman is eating dots, also the pitch is changes with each level.

Rules of the Game

• The keys for this game are sinclair 1 joystick or keys 6-left, 7-right, 8-down, 9-up
• Only one keypress registers at a time due to the use of INKEY\$
• You only have one life. If a ghost catches you, the game is over
• Complete all 5 levels to win the game. There is an extra ghost in the maze for each successive level. The maximum possible score in this sequel is 290 points.