AS3 : Collision Detection Kit

Ever wonder, is there an easier way instead of making loops and check for every hitTest with all sorts of  shapes and sizes? Well, may I present to you – Collision Detection Kit!

The Collision Detection Kit is a package of classes created for pixel-precise, shape-based collision detection for all display objects. It is written in Actionscript 3.0 and meant for Flash Player version 9 and higher.

The Collision Detection Kit comes with several features to control how collisions are detected, and provides data for the user of the class so they can do something about the collision:

  • Set an alpha threshold to ignore colors below the threshold.
  • Specify colors and color ranges to exclude from collision detection.
  • Receive an angle of collision for each collision. We’re not talking about bounding boxes here – the angle is calculated based on the shapes of the display objects at the site of the collision. Great for when you’re working with physics!
  • Receive the pixels that overlapped in a collision in stage coordinates. Combined with the returned angle, and your physics engine will have no problems traversing complicated shapes or performing off-axis rotation.
  • Takes transformations (scale, rotation, color transforms, etc.) of individual instances of your display objects into account.
  • Add items for collision detection regardless of their nesting.
  • You can have as many CollisionGroup and CollisionList instances as you want, allowing you to easily manage different interactions and behaviors.
  • Works with all display objects – MovieClips, Sprites, Bitmaps, TextFields, FLVs, and on and on!

Read the rest of this entry »

AS3 : Explosion Burst Class

Developing games like Shooter in As3 can be boring without good explosion effects. Over the weekends, I ported a simple class ( from As2 )which does some randomized explosion movie-clips.

This is to be used when there’s an explosion in the game. The class allows you to create explosion effect based on number of particles, size of distance and alpha. All you need is to instantiate it and pass in the variables needed. See sample below.

Read the rest of this entry »

AS3 : Flash-Console

console_controls01

Every wonder that, there’s something to display your run-time variables smoothly without using the laggy trace. Not to say trace command is useless, but at times is much less cpu intensive to debug values especially on enterFrame run time to an on screen textbox instead of using trace.

But, lately I stumbled upon a good console interface like debugger called Flash Console in a form of as3 class package!

Read the rest of this entry »

AS3 : FPS and Memory Counter Package

ActionscriptIcon_400 One of my favorite class I used to include when developing games for flash is my FPS and Memory Counter Package. I use this to check my fps and memory consumption for my games.

This helps to identify which of my methods I wrote is taxing the CPU or not. Simply import package to your main.as and add it into the stage

 

Read the rest of this entry »

AS3 : Gaia FrameWork Development Guide

Today, I’m gonna talk more in general about my experience in Gaia Framework. Here are some of the details I’ll cover in this post.

  • The Index – using the index effectively.
  • Assets Management – some example, on how to hook up an xml and graphical asset.

Gaiapanel

Read the rest of this entry »

Page 1 of 512345