Skip to content
Game 0 Unit 12 of 15 1 hr learning time

Drawing With Light

Draw shapes, not just text. PLOT lights a pixel, DRAW runs a line from it, CIRCLE draws a circle — on a finer grid than the character one, measured from the bottom-left. A frame goes round the title card.

80% of Meet BASIC

Under the character grid is a finer one: pixels, 256 across and 176 tall. Three keywords draw on it — PLOT a point, DRAW a line, CIRCLE a circle. There's one catch to learn first, and it's about which way is up.

Milestone 1 — a point and a line

  10 BORDER 0
  20 PAPER 0
  30 INK 7
  40 CLS
  50 PLOT 20, 20
  60 DRAW 200, 140

PLOT 20, 20 lights a pixel near the bottom-left — because the pixel grid counts from the bottom-left, with y going up. DRAW 200, 140 then draws a line relative to that point: 200 pixels right and 140 up. So the line climbs as it goes right.

The Spectrum screen showing a white diagonal line rising from the lower-left toward the upper-right on black.
PLOT sets the start, DRAW runs a line from it. The line rises to the right because y counts upward from the bottom — the opposite of PRINT AT, which counts rows down from the top.

That's the catch: PLOT and DRAW measure from the bottom-left, y upward, while PRINT AT measures rows from the top. Two grids, two origins — mixing them up is the most common drawing mistake.

Milestone 2 — a box and a circle

DRAW runs from wherever the last point was, so four DRAWs make a closed box. CIRCLE takes a centre and a radius:

  10 BORDER 0
  20 PAPER 0
  30 CLS
  40 INK 5
  50 PLOT 40, 40
  60 DRAW 80, 0
  70 DRAW 0, 80
  80 DRAW -80, 0
  90 DRAW 0, -80
 100 INK 6
 110 CIRCLE 200, 80, 35

The four DRAWs trace a square — right, up, left, down, back to the start. CIRCLE 200, 80, 35 draws a circle centred at (200, 80) with a radius of 35.

The Spectrum screen showing a cyan square on the left and a yellow circle on the right, on black.
Four DRAWs close a box; CIRCLE takes a centre and a radius. Change the INK between them and each shape gets its own colour.

Milestone 3 — frame the title card

Now both grids at once. The title card's text is placed with PRINT AT (rows from the top); the frame around it is drawn with PLOT and DRAW (pixels from the bottom). Line them up and the title card gets its border:

  10 BORDER 1
  20 PAPER 1
  30 INK 6
  40 CLS
  50 PRINT AT 8, 11; "MEET BASIC"
  60 PRINT AT 10, 7; "a Spectrum primer"
  70 PLOT 48, 70
  80 DRAW 160, 0
  90 DRAW 0, 50
 100 DRAW -160, 0
 110 DRAW 0, -50
The Spectrum screen showing MEET BASIC and a Spectrum primer in yellow on blue, inside a yellow drawn rectangle.
Text placed by row, a frame drawn by pixel — the two grids working together. The title card now has a place, a palette, and a border. One thing left: to move.

When it doesn't work

  • The drawing came out upside down. You used PRINT AT thinking, top-down. PLOT/ DRAW count up from the bottom — a bigger y is higher on screen.
  • Integer out of range. A point off the grid. Pixels run 0–255 across and 0–175 up.
  • The box didn't close. DRAW is relative — each one starts where the last ended. To close a box, the four moves must sum back to the start.

Before and after

You started able to place text and finished drawing shapes — a line, a box, a circle, and a frame around the title card. The idea underneath: PLOT lights a pixel, DRAW runs a line from it, CIRCLE draws a circle — on a 256-by-176 grid measured from the bottom-left, y upward.

Try this

  • A triangle. Three DRAWs from a PLOT, back to the start.
  • A target. Stack three CIRCLEs at the same centre with growing radii.
  • Resize the frame. Widen the title-card box by changing the DRAW lengths — and watch which way "up" moves the top edge.

What you've learnt

  • The pixel grid is 256 across, 176 up, measured from the bottom-left.
  • PLOT x, y lights a pixel; DRAW dx, dy runs a line relative to the last point; CIRCLE x, y, r draws a circle.
  • PLOT/DRAW count y upward — the opposite of PRINT AT's rows-from-the-top.
  • Text and graphics share the screen: place with PRINT AT, draw with PLOT/DRAW.

What's next

The title card has everything but life. In Unit 13 we make it move — and discover, in the flicker, exactly why the Spectrum's legends reached for assembly.