remarks in code
improvements
We have negelecting to do something all the way through these lessons. Look again at the source code from lesson 11. Find the code that animates the player if he has moved. Well? Not so easy when we're not writing it, is it? Now imagine trying to kind that code in 6 months time, because we want to improve it. And this is only a very simple game - imagine trying to find the code that does that in a real masterpiece of programming.
Now look at the source code in this lesson. Okay, so it would take a little longer while programming, but if you leave those little notes to yourself all the way through the program, it means you will always be able to understand what you have done, and how the code is working. Try running the code, and you'll notice that GL Basic totally ignores the comments you have made, so it has no effect on gameplay. It is good practice - think about using it.
Lastly, this program is very, very simple, and has lots of room for improvements - some ideas are below. If you want to start programming in GL Basic, why not start by taking the code I have done and trying to achieve some or all of the improvements listed below? You never know, you might end up with something to show off to your mates!
-
The bullets start from the centre of the graphic, but this doesn't exactly tie in with the player graphic and the end of the gun. Why not change the start position of the bullet graphic to match the position of the weapon?
- Perhaps instead of simply saying "Ow!", why not have an energy counter which decreases, until it reaches 0 when you die?
- Add a scoring system for the number of enemies you shoot
- Animate the enemies, not just when disintegrating, but all the time.
- Add a sound for the enemies disintegrating.
- Only give the player a set number of bullets, and see how many enemies he can hit with those
- From 6), why not have some rocks that contain power-ups (more bullets) that you can collect to continue play?
- The tiled background is simple enough, but why not have a properly designed scrolling backdrop?
- Multiple enemy types to make the game more interesting
- Instead of bullets disappearing when they hit a rock, they ricochet off and have the chance to hit another rock ad infinitum, until they disappear off screen
- Change the whole movement system to be rotational rather than directional - that is, left will rotate left, right will rotate right, up will step forwards, down will step backwards.
- Reduce the size of the playing area, and use a portion of the screen as a display (scores, energy, bullets?)
- Add a title screen, call your game a name, and display it proudly!
- Construct a play timer (use the GETTIMERALL command) and let the player play for, say, one minute, before moving on to level 2, when the difficulty level increases
- Add a death sequence for our player, rather than being able to play continually.
These are just some of my ideas, I'm sure you'll have many of your own too.
Finally, I hope you have enjoyed reading these lessons as much as I have enjoyed making them. If you have followed everything that has been done every step of the way, then it is time for you to step out on your own and get creative. If not, don't worry - try to go back to a previous lesson and look at things again.
So, all that remains for me to say is, good luck, and, most importantly, have fun!