One Block on the Screen
Skyline starts with a single block, placed exactly where you send it. Clear the screen, work out the address with 1024 + R*40 + C, POKE the block, and POKE its colour into the matching cell at 55296.
Every city starts with one brick. Skyline starts with one block — a single solid square,
POKEd to exactly the cell you choose. This is the whole idea of the game in miniature: a
character placed by address, and a colour placed beside it.
10 PRINT CHR$(147)
20 POKE 53281,0
30 R=24:C=20
40 POKE 1024+R*40+C,160
50 POKE 55296+R*40+C,12
RUN it: a grey block sits on the bottom row.
Line 10 clears the screen and line 20 makes the background black. Then the two lines that
matter: POKE 1024 + R*40 + C, 160 writes screen code 160 — a solid block — into the
cell at row R (24, the bottom), column C (20, the middle). POKE 55296 + R*40 + C, 12
sets that same cell's colour to 12, a grey. The screen code says what; the colour says
what shade — two POKEs, one cell, exactly where you sent them.
Try this
- Move it. Change
RandCand re-run — feel the grid.Rruns 0 (top) to 24 (bottom);Cruns 0 (left) to 39 (right). - Drop the colour. Comment out line 50 (put
REMin front) and re-run. The block still appears — in whatever colour was already in that cell. Shape and colour are separate.
What's next
One block is a brick. In Unit 2 a FOR loop stacks bricks up a column — one block
becomes a tower of any height you like.