There was this touchscreen in my office, so I had to play around with it and started one of my older experiments on it:
Collision Tests
December 19th, 2007 | Posted by in Actionscript | Experiments | Flash 9 - (4 Comments)As you noticed, I’m building a small arcarde shooter in AS3 besides my daily work. It started as a small test and got me ;). In my previous post I used getObectsUnderPoint for a hittest between the shot and the enemyclips, this works fine if you don’t need a collision reaction and the clips travel at a moderade speed. Now I wanted to integrate a collision detection and reaction for the enemies and made use of some nice scripts I found out there:
A shape-based collision detection for bitmaps by Grant Skinner, since the third parameter in hitTestPoint(x:Number, y:Number, shapeFlag:Boolean) only works for vectorimages and I’m using bitmaps as graphics. A Proximity Manager. This small class comes really handy and the principle is so simple. The proximity manager splits the stage into grids and stores for every sprite in which grid they are. So you don’t need to test every sprite against all other sprites, instead you just say: “Give me all neighbours of that sprite”, which saves a lot of loops.
So I had the tools for a nice collision detection, for the collision reaction I converted a simple snooker algorithm to AS3: Snooker Balls. Watch the result:
Move your mouse over me!


more later ;)
It all started as a performance test…
December 1st, 2007 | Posted by in Actionscript | Flash 9 - (2 Comments)Ok, AS3 can render thousands of particles per frame… but what if we want more than a few single moving pixels and hittests? So I started to write a small test, instancing bitmaps on random locations. And hey: These objects look like bombs, now I need something to destroy them … and there was the battleship ;). For the hittest I used getObjectsUnderPoint. It seems like this method is a bit slower than hitTest or hitTestObject, but you can actually save a lot of loops because you don’t need to test each bomb with each shot. Instead of:
// pseudo code for each(bombs) { for each(shots) { if(bomb.hitTestObject(shot)) { // shot hit bomb... } } }
you go:
// pseudo code for each(bombs) { var objects:Array = shotClip.getObjectsUnderPoint(bomb.x, bomb.y); if(objects.length) { // shot hit bomb... } }
This only works, if you have a seperate clip for the shots. Enough of the talk: Launch!

(Move using the mouse and rotate the gun with cursor keys)

Just a small test with my 3D Engine, the idea obviously is “slightly” adapted from the latest Flash Player 10 (Astro) presentation at MAX Chicago, but you don’t need the Flash Player 10 for this ;) Launch!
(I’m still working on the engine API, when I’m satisfied with it, I will release the sources)

Just another test with additive Colors. Klick mouse to cycle through the different coloring modes: Launch!

Now my engine supports additive colormixing. It’s slowing the framerate down a bit, at least it looks cool ;) Press space to toggle between additive and normal rendering: Launch!

My Engine is evolving slowly. Features so far:
- Depth sorting
- Backface culling
- Frustum culling
- Camera movement
- Texture mapping
- ASE Model Importer & Texture Loader
- 2D Sprites
- Dynamic flat lighting
I prepared a little Spacescene Demo. A Mouseclick changes the camerafollow between the two ships. The Mousewheel zooms in or out of the scene. Launch!
AS3 Sounddetection
May 22nd, 2007 | Posted by in 3D | Experiments | Flash 9 | Particles | Sound - (3 Comments)
My first try with the new AS3 sound classes (SoundMixer.computeSpectrum). This test measures the average sound energy, triggers an event if the energy changes and emits a particle. The particles are 2D particles generated with my 3d Engine: Launch!

I’ve been working on my little 3D Engine in the last weeks. Thanks to Andre Michelle’s great Examples I could manage to get the texture mapping to work and integrated a ASE Parser to load meshes from 3d programs. You can draw onto the texture and see the result in the 3d View: Launch!
Fluid Dynamics
March 30th, 2007 | Posted by in Direct X | Experiments | Particles | Simulations - (4 Comments)
After spending a lot time playing around with Plasma Pong I tried to do fluids by myself. I found a Fluid Solver and had just to convert it to C# and add a few Direct X effects. Download not yet available. Watch movie!

First steps with managed C# and DirectX. This is a direct conversion of my F9 Particles Experiment, but a lot faster and with a lot more particles at full screen resolution. Download not yet available. Watch movie!

Baggermatsch! Instructions: Press the button in the top left corner to change the drawing modes. Have fun playing in your sandpit. Launch!
F9 Particles
November 23rd, 2006 | Posted by in Experiments | Flash 9 | Particles | Source - (8 Comments)
Very basic solid 3D engine with 3d click test. Features so far:
- Depth sorting
- Backface culling


