From Learn @ Cemetech
Jump to navigationJump to search


Routine Summary

Displays a radar animation.





Variables Used

X, Y, S, T

Calculator Compatibility

TI-83/84/+/SE Author

X1011URL: United TI Download

file radar.zip

:Horizontal X
:DelVar X31→Y
:Repeat getKey

In order to display the radar animation on the screen, we first need to create a friendly graphing window, setting the graph screen dimensions to X=-47...47 and Y=-31...31. We then make the entire screen black by drawing Horizontal lines from the bottom of the screen to the top.

Once the screen is setup, we initialize our two variables for the coordinates of the radar lines, and start drawing the radar animation on the screen. We store the two coordinates to two temporary variables, and then update the original variables to move the radar lines over a pixel. We then erase the old radar line from before, and draw the new radar line.

This gets repeated over and over again, until you press a key to quit. If you want the animation to last for a certain amount of time, you can replace the Repeat loop with a For( loop. In addition, you can use Shade(Ymin,Ymax instead of the For( loop at the beginning to shade the screen. This is smaller, although it isn't necessarily any faster.