The plot thickens
Explore your artistic talents with Scribble written for the Amstrad by Brian and David Lewis
This program allows you to draw on the screen, either with a joystick, or by using the cursor controls. It shows you, amongst other things, the difference between mode 0 (20 column screen), mode 1 (40 columns) and mode 2 (80 columns) plus the maximum number of colours for each mode.
Modes can be toggled from the Enter key, with the mode number printed to the screen. The fire button (or copy key) prints out each colour (in that colour), whilst the screen can be cleared with the space bar.
Each mode change or screen refresh starts the cursor at 0,0 (ie, at the bottom left-hand side of the screen).
The flashing cursor lets you know where you are on the screen, which is particularly helpful when drawing in background colour.
- Line 100 — initialisation
- Line 110-140 — adjusts x and y co-ordinates
- Line 150 — flashes cursor
- Line 160-190 changes pen colour
- Line 200 plots x and y
- Line 210-220 — if space bar or enter, Gosub 300
- Line 310-360 adjusts mode, and associated parameters
- Line 370 — restores x and y to 0,0
- Line 380 — clears keyboard buffer
- Line 400 — sets up variables
- Line 410-470 — prints title page and instructions
- Line 480-490 — configures for cursor or joystick control
- cursor = value for on-screen cursor (either 0 or 1)
- maxcolour = Maximum no. of pens in that mode
- s$ = value of key pressed
- s = ASCII value of s$
- m = screen mode
- jump = x co-ordinate for scaling screen to fit mode
- colour = pen chosen
- off = used with Inkey to detect key release
- fire = keycode for fire button
- copy = keycode for copy key
- space = ASCII value of space bar
- enter = ASCII value of enter key
- Lines 110 to 230 comprise the main loop of the program.
- 299 to 390 clear screen and change mode.
- Lines 399 to 500 are the initialisation subroutine.