|
These two sentences are examples of jumping. Since characters always move up when jumping, you don't need to describe a direction to jump. Also, you cannot tell a character to jump at another character, since the target character may be far away. |
Rabbits move east. Rabbits jump. | In this example, when the rabbits jump, they will jump eastward. When you are in 2.5D, don't move a character upwards without using the jumping verb, since the gravity will keep it from moving up. |
When the rabbit stomps on a fox, the fox explodes. When the rabbit lands on a fox, the fox explodes. When the rabbit collides with a fox, the rabbit explodes. |
These two sentences describes two different types of collisions. They are both part of a game where a rabbit destroys a fox by jumping and landing on it - this is described with the word "stomp" (first sentence). But if the rabbit collides with a fox from any direction other than from the top, the rabbit dies (second sentence). |
When the rabbit falls on a rock, the rabbit stops. When the rabbit lands on a sapphire, the rabbit stops. |
There are ways to stop a fall. First, certain objects, such as bricks, will automatically stop a falling character when the character lands on it. Most other objects will not stop the falling, so you have to specifically describe it. After a character lands, it can jump again. But if a character can fly, such as a bird, it can jump again before it lands. |
Now, there are a few things to note about jumping.
When the rabbit lands on a brick, it bounces. | When the verb 'bounce' is used to describe an object that is able to jump, this object becomes bouncy. That is, when it lands on a platform such as a brick, it will automatically bounce. If you do not intend for this, use verbs other than 'bounce'. |
Now, add the following sentence, and see what would happen.
When a rabbit lands on a brick, it reverses direction.
Finally, change "reverses direction" to "bounces", what would happen?
When a rabbit lands on a brick, it reverses direction.
We see that when an object can jump or fall, the verb "bounce" can affect its behavior, as it makes the object 'bouncy'!
Challenge: Now try using 10 sapphires instead of bricks. Unlike bricks, sapphires do not automatically stop the rabbit from falling. Your challenge is to come up with a sentence that allows the rabbit to climb the sapphires.
Example 2: Try the following 2 examples. See which one lets the rabbit do a multi-jump (jump in air).
// Game #1. Get the spinstars.
You control the rabbit.
When you press spacebar, the rabbit jumps.
When an right arrow key is pressed, the rabbit moves right.
When an left arrow key is pressed, the rabbit moves left.
The topaz is invisible.
The diamond is invisible.
The speed of the dino is 3 pixels per frame.
The speed of the elephant is 2 pixels per frame.
When the dino reaches the topaz, the dino becomes notified.
When the dino reaches the diamond, the dino is not notified.
When the dino is notified, the dino moves right.
Otherwise, the dino moves left.
When the elephant reaches the topaz, the elephant becomes notified.
When the elephant reaches the diamond, the elephant is not notified.
When the elephant is notified, the elephant moves right.
Otherwise, the elephant moves left.
When the rabbit collides with the spinstar, the spinstar disappears.
When the rabbit reaches the border, gameover.
When the rabbit collides with a rock, gameover.
When the rabbit collides with a dino, gameover.
When the rabbit collides with an elephant, gameover.
When all the spinstars are gone, you win.
-
--s-------F--jsd
--k--------kkkk
-
-
-----F----D-----d
------kkkkkkkkkk
-
--ooo--------------k
-
--------k
------------k
----k--------------k
----------k----o
-
k---k
-------------------k
------------k
-r--------------s
-k--------------k
// Game #2. Stomp the dinos and bricks.
The player controls the kitten.
When the right arrow is pressed, the kitten moves right.
When the left arrow is pressed, the kitten moves left.
When the space bar is pressed, the kitten jumps.
The speed of the kitten is 5.
The speed of bricks is 1.3.
The speed of dinos is 2.
The speed of the ball is 2.
//Kitten movement.
When the kitten collides with a topaz, it reverses direction.
When the kitten collides with a border, it explodes.
When the kitten stomps on a dino, the dino explodes and score increases by 5.
When the kitten stomps on a brick, the brick becomes pink for 3 seconds and score increases by 1.
When the kitten stomps on a pink brick, the brick explodes.
When the kitten collides with a ball, it explodes.
When the kitten collides with a dino, it explodes.
//Brick movement.
Bricks[0,6] start by moving right.
Bricks[7,13] start by moving left.
When a brick collides with topaz, it reverses direction.
//Enemy movement.
The dinos start by moving random.
When a dino collides with a topaz, it reverses direction.
When a dino collides with a border, it reverses direction.
Ball[0] start by moving down.
Ball[1] start by moving up.
When the ball collides with border, it reverses direction.
//Game over.
When the kitten is gone, you lose.
When the score equals 20, you win.
Fl-------=---------F
F---D----------D---F
F---k----------k---F
F------------------F
F--------k---------F
F------------------F
F---k----------k---F
F------------------F
F--------k---------F
F------------------F
F---k----------k---F
F--------i---------F
F--------k---------F
F------------------F
F---k----------k---F
F------------------F
F--------k---------F
F---D----------D---F
F---k----------k---F
F-----------------lF
// Game #3. Jump Over the Pearls.
The player controls the rabbit.
When the up arrow is pressed, the rabbit jumps.
When the right arrow key is pressed, the rabbit moves right at 2.6 pixel per frame.
When the left arrow key is pressed, the rabbit moves left at 2.6 pixels per frame.
When the rabbit touches a topaz, it moves left at 1 pixels per frame.
The topaz is invisible.
When the rabbit touches a border, it explodes.
The donut starts off moving up.
When the donut touches a topaz, it reverses direction.
When the donut touches a topaz, it becomes active for 0.2 second.
When the donut is active, the donut inserts a pearl.
Then fox starts off moving right at 5 pixels per frame.
When the fox touches a border, it reverses direction.
The pearl moves left at 2 pixels per frame.
When a pearl touches a brick, it bounces.
When a pearl touches a fox, it jumps.
The fox is invisible.
When the rabbit is above a pearl, the rabbit destroys the pearl.
When the rabbit is above a pearl, the score adds 1.
When the rabbit collides with a pearl, the rabbit explodes.
When the score equals 19, you win.
When the rabbit explodes, the game is over.
-=
-
-
-
-
-
-
-
-
-
-
-
-
-
-------------------F
-
-
---------rx--------+
FFFFFFFFFFFFFFFFFFxF
kkkkkkkkkkkkkkkkkkkk
Many of the simulation models demand sophisticated math formulations to give a realistic feel and/or prediction. However, because computers are extremely good at number-crunching, they can process billions of mathematical operations per second, which we would otherwise be unable to do manually!