There are ants lol

March 10th, 2010

Following my last update, and fortunately for me (and the project), someone has come forward to help out with the graphics – Colin Wren is his name (see his site here), and he’s a top man.

The graphics Colin supplies are in .dae format, and with a lot of help from this site (Tipu’s iTiger) and an XML parser (TBXML), and much head scratching, we got the models going nicely.

At the moment they’re not animated, but they will be soon…

Other things now in there are bombs and collisions. To aid testing on the simulator I’ve added an auto-jump feature on the player – a collision in the x or y plane makes him/her jump. This also works quite nicely when testing on hardware so I may keep it (maybe as an option). I’ve also updated to the latest version of the 71Squared Sound Manager.

The button top left flicks between the male and female model – other controls as before (bomb button now works of course).

So, still plenty of things to be done, but slowly and surely it’s coming together.

Here’s the latest project folder:
Ant Attack xcode project

Happy New Year – Ant Attack project source

January 1st, 2010

Here’s the latest version of the Ant Attack project – I’ve not had much time to spend on this over the last month or so, so I’ve decided to release it as is (unfinished of course).

The map data used in here is ripped directly from the spectrum original – see this website for an explanation of how the data is stored:

Hacking 3D Ant Attack

Inside the map class I read in this data and parse it into discrete blocks (total of 2650 of them) and then render the ones closest to the current camera position – this system isn’t great by any means, but does provide a simple enough algorithm and reasonable frame rate. (Would appreciate it if someone could test this on a 3GS device and let me know the frame rates achieved).

At the moment, the ‘ants’ in the map just run around at random, colliding with the map and making occasional direction changes.

The large button on the left is used to move, right button to jump – the button next to it currently does nothing (other than stop the jump sound playing). The red buttons allow zooming in and out – if you touch the middle of the screen (where your player block is) you can change the camera angle…

The sound code is basically taken from the 71Squared guys, the glu functions were found on Iphone Development (amongst others).

All opinions / comments / questions are welcomed…

Ant Attack

Moving into the 3rd dimension

December 7th, 2009

I’ve spent the last couple of months playing around with things in 3d (OpenGL) on the iPhone. I find it easier to stick with and learn something if there’s a definite end goal, and so after thinking about it for a while, I decided to do a version of the classic ZX Spectrum game 3d Ant Attack by Sandy White (see his page here: Sandy Whites Ant Attack page).

The main difference between the original and this one is that my version will be ‘proper’ 3d, compared to the isometric original (not to disrespect that version, it’s an absolute classic). This also means we can get nice things happening, like zooming and panning the camera, lights, textures and other bits and pieces.

Here’s a screenshot of how it’s coming along – all graphics (quite clearly) are programmer art. Hopefully I can find someone to help me out with something a little bit prettier.

Graphic artist needed!

Graphic artist needed! Click to zoom.

The green squares overlaid are the control buttons (left big box for movement, right smaller box for jump). I’m finding the hardest thing to get right is the control method on the iPhone, and am still not happy with how I’ve got it at the moment. The small brightly coloured cube is your player (I did mention it was programmer art).

So far I’ve got the map in, along with a camera system allowing zooming and switching angles. You can move the player box, jumping and general map collision are working well. I’ve also got 5 ants (well, brightly coloured boxes) running around and colliding with the walls. Current frame rate (on a 1st gen iPod touch) is between 40 and 60fps.

Still to be done then, in no particular order:

A.I. for the ants

People to rescue

Sound

Better graphics (any volunteers?)

Lighting

User interface tweaks

Bombs

Menu screens

Sounds like a lot of stuff, but after getting all the 3d stuff going I’m hoping I’ve got the hard bits done….source code will follow when it’s finished if anyone’s interested.

iSpacies 1.1 – bugfixes and small changes.

July 2nd, 2009

Just a quick update to the project to fix a few things and change bits and pieces.

First up I’ve moved away from using an NSTimer update method, and gone to just spinning round the main loop. (Thanks once again to 71squared for that). One effect of doing this is that on the simulator it now runs almost too fast – on hardware it’s fine though. To be honest I’m not sure why – I’ve also made a few changes around using the timeDelta (time elapsed between cycles of the main loop) to help smooth things out a bit.

Other things fixed / changed:

The game now ends if the invaders land.

Improvements to the key controls – I’ve discovered you can get a hash value for a particular touch which makes the input logic work much nicer.

Fixed a bug whereby the number of bombs on level 2 and beyond decreased.

Changed it so that if you lock the iPhone/iTouch it doesn’t still run around the main loop / render.

Bit of a tidy up.

Here’s the latest project:  iSpacies1-1

iSpacies – Beginning iPhone game development.

June 25th, 2009

iSpacies

iSpacies

When I first start to work on a new piece of hardware, almost inevitably my first attempt at getting something up and running is a version of Space Invaders – I consider it  the extended version ‘Hello World’ for games programming, If you stop and think about it for a minute, getting something like Space Invaders running involves not only gaining a reasonable understanding of the underlying hardware (including graphics / input / memory / sound etc), plus a grounding in basic game logic function and flow, but also a chance to get to grips with the less obvious side of development where sometimes people come unstuck – the IDE, compilers, linkers, and associated tools.

Other machines I’ve done this on are the PC (when Direct X first appeared), Playstation One (on the Net Yaroze home development kit), Gameboy Advance, Nintendo DS, and finally here we are on the iPhone.

This time around there were a few more things to consider. First of all, aswell as needing an iPhone or iPod Touch if you want to test on real hardware (no different there to any of the other machines mentioned, luckily I already had a Touch), you need a Mac to develop on (at least without jumping through flaming hoops – Google is your friend if you want more info). You’ll also need to be ready to learn Objective-C, which is the language used to develop with. Basically it’s an object-oriented superset of C (but different to C++). If, like me, you’re coming from a C background, and are prepared to spend some time playing around with the dev kit, and going through various tutorials on the internet, then you’ll eventually get used to it.

Enough babble – on to the project. Even though this is a 2D game, I made an early decision to go the Open GL route (I’ve got a little bit of past experience).

There are a few websites I want to mention as excellent examples of iPhone tutorials:

www.71squared.co.uk – The particle system I’m using here is almost completely theirs (small change to use my texture class), as is the particle.png, and the Singleton class. Absolutely excellent site with amazing tutorials.

Iphone Development – Fantastic info on all things iPhone (and co-author of the best iPhone book I’ve read)

Simon Maurice’s Coding Heaven – A great series of iPhone specific OpenGL tutorials.

There are lots of things missing from this at the moment: In no particular order Sounds, High scores, Difficulty curve, Extra lives.

I’m running the latest version of Xcode (3.1.3) and iPhone SDK (3.0). Let me know if you have any problems with it (I’m far from being an expert but will try my best to help).

Also, this is probably not the finest example of Objective C (or iPhone) code, but I’m offering it up for beginners like me. Any suggestions / criticisms / improvements please let me know. Maybe we can all learn and improve together…

Here’s the project:   iSpacies.zip

Game Controls: Press to the left or right of ship to move left or right (has to be near the bottom of the screen). Anywhere in middle of screen to fire. Press anywhere near the top of the screen to Pause / Unpause (controls aren’t perfect either!)

StarquakeDS

January 29th, 2009

Here’s my version of the classic Spectrum game Starquake, remade for the Nintendo DS. It was made for the RetroRemakes 2008 competition.

StarquakeDS

StarquakeDS

StarquakeDS

If anyone is interested in the source code let me know…