Try turning the MOVECHAR program into a space shooter game: the M can become your spaceship, and you might be trying to shoot asteroids before they reach you.Which commands do you need to change, and which stay the same? What are the new bounds you need to use to keep the text from going off the screen? If you’re familiar with drawing text on the graphscreen, try moving this program to the graphscreen.Because getKey can’t register multiple arrow keys held together, you could use the 1–9 keys as arrows instead (where 2 is down, 7 is up-left, and so on). Handle diagonal movement so that the letter can move in 8 directions instead of just 4.Perhaps a different letter? Or a group of letters in a shape? With this simple event loop program that listens for and reacts to keys, you can build many fun programs and especially games.Īn easy place to start would be to make something other than an M move around the screen.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |