CLICK TO SWITCH ONor press any key
Atari 800 computer

ORANGESby Dale Lutz · ACTION!, June 18, 1984 · ACE newsletter, December 1985

An orange falls. Move your basket under it to catch it. Miss three and the game is over. The high score is kept until you switch off.

Joystick: the left and right arrow keys (or the numeric keypad) move the basket. The fire button (Space, Z or X) starts a game. A USB gamepad works too. The basket runs off one side of the screen and comes back on the other.

Pause: any other key stops the game. After about half a second, any key starts it again.

Where it came from: I wrote ORANGES in BASIC, ACTION!, FORTH and C to compare the languages. ACE printed the article, The Saga of ORANGES, and all four listings in December 1985. This is the ACTION! version, which the article called "very challenging and almost too fast". More about it.

Speed: the original speed is an estimate. Press OPTION on the 800 to cycle Normal → Slower → Slowest → Faster. Now: Normal.

TV: this is a redrawing of the TV I used as my monitor. Click the VHF dial to change channels (the Atari is on 3), the small knob or the VOLUME wheel to change the volume, and the red button to switch off.

There is no ACTION! compiler here. The listing was retyped from the newsletter's pages in 2026, and the page runs a hand translation of it into JavaScript, one function for each PROC. Nothing was fixed or added. As printed, the listing never draws the basket at the start of a game: it appears as you move it.

The ACTION! listing
; ORANGES IN ACTION
; BY DALE LUTZ 18/6/84

; GLOBAL VARIABLES, ETC.

BYTE a,plate,balx,baly,key=764,st
CARD b,catches,baskets,hi
DEFINE down="39",
  screenwidth="77",
  left="11",
  right="7"

PROC Delay()
  FOR b=1 TO 300
    DO
    OD
RETURN

PROC Wait()
  FOR a=1 TO 100
    DO
    Delay()
    OD
  key=255
  WHILE key=255
    DO
    OD
  key=255
RETURN

PROC Tone()
  Sound(1,81,10,10)
  FOR a=1 TO 30
    DO
    Delay()
    OD
  Sound(1,0,0,0)
RETURN

PROC Leftone()
  Color=0
  Plot(plate+1,down)
  plate==-1
  IF plate<2 THEN
    plate=78
    Plot(1,down)
    DrawTo(3,down)
    Color=2
    Plot(76,down)
    DrawTo(79,down)
  ELSE Color=2
    Plot(plate-1,down)
  FI
RETURN

PROC Rightone()
  Color=0
  Plot(plate-1,down)
  plate==+1
  IF plate>78 THEN
    plate=2
    Plot(75,down)
    DrawTo(79,down)
    Color=2
    Plot(1,down)
    DrawTo(3,down)
  ELSE Color=2
    Plot(plate+1,down)
  FI
RETURN

PROC Ballstart()
  balx=Rand(screenwidth)+2
  baly=1
RETURN

PROC Catchcheck()
  Color=0
  IF balx-plate<2 OR plate-balx<2 THEN

    catches==+1
    Color=2
    Tone()
  ELSE baskets==-1
    Sound(1,100,8,10)
    FOR a=1 TO 50
      DO
      Delay()
      OD
    Sound(1,0,0,0)
  FI
  Plot(balx,down)
  Poke(656,0)
  Poke(657,10)
  PrintC(catches)
  Poke(656,1)
  Poke(657,10)
  PrintC(baskets)
  Ballstart()
RETURN

PROC Startgame()
  BYTE flasher=711
  baskets=3
  catches=0
  Put(125)
  Poke(656,1)
  Poke(657,25)
  Print("PRESS fire")
  Poke(656,0)
  Poke(657,26)
  Print("oranges")
  Sound(0,250,10,10)
  Sound(1,252,10,10)
  WHILE Strig(0)=1
    DO
    Delay()
    flasher==+1
    Delay()
    OD
  Sound(0,0,0,0)
  Sound(1,0,0,0)
  flasher=70
  plate=39
  Put(125)
  Poke(656,0)
  Poke(657,2)
  Print("CATCHES 0")
  Poke(656,1)
  Poke(657,2)
  Print("baskets 3")
  Poke(656,0)
  Poke(657,30)
  Print("high ")
  PrintC(hi)
RETURN

PROC Screensetup()
  CARD dlist=560

  Graphics(5)
  b=dlist
  Poke(752,1)
  WHILE Peek(b)<>66
    DO
    b==+1
    OD
  Poke(b,70)
  Poke(b+3,6)
  Poke(b+4,6)
  Poke(b+5,6)
  Startgame()
RETURN

PROC main()
  hi=0
  DO
  Screensetup()
  Ballstart()
  WHILE baskets>0
    DO
    Delay()
    IF key<>255 THEN Wait() FI
    Delay()
    st=Stick(0)
    IF st=left THEN Leftone()
    ELSEIF st=right THEN Rightone()
    FI
    Color=0
    Plot(balx,baly)
    a==+1
    IF a>1 THEN baly==+1 a=0 FI
    Color=1
    Plot(balx,baly)
    IF baly=down THEN Catchcheck() FI
    OD

  ; This gets executed when the game
  ; is over (equivalent to the
  ; GAMEOVER routine in BASIC)

  FOR a=100 TO 200 STEP 10
    DO
    Sound(1,a,10,10)
    FOR st=1 TO 40
      DO
      Delay()
      OD
    OD
    Sound(1,250,12,10)
    FOR a=1 TO 254
      DO
      Delay()
      OD
  Sound(1,0,0,0)
  IF hi<catches THEN hi=catches FI
  OD ; infinite loop
RETURN