Saturday, August 29, 2015

Day 6: Raining Lizards and Houdini: (Can't) Try This at Home

Phew! Now that I found a better tutorial for AS3 development (here), I've decided to make a simple game utilizing the better practices of the language (programming everything outside of the scene) and managing a small avoiding game where a friendly pentagon (Penty the Pent-Up Protagonist? Perhaps) avoids a rain of menacing lizard heads.

Although simple, I covered a lot of important things for Flash development. I separated the states of gameplay from the main class (most of em'), set an array of enemies that moved at random speeds (in a range of numbers, for better effect) and that used an inverse tangent method to see exactly where the angle of rotation needed to be for the lizards to look at Penty the entire time. There was a bit of a fix where the lizards were rotated backwards (for effortless shunning) but a quick addition of 180 degrees helped fix that up, along with properly translating from radians to degrees since the rotation member in DisplayObjects was in degrees.

For actual colliding, the bounding box was an unfortunately rigid routine, so I went with the next best thing (the enemies and player being circular n' all): circular collision. There is no specific circular class, but a quick distance check calculation and a radius (made slightly smaller than the actual drawn object for close calls) is all Penty and the lizards need for non-frustrating collision. I also stuck in a score with a dynamic text instance and a clock with eight frames (inside the symbol! Not the scene!) of animation; these two were very similar in number accumulation, so they both went under a parent class for counting numbers. And voila! A simple game of life and death:


On top of that, I also became quite used to the buttons and setting frames with different text and color for unclicked, clicked, hovering, and general hitbox frames. This produces the lovely button below:


I also looked a bit into Houdini; as unfortunate as it may seem, the software is linked directly to the local campus server (to the point where one cannot work on it off-campus), so the work I've done on the side (holding off the lengthy workshop, mind ye) is mainly becoming familiar with its components as modeling software and animation frames in preparation for procedural effects, motion along curves, and other such things that separate Houdini from the lot. It's unlikely I'll be working on it specifically, but a couple of these tricks could save development some time in the long run.

No comments:

Post a Comment