This week’s learning point – your game only needs to be convincing enough, it doesn’t need to model reality…
This week started with me having the simple challenge of “stop the ship going off the screen” and this lead me on a merry trip trying to calculate reflection angles for spheres intersecting planes and after some rather hideous problems deciding to look at a proper physics engine. Calculating physics is kind of hard so surely a pre-made physics engine is a great idea – more writing game, less making ‘engines’.
Yeah. And I’m sure it is if you want to make a game where physics is the main ‘thing’ and where you already have a fairly good grasp of physics. I spent a productive hour creating a new XCode project, importing my old code, deleting a load of unused code and generally tidying things up and then I dropped the Bullet Physics source in there. Bullet looks quite impressive but be prepared for a lot of digging around in source code – its documentation is rather thin. There’s a comprehensive list of API functions to read in that fantastic machine generated way Doxygen “documentation” is, and there’s a PDF that gives a brief overview.
After a few days of trying to figure out how to get beyond the ‘bouncing cube on a surface’ demo to something more game-like I decided I don’t really need a physics engine. I’ll stick with trying to learn 3D coding for now, physics engines can wait until I’ve got everything else sorted. Their black-box nature confuses me somewhat.
So, using nothing more than some simple pretend physics and bounds checking I have this working… The ship won’t go outside the game area and its little bullets will destroy the oncoming enemy ships. All done using 1980s style computation. Retro gameplay, retro coding style
From watching the video you will no doubt have realised a few things that inhibit gameplay – everything feels a bit ‘stiff’, there’s no sense of motion from the enemy ships and they’re impossible to hit. Oh, and you can’t see them. And this is all stuff I can work on now that I’m not spending hours trying to learn advanced maths.
The next thing to work on is how to represent waves of enemies and control when they appear.


