Gannroids

In the breaks I have at work I downloaded and installed Adobe’s CS4 software and decided that I would make a quick little prototype game just to learn about ActionScript 3.0 and CS4.  I did what I usually do which is to make an Asteroids clone.  This time the theme would be one of my co-workers; I wanted to blow up his head, what can I say? *grin*  The collision is a little funky due to my sloppiness/laziness but I’m satisfied for the amount of time I put into it; which I would say perhaps 12 hours over a week and a half.  Most of the time was spent learning ActionScript idiosyncrasies.  Here is the result:

For some reason the transparent pixels wouldn’t save when I uploaded to WordPress, so you get square heads.

Gannroids

CS4 has some interesting features.  One can enter media objects onto the stage and bind them to a keyword and ActionScript file.  Its seems cool at first and really easy, however it only seems useful if you have one or a few instances of a class.  For the most part I just bound the stage to my game.as file and let game.as handle everything.  I created classes for Asteroids and Bullets to learn how to do class work in ActionScript and I ran into a few problems but for the most part everything was seamless.  (As seamless as it can be writing anything in a new language).

To look at some specific problems I encountered, continue reading.

(more…)

1 comment · Written by Tyler at 2:26 pm · Tags , , ,


Progressive enhancement

Weekend progress

Obviously, getting from displaying a keyboard-controlled object to a more “game-like” state is pretty easy. Here I’ve loaded an external PNG (that represents a spaceship of some kind) and attached it to a “ship” class instance. The left/right arrow keys control the object’s internal “rotation” value, and pressing the up arrow key moves the ship. The direction is determined by trigonometry functions; the movement vector along the x-axis is cos(ship.rotation) and the y-axis movement vector is sin(ship.rotation). (For example, if our ship is pointing straight up (90°), cos(90)=0 and sin(90)=1, so it’ll move straight up.)

No comments · Written by Nathan at 8:19 am · Tags , ,


← Newer Posts