Animation

Processing

Holy crap is this cool!

Animation

Comments Off

Permalink

Asteroids 2.04: When Things Collide

I was away learning about Knowledge Management this week, which will occupy several blog entries as what I learned from this conference experience relates directly to the purpose of this site.

But, I also wanted to let you know how easy it is to use classes that other people author.

As you can see, I have collision detection working. And I barely wrote any code. In fact the class that runs this is directly from Grant Skinner, who released his ProxmityManager class on his site back in February. After reading Branden Hall’s blog using the same methodology as far as dividing the screen into a grid, and then, when the ship is in a particular block, it checks the neighboring blocks for asteroids.

Download the source files for yourself and check out Grant’s and Branden’s blogs for yourself.

ActionScript 2.0
Animation
Flash

Comments Off

Permalink

Asteroids 2.03: New Asteroid Shapes

So I didn’t expand on the interaction between the ship and the asteroids. Instead, I tooled around all weekend trying to create randomly shaped polygons to use for the asteroids. This is something I wanted to do in the original build and never took the time to concentrate on the problem.

I read several articles online. Looked at academic research on a Random Polygon Generator. The algorithms were mind boggling. I e-mailed some very smart ActionScript programmers for some help. None came (at least by the time of this writing).

Then it occurred to me… can’t I just rotate similar-sized squares and triangles appearing randomly to produce a randomly shaped polygon? Bet your ass I could :)

Download the source files.

So this release marks two changes that are related. One is the obvious — randomly shaped asteroids for a more unique experience. Continue Reading »

ActionScript 2.0
Animation
Flash

Comments (2)

Permalink

Asteroids 2.02: Ship It!

It would figure that success breeds more success, and now I have a ship that flys about the screen using the arrow keys, again controlled via a Ship class. Try it for yourself right here!

Download the source files. Continue Reading »

ActionScript 2.0
Animation
Flash
Writing

Comments Off

Permalink

Asteroids 2.01: Making the Asteroids Move

With a taste of success under my belt, I started remaking the Asteroids game using ActionSctipt 2.0 and class structure.

Download the source files.

While the Asteroids you see here are movieclips with polygon fills, unlike the completely code-rendered Asteroids in the original game, there is no code in the entire flash movie. All the code takes place in the Asteroid.as class file that each Asteroid movieclip is bound to. I didn’t even have to instantiate these Asteroids for them to behave. I just drag them out of the library and let them do their thing. Continue Reading »

ActionScript 2.0
Animation
Flash
Writing

Comments Off

Permalink

Linear Sprites

Starting from scratch at understanding just how Object-Oriented Programming, ActionScript 2.0 models inside of Flash. I took a stab at what Grant Skinner spoke about at FlashForward 2005 in San Francisco (last week). Here’s the finished product…

Download the source files.

Grant’s a pretty smart guy. Sure the example he wrote above isn’t terribly sexy, but Grant revealed a key element in how to conceive of OOP in a way that bridges most developers’ understanding of Flash and very evident objects — associating movieclip behaviors with a class that describes the behavior.

I’m going to journal these experiments, working my way up to rebuilding my (somewhat famous) Asteroids code with ActionScript 2.0.

But for now, let’s get back to the basics…

Directly associating Classes to movieclips isn’t the only approach you can use in grasping OOP with ActionScript 2.0, but it’s a great start for understanding how theoretical object structures can relate to the virtual objects that you can manipulate in Flash’s IDE. Continue Reading »

ActionScript 2.0
Animation
Flash
Writing

Comments Off

Permalink