Next, we want to make the duck actually moves around. Remember that we're doing all the programming on the generic toy, and using the specific instance of the duck to test things out. To be properly generic, we need to define different messages that can hold message strings for the motions of the toy. So let's define two messages. One for the toy to start moving, and another for it to print as it continues to wind down.
@def-msg $windup_toy:startup Message $windup_toy:startup defined. @def-msg $windup_toy:continue Message $windup_toy:continue defined.
We used the Messages system to define these messages to give us some powerful messaging options that ColdCore offers. You'll see what I mean in the next section. Let's set values of these messages on the duck. Note that we are setting the message values on the instance (the duck), and not on the parent (the generic).
While we're at it, we should give our duck a description!
@msg hduck:startup=[$this] waddles about and starts rolling forward. startup = [$this] waddles about and starts rolling forward. @msg hduck:continue=[$this] swivels its neck and emits a >> Quack << continue = [$this] swivels its neck and emits a >> Quack << @describe duck as A yellow plastic duck with wheels at the bottom and a knob for winding. Description for Heisenberg's Wind-Up Duck ($heisenbergs_duck) set.