@@ -3,3 +3,49 @@ title: Gravity
33---
44
55# Level 8: Gravity
6+
7+ ## Objective
8+
9+ In this level the player is tasked with creating a simple physics system to move two gameobjects:
10+ - The trashcan needs to be assigned a ** downward velocity** .
11+ - The raccoon needs to be given a ** custom velocity handle** to handle gravity and a jump input.
12+ - 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+
15+ ## Scenario
16+
17+ The player encounters a floating trashcan.
18+ The raccoon wants to be able to jump into the trashcan, but it has no ability to jump yet and is unable to reach the trashcan.
19+ With the help of the player the raccoon wants to make the trashcan fall from the sky and jump into it.
20+
21+ ## Key Concepts Introduced
22+
23+ ### Velocity-based movement
24+
25+ In this level we are using velocity-based movement to further expand on the movement we already added in the "Move" level.
26+ Velocity describes how fast an object is moving and in what direction.
27+ So instead of the movement keys directly affeting the raccoons position, they will only affect the velocity of the raccoon.
28+ This means that each frame the raccoons position needs to be calculated using its last position and it's current velocity.
29+
30+ For simplicity we are only applying this concept to the Y axis in this level.
31+
32+ ### Custom handles
33+
34+ Custom handles can be added using the ` exportToGameobject ` node. They help in tracking more data over from the last frame.
35+
36+ In this level the player only has the raccoons Y axis position available as import and export.
37+ A custom velocity handle needs to be added to keep track of the raccoons momentum in each frame.
38+
39+ ## Strategic Goals
40+
41+ - 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 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
45+ - Add a ` KeyPress ` node, which triggers a jump force being added to the velocity
46+
47+
48+ ## Relevant Documentation
49+
50+ - [ Physically Based Animation] ( /docs/physically-based-animation/dynamics-of-a-point-mass )
51+ - [ Export Node] ( docs/nodes/export )
0 commit comments