Tutorial on Converting Objects During the Game
You might have wandered if a character can convert to another character
on the canvas. The answer is yes!
This can be easily done as the following:
There is a panda and a fox.
When the panda touches the fox, the panda converts to a bamboo.
|
In this example, the panda will turn into a bamboo when it touches a fox.
|
There are 3 puppies and 4 pandas.
When a puppy sees the panda, it converts[2] bones.
|
Here, the puppy will convert to two bones.
|
You may also convert an object to multiple objects, such that the new objects are of a different size.
For example:
- the carrot converts to a bone : the carrot converts to a single bone of default size
- the carrot converts[3] bones : the carrot converts to 3 bones of default size
- the carrot converts[2, 50] bones : the carrot converts to 2 bones of size 50 each
- the carrot converts[4, 12] bones : the carrot converts to 3 bones of size 12 each
For example:
When the rabbit is happy, it turns into[2, 15] diamonds.
Here, the rabbit will turn into two diamonds of size 15.
Note that a character cannot convert to another single instance of the same type character. If you wish to change the size, simply say:
- When the rabbit is happy, the size of the rabbit increases by 1.
However, you can convert to multiple instances of the same type. For example:
- When the rabbit is happy, it converts[2, 18] rabbits.
In the above sentence, the rabbit turns into two instances of the rabbits of size 18.
Try it yourself:
Try design a game in which both the player character and the NPCs can convert to new objects.
Next Page
Tutorials Home