There is a panda. The player controls the panda. When spacebar is pressed, the panda inserts a bamboo. |
In this example, the player character inserts the new object. The bamboo will be inserted at the same location as the panda. |
There are 3 puppies and 4 pandas. When a puppy sees the panda, it inserts a bone. The bone moves toward the panda. |
Non-player characters (NPCs) can also insert objects. Unlike player characters, NPCs can insert an object approximately once every 0.5 second. Note that the character making the insertion must be the same character in the antecedent. |
You may also insert an object relative to the inserting object's position. For example:
For example:
When the rabbit is happy, it inserts[1, 25] a diamond.
Here, the rabbit will insert a diamond 25 pixels to the right of itself.
If you wish to insert an object currently absent, you'd need to add "There are 0 [obj]." in the setting as well. This indicates that your game will make use of the new object, but there are 0 instances of them at the start of the game. Then, you may also change the size and speed of these objects:
Finally, you may use the concept of insertion to replenish objects that have died or disappeared. Refer to the later tutorial on Infinite number of objects for more on this topic.
// Game #1. Shoot the hoops.
// Game #2. Eat everything but shoot the dinos.
// Game #3. Pin-ball.
In the example above, we do not know how many times a puppy will see a panda, a thus insert a bone, so we don't know how many bones will be inserted in the game. Therefore, the bones are dynamically allocated.