C64 Workshop Part 5

Final Project

You’ve learned input/output, graphics, sprites, joystick control, collision detection, and sound. Time to combine everything into a complete game.

Objective

Create a complete, playable game using skills from the workshop series.

Requirements

Bonus


Project Options

Option A: Maze Explorer

Recommended — Tile-based movement works perfectly with BASIC.

Navigate a maze collecting items while avoiding enemies.

Win: Collect all items. Lose: Run out of 3 lives.


Option B: Card Game

Recommended — Turn-based gameplay is ideal for BASIC.

Create a card game using character graphics for cards.

Suggested games: War, Blackjack, High/Low, Memory Match

Example (High/Low):

Win: 20 correct guesses. Lose: 3 wrong in a row.


Option C: Catch & Avoid

⚠️ Moderate — BASIC’s loop speed limits responsiveness.

Move left/right to catch good items and dodge bad ones falling from above.

Win: Reach 50 points. Lose: Run out of 3 lives.


Option D: Your Own Design

Have another idea? Go for it—just include all requirements. Turn-based or discrete-movement games work best.

Ideas: Snake, Whack-a-mole, Simon Says, quiz game, reaction timer


Development Tips

Build in Stages

  1. Display sprite/characters
  2. Add input
  3. Add one mechanic at a time
  4. Add collision
  5. Add scoring
  6. Add sound
  7. Polish

Test Often

Run after each change. Save frequently: SAVE "@:MYPROJECT",8

Use Subroutines

GOSUB jumps to a line number, runs code until RETURN, then continues where it left off. Unlike GOTO, it remembers where you came from.

10 GOSUB 100: REM PLAY SOUND
20 PRINT "DONE"
30 END
100 POKE 54296,15: POKE 54276,17
110 FOR D=1 TO 50: NEXT D
120 POKE 54276,16
130 RETURN

Organize your game with subroutines:

  • 100-200: Main loop
  • 300-400: Player movement
  • 500-600: Enemy movement
  • 700-800: Collisions
  • 900-1000: Drawing
  • 2000+: DATA statements

Plan on Paper

Sketch your 40×25 screen layout first. Design sprites with the editor from Part 3 before coding.


Quick Reference

Part 1: Basics

PRINT, INPUT, IF/THEN, GOTO, RND, CHR$

Part 2: Screen Memory

  • POKE 1024+pos, char — character
  • POKE 55296+pos, colour — colour
  • POKE 53280/53281, colour — border/background
  • Position = (ROW × 40) + COL

Part 3: Sprites & Joystick

  • POKE 2040, 128 — pointer
  • POKE 53269, 1 — enable
  • POKE 53248/53249, X/Y — position
  • POKE 53287, colour — colour
  • J=PEEK(56320) — read joystick
  • IF (J AND 1)=0 — UP, IF (J AND 16)=0 — FIRE

Part 4: Collision & Sound

  • C=PEEK(53278) — background collision
  • C=PEEK(53279) — sprite collision
  • POKE 54296, 15 — volume
  • POKE 54272/54273, freq — pitch
  • POKE 54276, waveform+1 — gate on
  • Waveforms: 17=triangle, 33=sawtooth, 65=pulse, 129=noise

Advanced: Sprites Behind Background

POKE 53275, value sets sprite priority. Set bit N to put sprite N behind background colours 1-15.

10 POKE 53275, 1: REM SPRITE 0 BEHIND BG

Multiple sprites: add bit values (sprites 0+1 = 1+2 = 3, sprites 0+1+2 = 1+2+4 = 7).


Advanced: Scrolling

VIC-II can scroll 0-7 pixels before you shift screen memory.

  • POKE 53270, value — horizontal scroll (bits 0-2), 40-col mode (bit 3). Default: 8
  • POKE 53265, value — vertical scroll (bits 0-2), 25-row mode (bit 3), screen on (bit 4). Default: 27

Warning: If bit 4 of 53265 is cleared, the screen goes blank!

10 POKE 53270,0: REM 38 COLUMNS, SCROLL=0
20 FOR I=0 TO 7
30 POKE 53270,I: REM SCROLL RIGHT
40 FOR D=1 TO 50: NEXT D
50 NEXT I

Note: True smooth scrolling requires shifting screen memory each character—difficult in BASIC. Consider static screens or room transitions instead.


Good luck!

Previous: Part 4 - Collision Detection and Sound | Back to Home