A few simple canvas experiments. Enjoy. Grab the code :).
Here is a quick bugfix for my motion tracking framework DoGesture.
This version eliminates a class name conflict that appeared if you compiled the framework for Flash Player version 10.2+ using the Flash IDE.
In existing projects, change the class name GestureEvent to DoGestureEvent and everything should work as before.
Consoles, Smartphones, Tablets. Motion tracking is everywhere. Here is a simple way to utilise camera motion tracking in your Flash Projects.
A quick rundown on how the motion tracking demo works.
1. Take pictures.
Use the Camera and Video Object to get a steady stream of images. Write each image into BitmapData Object 1.
2. Create a time-delayed copy of each picture.
One frame (or TimerEvent) later copy BitmapData Object 1 into a second BitmapData Object (BitmapData Object 2).
3. Compare the two images.
Use BlendMode.DIFFERENCE to merge the two images. The originated image displays the differing parts between image one and two. Copy it into BitmapData Object 3. If you use the BitmapData function “getColorBoundsRect” you can now return a Rectangle Object. Whenever the with or height of this Object is bigger than 0 motion occurred.
In the Demo, a ColorMatrixFilter and a BlurFilter help to get rid of unimportant motion in the image (slight color changes or background motion). You can use a Sprite container with two added Bitmaps to store the first two BitmapData Objects. This gives you the option to apply filters to the container without having to reapply them every frame.
The example can also be used to create a simple spy cam, using Adobe Air to write BitmapData Object 3 to the File System. This application is also included in the download below.
You can download both motion detection demos, including their source files, from the following URL:
I decided to release some of my games as free open source downloads, using the MIT license.
The following URL provides you with three games: “Meteornaut”, “Crash Lines” and “Decypher Me”.
While “Meteornaut” and “Crash Lines” are fairly complete games, “Decypher Me” is more of a proof of concept, with one level and no title screen or menus.
A few words about each game:
To publish the game, use the Flex 4.1 compiler (try FDT, Flash Develop or Flash Builder) using Flash Player 10. The Main Class is: “src/de/davidochmann/games/meteornaut/Meteornaut.as”.
Use the “source/crashlines.fla” to compile the game.
Decipher cryptic Texts with “Decypher Me”. The game gives you hints to where a certain letter is used within the text. After that it’s up to your combination abilities to solve the riddle.
Use the “source/DecypherMe.fla” to compile the game.
Follow me in the creation of my latest game METEORNAUT, a simple variant of the all time classic Asteroids.
This post documents the development milestones of the game, beginning with the first beta to the release of version 1.0.
The current milestones:
Version 0.01 is an early mock-up to test the core framework, performance and animation. The game freezes as soon as a meteor hits the ship and as for now the level has no clear end.
The second version deviates a little from the asteroids concept. I implemented a new gamplay mechanic that rewarded players for destroying meteors of the same size (circled) by multiplying the score (pending score x destroyed meteors of the same size within two seconds).
This version has a new combo mechanic. The size of the meteors is now irrelevant for increasing the multiplier. Gaining a 10x and 20x combo will give you a power up (two, than three missles per shot).
Also new in this version:
Locked Levels, reduced user interface, new animations.
More of a re refinement than anything else this version features, a new name, new graphics, new levels, a title screen, screen transitions, button animations and a few gameplay tweaks.
Powerups are now given after multiplier 10 and 100 instead of 10 and 20.
The ship is no longer able to fly through one end of a level to end up on the opposite side.
Version 0.14 adds a stats screen to the game that displays your current level-completion time, the highest level combo and your high score. It also fixes a bug that used to show a wrong max-score in certain levels (e.g. 15).
I also updated the graphics a little, by overhauling the title screen and improving buttons and the background (with dirt :D).
After version 0.14 I released the game on kongregate.com and newground.com.
You can check it out by clicking one of the the following URLs: