User:Nimbus/sandbox

Step 0: Create a new pet project
Creating a new pet project is much like creating the game project from the Hello Whirled example or the avatar project from the Rooster project.

Navigate to your Whirled SDK's root directory and run ant with the "newpet" target then answer the prompts.

whirled$ ant newpet Buildfile: build.xml

prepare-flex: [copy] Copying 1 file to /home/nimbus/whirled/etc

newpet: [newproject] Please enter the name of your Pet project. [newproject] For example, BestPetEver: drifter [newproject] Your main class will be called: [newproject]  drifter.as [newproject] Is this OK? [y/n] y [newproject]  Creating 'drifter/build.xml'. [newproject]  Creating 'drifter/build.bat'. [newproject]  Creating 'drifter/drifter.as'. [newproject] Done! Your new project has been created in 'drifter'.

BUILD SUCCESSFUL Total time: 3 seconds whirled$

Run ant again with the "test" target. You should see an empty room. If not, have a look at the [#troubleshooting] section.

Step 1: Add an image
An empty room isn't very interesting, so let's add an image!

Draw a PNG in your drawing tool of choice. For example, here is a PNG exported from Inkscape.



Embed the cloud. For this simple project, put it in your main class.

Add the image to your display.



drifter2
Make it wander the skies (and ceilings) at random!

(introduces the timer, controlling instance, and entity movement (as opposed to movement within an entity's display))

Links: Timer ASDoc, Pet Control

Add a timer and a timer event handler.

The handler should pick a destination at the ceiling and move the cloud there.

Discuss the vectors, perhaps with an image showing which ways are X, Y and Z and the 0.0 - 1.0 scale.



drifter3
Add a thunder action with shaking animation and a sound! Trigger when it hears "thunder"? Maybe!

(Introduce message passing when the random event occurs.)