Atari Basic Animation
In this example for Atari Basic Animation, you will learn how to setup a simple graphics pixel on the screen and watch it move around the edges of the screen in Graphics mode 3.
The code is displayed in a step by step sequence for easier reference and learning.
Graphics Mode 3
In line 30 we are using a command a REM, which stands for “remark”. It essentially is just a comment. Comments don’t execute any actions with our Atari Basic Animation program, but help guide the programmer with what a particular line is doing.
A Basic Loop Example
A Subroutine Call
The PLOT X, Y will track the range of the X variable, and Y will stay consistent (at a default of zero, for now). Finally the NEXT X will continue the loop until it has counted from 0 to 38, which causes the dot to move across the screen from left to right.
Atari Basic Animation begins
We have now entered a new loop. The X loop has ended, but we are now start a Y loop. This Atari Basic Animation loop is counting from 0 to 18, plotting the pixel moving along the way down the right edge of the screen, and setting the delay to slow it down, like we learned about in the first example.
Moving from right to left
Returning to the upper left edge
We have arrived at the last few lines of our loop. This time the pixel is setting at the far left, bottom edge of the screen. Then we count our Y loop backward from 18 to 0 until our dot has arrived back at the very first position on the screen at 0, 0. We are done as the “END” tells us and exists back to Atari Basic.
Please follow and like us: