Archive for the ‘Research’ Category

Being belligerent

Saturday, April 18th, 2009

Looking at the title, i’m not sure if the belligerence was on my part or the code… i raised the bar somewhat on the “learning OOP in BlitzMax” challenge; today saw the player’s data such as ship co-ordinates, score and lives converted into a single object and the addition of a primitive but workable attack wave manager that not only uses a linked list to store data, it reads in and parses it from what is pretty much an XML file. Then because i was feeling particularly masochistic, i decided to clean everything up internally so that the BlitzMax “SuperStrict” mode could be enabled.

Somehow that all works and i’m still getting over the shock, but the fight that was put up will probably rate as a bigger challenge than the final game’l be! Due to “other commitments” i’ve got to step away from the thing for a few days (or possibly longer) but i’ve made a start on some in-game sprites so the next milestone will be getting those at least to a state they’re workable, scripting up some attack waves and then slapping together the presentation code so that the game becomes a properly stand-alone unit rather than something that needs to be run each play.

Getting shot at

Friday, April 17th, 2009

My nasties have become noticeably trigger happy today, in fact it’s safe to say they’re trigger bloody ecstatic since each is firing nearly two bullets a second! The only issue is that, despite their attempts at peppering the player with lethal projectiles, for some bizarre reason the collision checks that should print a line to the console appear to be utterly ignoring what’s going on. i wouldn’t mind if this bug were being consistent, but the check code with the problem is based on one driving nasty to player bullet collisions and a third routine that checks the player to nasty collisions is in turn an almost direct cut-and-paste from that broken bullet check! “Bizarre” really doesn’t cover it…

Update: the problem turned out to be the lists being used; due to a typo on my part, the bullets for player and nasties both ended up sharing a list, so when the code went to check the nasty bullet list it was always empty. i’m not even vaguely sure how the damned thing worked with the two independent sets of bullets writing to the one list but somehow it did…!

So now that’s sorted out i have a testbed with a player spacecraft that can fire bullets which blow up nasties, which can in turn return fire or ram the player – at the moment, the nasties all drift around fairly aimlessly since they’re spawned randomly if a button is down, but that’s the next job…

Shooting new stuff

Thursday, April 16th, 2009

I’ve made the decision to write a teeny game project to learn my way around object oriented programming in BlitzMax a little; that’s something a departure for me, as someone used to dealing with their own objects (fnarr, fnarr) the idea of allowing the language to deal with things feels more than a little… well, strange really. Still, it’s about time I at least started to understand how OOP works.

So what I have so far (yes, at 3am so it’s surprising that any of the code makes sense!) is a keyboard- or joypad-controlled player sprite which in turn can spawn bullet sprites at the stab of a fire button. For the moment at least, another button on the controller spawns attackers that drift down the screen in order to check that the spawning routine works correctly and the collisions are doing what they’re told; right now there’s what feels like a horrific kludge to decommission a bullet after it’s killed a nasty – it’s set out of bounds vertically and the housekeeping is left to catch and remove it on the next iteration… there must be a better way to deal with removing an item from the list!!