Repair & Schematics
BBC Micro
Drawing Graphics (BBC Micro)
3min
a great demonstration of the power of the bbc micro, and the start of thinking about game code is to write a really simply program that draws random lines from the center of the screen outwards the really short code is below line drawing briefly to explain it, we set the screen to high resolution mode (1000x1000px) using mode 0 command after this we generate 2 random numbers stored in variables x and y finally, we move the cursor to the center (500,500) and draw out to wherever the random numbers tell it to 10 mode 0 20 x=rnd(1000) 30 y=rnd(1000) 40 move 500,500 50 draw x,y 60 goto 20 colors with a small tweak we can go to a color mode (mode 5), and generate a random color the bbc can only do 4 colors black, red,yellow and white so we generate a random number between 0 and 3 note that gcol0 is a zero not the letter o also, we removed the move command so it simply draws from 10 mode 5 20 x=rnd(1000) 30 y=rnd(1000) 40 c=rnd(3) 50 move 500,500 60 gcol0,c 70 draw x,y 80 goto 20 run