2007-11-12

Defender DS Sourcecode

Based on the fact that I don’t get much time to work on my homebrew projects, and that Woopsi is currently monopolising all of that time, I’ve decided to release what little of DefenderDS I managed to put together.

As usual, it’s a VC++ project. The whole lot is under the BSD licence, so pinch any bits that you want for your own projects (remembering to abide by the few restrictions imposed by the licence).

Defender Title Screen

From what I remember, the interesting parts of the code are the animated sprite class, palette cycler class and the sprite number management system (which would need to be stripped out of the Game class and inserted into a new class to be useful). The sprite class simulates a fixed-point single decimal place for sub-pixel movements, by internally multiplying all its values by 10 (though it doesn’t do sub-pixel rendering, natch). The wrap-around functions are specific to Defender, though, and probably won’t be much use elsewhere.

The code is getting on for 8 months old, so I’d probably do things in a different way now. Looking through it, I can’t see any obvious problems, though, aside from it not drawing an explicit distinction between class members and other variables in the naming convention.

So far, it has the following features:

  • Background mountains
  • Humans
  • Landers that scout for humans, tracking the mountain terrain
  • Lander warp-in
  • Lander explosions
  • Lander mutation
  • Scrolling
  • Palette cycling
  • Scanner

My homebrewing plans for the future mainly involve Woopsi - getting the library finished, possibly porting it to the GP2X-F200, and then maybe even writing some applications with it (as that was the whole point of the exercise). Unfortunately, that means DefenderDS is probably a dead project. Shame, really, as this whole blog exists solely because I wanted to keep a development diary for the game. Funny how things turn out, innit? Still, DefenderDS served its purpose - it was an introduction into DS homebrewing, let me dust off my Blitz BASIC skills, and expanded my C++ knowledge.

Comments

Video Game News » Blog Archive » Defender DS Sourcecode on 2007-11-15 at 10:00 said:

  ds homebrew reviews for 11.21.07 — from the gutter on 2007-11-21 at 06:03 said:

[…] DefenderDS–Ant512 released the source code to his port/clone of the Amiga game Defender. The game plays as expected, although I don’t believe that I saw all of the objects in the original. I believe the game is limited to landers. Plus, I was not able to shoot the landers. The game has potential, but as it is, it is not worth downloading. […]