Skip to content

Commit fd38e0e

Browse files
committed
"fix" gravity level guide
1 parent eb8109a commit fd38e0e

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

content/docs/level-guides/gravity.mdx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ title: Gravity
77
## Objective
88

99
In this level the player is tasked with creating a simple physics system to move two gameobjects:
10+
1011
- The trashcan needs to be assigned a **downward velocity**.
1112
- The raccoon needs to be given a **custom velocity handle** to handle gravity and a jump input.
1213
- The raccoons Y axis position needs to be calculated for every frame.
13-
When all these mechanics are implemented the player has to make the raccoon jump intro the trashcan.
14+
When all these mechanics are implemented the player has to make the raccoon jump intro the trashcan.
1415

1516
## Scenario
1617

@@ -22,7 +23,7 @@ With the help of the player the raccoon wants to make the trashcan fall from the
2223

2324
### Velocity-based movement
2425

25-
In this level we are using velocity-based movement to further expand on the movement we already added in the "Move" level.
26+
In this level we are using velocity-based movement to further expand on the movement we already added in the [Move](/docs/level-guides/move) level.
2627
Velocity describes how fast an object is moving and in what direction.
2728
So instead of the movement keys directly affeting the raccoons position, they will only affect the velocity of the raccoon.
2829
This means that each frame the raccoons position needs to be calculated using its last position and it's current velocity.
@@ -31,21 +32,27 @@ For simplicity we are only applying this concept to the Y axis in this level.
3132

3233
### Custom handles
3334

34-
Custom handles can be added using the `exportToGameobject` node. They help in tracking more data over from the last frame.
35+
Custom handles can be added using the `ExportToGameobject` node. They help in carrying over additional data from the previous frame.
3536

3637
In this level the player only has the raccoons Y axis position available as import and export.
3738
A custom velocity handle needs to be added to keep track of the raccoons momentum in each frame.
3839

3940
## Strategic Goals
4041

4142
- Assign a value to the trashcans Y axis velocity
42-
- Create a custom velocity handle and calculate the raccoons Y axis position for each frame using the velocity
43+
- Create a custom velocity handle for the raccoon and calculate the raccoons Y axis position for each frame using the velocity
44+
45+
The formula with which to calculate the displacement of the raccoon per frame is:
46+
47+
$$
48+
v \cdot \Delta t = d
49+
$$
50+
4351
- Create a constant gravity force using `deltaTime` and add it to the velocity each frame
44-
- Make sure the velocity doesn't scale infinitely while the raccoon is standing on the ground
52+
- Make sure the velocity doesn't scale infinitely while the raccoon is standing on the ground
4553
- Add a `KeyPress` node, which triggers a jump force being added to the velocity
4654

47-
4855
## Relevant Documentation
4956

5057
- [Physically Based Animation](/docs/physically-based-animation/dynamics-of-a-point-mass)
51-
- [Export Node](docs/nodes/export)
58+
- [Export Node](/docs/nodes/export)

0 commit comments

Comments
 (0)