Archive for February 19th, 2006

Walk to bone, but don’t forget food

On the Adobe Director Forums someone posed a question about how to get started with a “virtual pet.” There are different ways to think about such things. As a physics guy I like to think about pets that obey rules of physics. In this example I set up a pet (let’s just say it is a dog) that will wander around on the screen. If you throw a bone (by clicking on the stage) it will head for that bone, but on occasion it will see something else of interest and forget about the bone. It slowly gets hungry, and if you don’t coerce it in to getting to the food bowl bad things will happen.

The behavior has a nifty “chase” algorithm in it. I’ll probably do more with this file in the future to expand upon my pet.

Can you call that a virtual pet?

The code uses a few DirMX 2004 specific features (named sprites), but could quickly be adjusted to run in older versions (these issues are commented in the code). The graphics in this one are rather primitive to say the least.

Walk to the bone source code.

1 comment February 19th, 2006


Director Sites

Calendar

February 2006
M T W T F S S
    Mar »
 12345
6789101112
13141516171819
20212223242526
2728  

Archives

Recent Posts

Recent Comments