VIO User Notebook

Saturday, May 20, 2006

VoodooIO presents: Tanks

Hi folks!

A few months ago a guy from our Info Department implemented a little application using the VoodooIO System. It is a simple 2-player game where two tanks are controlled by VoodooIO devices and have to destroy each other. It took him an incredible amount of time and thousands of lines of code. (He used C++ and some libraries for the graphics.)

Last week we re-built the game in Flash using the VoodooIO Flash components. It took only a few hours and comprises only a fraction of the original code amount. : )
The special thing about this application is the dynamic assignment of controls to functionality. As you could see on Tuesday you always had to enter an ID or a label to link a physical control with its software representation and this connection was fixed thenceforward.
This example shows how to do this by code and independent from IDs, labels and partly types of controls.

Let me briefly explain what the controls are:
Each player is prompted to choose a control device for angle adjustment, that means the angle of your tank's cannon. For this use can either use a Dial or a Slider and it is assigned simply by sticking the control into the substrate when you are asked to. Then you can choose a device that controls the power of your shot. Options here are again Dial, Slider and a PushButton. If you choose a PushButton, you are asked to insert another PushButton, one for increasing the power and one for decreasing. Finally you have to insert a PushButton for firing off a shot. Dependent on your power, angle and a random wind factor the bullet's trajectory is computed.

I tried to comment all important steps in order to make the code understandable. Check out the game --> here <--. Please feel free to ask any question you have.

Hope you enjoy it!
All the best

Wolfgang

0 Comments:

Post a Comment

<< Home