Computer Science Canada Star Race |
Author: | scholarlytutor [ Mon Mar 27, 2023 11:38 am ] |
Post subject: | Star Race |
This is an example of me taking a program from a Turing textbook and making improvements to it. As with other programs I've made, I've bundled a lot of components into procedures and tried to keep the "main" program as short as possible. The program is essentially a random star race, using the * character rather than any pixel-based figures. Of course, if you keep the logic the same, it wouldn't be too difficult to change the * characters into tiny race cars and add in the necessary backgrounds (a road, grass, etc). However, note that I set the screen using rows and columns rather than pixels, so if the size of your cars is going to be constructed using pixels (i.e. boxes and a couple of ovals), you will probably want to set the screen in pixels to ensure that your program works the same on different computers. I hope this is helpful for people learning how to make simple games with Turing! Try making some changes or improvements and posting them here. |