PROGRAMMING FEATURE
I thought it was about time for a programming feature seen as this section is supposed to be about programming after all. SOrt of defeats the object otherwise... dunnit? | |
Blitz
Basic Games programming part 1. Look, this is just the way I do things in Blitz. It is not the be-all and end-all of games programming in Blitz. But knowing how I do it may give you a few pointers. Programming purists may well scoff at my scruffy source but as long as it plays a fine game (or just an ordinary game!) then Im happy. Let's give a list of steps to writing a game: 1.Design -
The easy bit or the hardest bit. Can involve lots of bits
of paper, playing other games, inspiration (often during
sleep) or a game style, which you wish to update. Initial
specs should be set down here. Over the next few weeks I'll be going through each of the stages and, should this be successful, end up with another finished game in the download section (with source) for ya. So off we go with the first steps. 1.Design. I normally, unless a massive flash of inspiration hits (and I'm still waiting!), take my ideas from aeons old 8-bit games that I enjoy. Recent examples have been 8-bit classic, HERO, which I designed a game (unprogrammed yet) called JetHunt. The finished design bore very little resemblance to the original game so no copyright fun! The chances are you see that you will have ideas on how to improve the original and by the time you finish the design, the game will be radically or, at least, sufficiently different. So let's start by picking an old game. Worm/Snake is probably one of the simplest arcade games ever written and yet, people still play it on their mobile phones and on Linux (Gnome has one as does KDE). You can find a version of the original written by myself in 1992 for the SAM Coupe 8-bit computer. You will need the SimCoupe emulator to run the disc but it runs OK on it. Anyhow, assuming you know about the game, I'll continue. What can be improved on the original? Well, better graphics for a start. Lets say 32 colours for now so that it works on all Amigas and emulators. This will probably change after testing as I often opt for a Dual-Playfield 7 colours (1 transparent) on top of another 8 colour screen making things easier but I digress. Another thing that can be improved is by making the worm move smoothly as opposed to moving in blocks. This will be done either as a smooth head and tail, or by using page flipping to make the whole body of the worm appear to move. If the colours stay at 32, I could perhaps use 8 to make the body move using colour cycling blocks. I don't really want a stripy worm so that one is thrown out straight away. Any improvements to the gameplay of this game then? Well random baddies in this would be too hard to avoid with a long worm and a computer-controlled worm involves too much work for a simple game. I could make the game puzzle-like and make a set route consisting of numbers but this has been done. I'll stick to the old tried and tested for now. How about using a multiplayer mode then? Well, I could make a two-player mode, which then crosses Worm with the old Light-Cycles of Tron game. This, is what I've decided then in terms of the Design. I also toyed with the idea of a two-player, Worm Race mode but it wasn't feasible. Maybe I'll code that in the sequel. I also thought about a deathmatch with each 'snake' spitting poison at each other. Again, I'll save that for a more complex sequel. Musically I'll go through my old Amiga music collection and dig out suitable MOD files. I've got around three to four hundred so that should be OK. I'll tart one up for the title tune. I'll need to edit a channel out (leaving 3) so I can have some sound FX. The SFX will probably be just me larking about on a microphone on my PC and then converted the WAV files to Amiga 8SVX files using SOX or a similar program. One more thing, a title has to be decided on. This will be called 'Wormy the Worm-Like Worm'. Not the greatest title for a game sure, but it'll do. TITLE : WORMY THE WORM-LIKE WORM - FORMAT : ALL AMIGAS AND EMULATORS
1.32 colours 320x240 (crafty way of ensuring that emulators can play it too as a real Amiga has a 320x256 screenmode which PCs can't easily replicate). 2.50hz smooth worm animation involving either a smooth head/tail or page flipping (tests needed). 3.2 player mode, like the old Tron game. 4.Standard worm gameplay to be used in 1 player mode, but with a certain tail length to be reached before progressing to the next level. Map editor will need to be written or use a downloaded one. Next week, I'll tell you about testing and drawing test graphics. No source code this week but there should be my test routines next week. See you then! Coagulus / Rob |