Copyright © 2024 by Víctor Parada


This is a little game for the 2025 NOMAM's BASIC 10-liners Contest. This program fits in the PUR-120 category, and it was written using FastBasic 4.6 for the 8-bits ATARI XL/XE computers line. Development started on 2024-03-29, and it took 2+2+1 days. The final version's date is 2024-04-08.


Avoid Blinky while clearing the row of dots, but you can catch him after eating the power pill.


PACLINE start Press the button to start.
PACLINE move You are Pac-man on the left side, Blinky is at the right one. Both will run against each other. Press the button to turn around and avoid Blinky.
PACLINE wrap Escape through the sides. Blinky won't follow you through that path.
PACLINE pill When you eat the power pill, Blinky will be scared for a moment and you can catch him while he is purple.
PACLINE score Scoring: At level 1, each dot gives 1 point, power pill gives 4 and the purple ghost gives 20. These points are doubled in level 2, tripled at level 3 and so on.
PACLINE level Each time you eat all the dots of the row, the difficulty level will be increased a bit: the time for purple ghost will be shorter and the speed of Blnky will increase.
PACLINE end There is only one life. The game is over when Blinky captures you. Press the button to try again.

Development of the game

A ZPH show featured a WIP game called "Pac-Line 2600" for the Atari 2600 console, the first game programmed by the host James Earl O'Brien. In a previous talk with him, while the game was a secret, he told that this game could be written as a tenliner, and I said that I could try to port it during the show when he had revealed it. During the show, he explained that this game was a port from "Pac-Line", a PICO-8 game by sizescape, which is an enhanced port of "Paku-Paku" by Kenta Cho, a web game released on January 2024.

Original Paku-Paku

Original Paku-Paku game.

Current Pac-Line

Current Pac-Line version for PICO-8.

Initial 2600 version

First public 2600 version by James.

I started the development during the show, but the design of the required bitmaps took more time than expected, so I couldn't have a working proto before the end of the show. Anyway, some hours later I could publish in the forum thread a video of my first prototype. Even though both Pac-Line and James' version used the joystick to move Pacman, I decided to use the single-button approach of Paku-Paku; this means that you only have to press the button to change the direction, since Pacman is always moving to either side. The next day, I made major improvements and had a new playable prototype. Before publishing it, I wanted to know the effect about that in the context of the Tenliners Contest. Bunsen from NOMAM confirmed me that this won't invalidate it as an entry for next year's contest, so I published a second video for the current prototype.

PACLINE prototype

Initial prototype.

PACLINE prototype

Second playable prototype.

The following updates were the fine tunning the difficulty increase and to add sound effects. The game started easy enough to learn the mechanics, but the difficulty slowly increased up to the crazy level 25, where it could not be beaten, as the ghost speed doubles Pacman's. On each level the earned score is multiplied by the level number, so it would increase a lot on faster levels. When reaching level 25, if all the ghost were captured, the score should be 11700 points. Any aditional points from there would be considered lucky ones. So, the objective of the game is to capture all the ghosts before reaching the last level, with the purpose of maximizing the score before the end of the game.

But while testing, I found that it was too easy to master the game and to reach to the crazy level, and I wanted to change that by doubling the speed: instead of to move one pixel at a time, move two. The result was a very fast game, a bit harder to master and to reach the top level. In my opinion, it a was better gameplay, and I left it.

After couple of days tweaking and commenting the code, I could have a working release candate with sound FX. I sent it to some friends (including James) to betatest it and receive some feedback.

PACLINE prototype

New bitmaps and new name.

As I recalled that James prefered the joystick approach instead of a single-button one, I changed this for him, and found that I could save one byte of source code by doing this (and four more at the variables initialization because a control variable to avoid coninuous side change by not releasing the button was not required). So, either way, the game was still a tenliner, so I decided to include both versions in the distribution disk, but I'm not sure which version will be submitted to the contest.

The final tweaks were palette for the NTSC version and some changes in the bitmaps that look better on the faster version. BTW, there are no timers based on the refresh rate of the TV system, so both PAL and NTSC versions should run at the same speed.

Download and try

Get the PACLINE.ATR file and set it as drive 1 in a real Atari (or emulator). Turn the computer on and a menu should start after the loading completes, then use computer console keys to select between PAL and NTSC, and from single button and joystick mode to control Pacman. A joystick in port 1 is required.

The code

The abbreviated BASIC code is the following:

The full and expanded BASIC listing is:

PAC-LINE tenliner
(c) 2024 by Víctor Parada

P/M use:
P0: Pacman
P1: (Fearful) Ghost body
P2: Ghost eyes
P3: Fearful second layer to avoid transparency
Missiles are not used
a=adr("{binary data}")+1
Binary data:
3x8 bytes: Charset (dot, pill and borders)
3x9 bytes: Pacman bitmap (left, closed, right)
2x9 bytes: Ghost bitmap (left 1 and 2)
2x9 bytes: Ghost bitmap (right 1 and 2)
2x9 bytes: Ghost bitmap (fearful 1 and 2)
8 bytes: Color palette
Pacman bitmaps pointer
Ghost bitmaps pinter
Fearful ghost pointer
Constant to save space later
graphics 8
Clears top of RAM (including P/M area)
graphics 29
Set graphics mode 13 (ANTIC 5) without text window (40x12)
pmgraphics 2
Set double line resolution P/M graphics mode
move f+18,704,8
Color palette
move $E000,$7000,512
move a,$7008,24
Copy the charset to RAM and replace some chars
poke 756,$70
Change to new charset
poke a,7
poke a+6,7
Change 2 lines to graphics mode 2 (ANTIC 7) for title and score
Pointer to the first dot in the playfield
position 4,2
print #6,"{binary data}"
Print title
mset m-41,33,3
mset m+39,33,3
Draw playfield borders
mset pmadr(3)+57,6,126
Set a block for the second layer of the Fearful Ghost
  while strig(0)
Wait for trigger to begin

Initialize game variables
Pacman position
Ghost position
Pacman direction (1=right, -1=left)
Delay for Ghost's counter
Trigger release control flag (1=pressed, 0=released)
Dots count
Hit flag
Killed ghost flag (select side for eyes to go)
Timer for fearful Ghost
Round counter
Dot & pill FX delay
Timer for Pacman
Timer for Ghost

The following variables are initialized to 0 autiomatically at start-up, then reused at current count:
Animation counter for Pacman:
Animation counter for Ghost:
    if n=0
Draw the dots and pill over empty playfield
Random location of the pill
      poke m,1
Draw first dot
      move m,m+2,29
Copies the dot to the right
      poke m+2+a+18*(x<31),2
Pill must be in the other half
      inc r
Increase round number
      if q and r&3=0 then dec q
Speed up the Ghost every 4 rounds
Number of dots
    v=not v
Timer for Pacman
Timer for Ghost
    if v=0
Move Pacman
Pacman animation timer
      x=(x+o+62) mod 62
Compute next Pacman position (with wrap around)
      move p+9*o*(t/2),pmadr(0)+55,9
Update to the corresponding Pacman bitmap
      pmhpos 0,x+x+61
Update Pacman position
    if a
Got a dot or pill?
      if a=2 and not k then j=24+q*4
Got a pill? Set fearful Ghost timer
      poke c,0
Remove dot or pill
      exec _s i
      dec n
Decrease dot+pill count
Sound FX depends on dot type
    if w=0 or k and v
Move Ghost
      if k
Eyes only?
Compute direction
        if b
At the target side?
          exec _g g,e-b*$1B,0,y+y+61,0
No, advance one step
Yes, re-enable Ghost
      if not k
Not the eyes-only mode?
        u=not u
Animation step
        if j then dec j
Decrease fearful ghost counter if enabled
Compute Ghost direction
        if j
Check again the counter in order to draw the right ghost mode
          if y<61 and y then y=y-b
Compute new position of fearful ghost going to the opposite direction
          poke 705,
Set fearful ghost color (blinks when time will be over)
          exec _g f+9*u,0,y+y+61,0,
Only fearful bitmap, no eyes
Compute Ghost new position
          poke 705,$24
Restore Ghost color
          exec _g g+9*(b+u),
Animate Ghost to the corresponding direction (including eyes)
    if z then dec z
    sound 0,40+z*2*i,10,z
Dot got FX
    poke 77,0
Disable attract mode
    if strig(0)
Check the trigger
If not pressed, set the "released" flag
    elif l
If pressed and the released flag is set
Change Pacman direction
Reset the "released" flag
    h=abs(x-y)<3 and not k
Collision control.
Hitbox allows 3 pixels overlap
(ignored when in "eyes-only" mode)
    if j and h
Check a hit when the Ghost in fearful mode
Exit fearful mode
Reset killed flag
Enable eyes-only mode
      exec _s 20
Increase the score
  until j=0 and h
Game finishes when Pacman is captured
  for a=0 to 9
    sound 0,8+a*8,6,8
    poke pmadr(0)+55+a,0
    pause 2
  next a
Game over sound FX
Next try?
proc _g a b c d dd
Update Ghost bitmap and position
P1: Ghost body
P2: Ghost eyes
P3: Fearful Ghost background block
  move a,pmadr(1)+55,9
Update body bitmap
  dpoke pmadr(2)+57,b
Update eye bitmap (2 bytes)
  pmhpos 1,c
  pmhpos 2,d
  pmhpos 3,dd
Update corresponding horizontal position
proc _s a
Update and print score
  position 25,7
  print #6,rtab(32) s
The level is a score multiplier

Return to my 10-liners page.

© 2024 by Víctor Parada - 2024-04-04 (updated: 2024-04-13)