just one little optimisation that I noticed here. you are doing two comparisons when only one is required
IF E=0 THEN X4=X4+.1
IF E=0 THEN COLOUR3=4'RED
IF X4>78 THEN E=1
IF E=1 THEN COLOUR3=3'LIGHT BLUE
IF E=1 THEN X4=X4-.1
IF X4<0 THEN E=0
thi E=0 comparisons can be optimised to a single comparison -
IF E=0 THEN
X4=X4+.1
COLOUR3=4'RED
ENDIF
IF X4>78 THEN E=1
IF E=1 THEN
COLOUR3=3'LIGHT BLUE
X4=X4-.1
ENDIF
IF X4<0 THEN E=0
I checked the disassembly and Freebasic does not perform this optimisation for you which is stupid really this is exactly the kind of thing compilers should catch. Apart from that theres nothing wrong. Your coding style has become very clear and tidy, which is nice to see