Tuesday, December 28, 2010

Rapid Implementation (UAV Game)

Rapid Implementation (UAV Game):

Earlier this month, Remy Karns, a student at UC Berkeley, called me for help with implementing his 3 page design document.

7 hours later, I had UAV Game made based on his spec (play in Flash, no download/install required). UAV is short for Unmanned Aerial Vehicle.

I wrote an article about this game for the Newsgames Blog that will go online soon, though that one has a journalism angle. In contrast – and fitting with this blog’s purpose – this post instead focuses on the game’s rush development.

Foundation Code

Rather than memorize the details of how to handle keyboard/mouse input, basic graphics, sound playing, and framerate timers in each programming language, I prefer to start with a source file that’s little more than an image being loaded and shown, a sound being loaded and played, and a little input being taken, so I can duplicate and rearrange. In this case, I started from the example code that I put together for ActionScript 3 – Motion Tutorial, removing aspects I wouldn’t be needing.

Isometric

In order to make isometric building art, I turned on the grid in my image editor, then drew using diagonal lines that went 1 tile vertically for every 2 horizontal tiles.

That 1:2 ratio works since sin(30 degrees) = 0.5. The simplicity of this is part of what makes isometric a popular way to fake 3D.

Likewise, for the moving AI targets, I set their vertical movement to only have their horizontal speed. For the burnt crater graphic that gets drawn after the explosion, I first draw a circle from overhead, then scaled it to half height.

For distance checks, such as determining which guys are within the blast radius, I doubled the Y offset [...]

No comments:

Post a Comment