Free ActionScript

Flash AS2 & AS3 Tutorials, Game Code, Effects, Source Files & Sample Downloads

Pixel Perfect Collision Detection

This is a great “pixel perfect bitmap collision detection with rotation” script by Grant Skinner. This is definitely better than hitTest for rotated irregularly shaped objects and bitmap images. Works great with transparent pngs as well.

Preview

Download Fla Sample

Download Fla Sample

Original Bitmap Collision detection class by Grant Skinner
http://www.gskinner.com/blog/archives/2005/10/source_code_sha.html

Update
AS3 version of this script is available here:
http://www.freeactionscript.com/2011/08/as3-pixel-perfect-collision-detection/

Laser Hitting Solid Objects & Walls

As the title suggests, this is a laser weapon script that shoots a laser beam. The beam stops when it hits solid objects. Written in AS2 to be used in Flash shooter games.

Download Fla Sample

Download Fla Sample

If you’re having trouble understanding how this script works, please review previously posted examples that were incorporated in to this script: Shooting Laser Weapon & Apply Filters Dynamically.

Update:
ActionScript 3 version of this script is available here:

http://www.freeactionscript.com/2011/07/laser-weapon-with-wall-collision-detection/

Bubbles Effect – Water, Beer, Liquid

Simple actionscript bubbles effect. Can be used in flash water games, beer banner ads, etc.

Download Fla Sample

Download Fla Sample

Bug Fix – 6.18.2009
Fixed an issue with the container size. Bubbles are now created based on container width/height.

Enemy Behavior – Run Away & Follow Player

Make your enemies alive! This Flash ActionScript 2 game enemy AI script shows you how to add different enemy behavior to multiple enemies.

Each behavior is easily customizable; you can change movement speed, turn speed, aggression range & enemy graphic for each type of enemy.

Download Fla Sample

Download Fla Sample