Professional Documents
Culture Documents
GSPlat
Step 2: Go to Scenes, double-click Initial Scene, and then click + to create 2 actors.
Step 3: Rename the actors by double-clicking on their names: Actor 1 to Player Actor 2 to Ground
Platformer Template Step 4: Double-click on Ground actor, look at Attributes, and scroll down to Physics. Change the following: Density: Friction: Bounciness: Movable:
0 0 0 Uncheck
Step 6: Under Player actor, look at Attributes and then scroll down to Physics. Change the following: Density: Friction: Bounciness: Fixed Rotation:
0 0 0 Checked
Platformer Template Step 7: Drag in Collide behavior and make Player collide with Ground.
Step 8: Drag in Accelerate behavior under the Collide behavior. Change the following: Direction: Acceleration: Relative to:
Platformer Template Step 9: Click Create Rule and set the conditions to the following: When ALL conditions are valid: Actor receives event key Actor receives event key
right left
is is
down up
Step 10: Drag a Change Attribute behavior into the Rule and do the following: Change Attribute: Player.Motion.Linear Velocity.X To: 200
Step 11: Repeat Step 10, but add it to Otherwise and do the following: Change Attribute: Player.Motion.Linear Velocity.X To: 0
Platformer Template
Step 13: Click on the Move Right rule you made to highlight it and copy it. How to copy: Click what you want to copy so its selected. Go to Edit. Go to Copy. Go to Paste.
**You will end up with 2 Move Right rules that look like this.**-------------------------------->
**You will edit the bottom Move Right rule in the next step.**---------------------------------->
Step 15: Change the conditions to the following so it looks like the image below:
Down to Up Up to Down
5
Platformer Template Step 16: Under Change Attribute, change 200 to -200 to look like the image below.
Step 17: Go back to Scene Editor and place the Ground actor onto the scene. **Stretch out the Ground how you want it and place a few more to make platforms**
Step 18: Place the Player actor onto the scene and resize it how you want.
Step 19: Click Preview button and try moving your Player left and right!
Platformer Template Jumping! Step 20: Go to Scene Editor, double-click on Player, and click + to create an integer.
------------->
Step 22: Create a New Rule, name it Jump, and set the conditions to the following: When ALL conditions are valid: Actor receives event Attribute
key self.Jump
up >
is 0
down
Step 23: Drag Change Attribute behavior into the Jump rule and fill in the following: Change Attribute: Player.Motion.Linear Velocity. Y To: 500
Platformer Template Step 24: Drag over another Change Attribute behavior and fill in the following: Change Attribute: Player.Jump To: 0
Step 25: Create a New Rule, name it Jump1, and set the conditions to the following: When ALL conditions are valid: Actor receives event overlaps or collides with
Step 26: Drag Change Attribute behavior into the Jump1 rule and fill in the following: Change Attribute: Player.Jump To: 1
Step 27: Click Preview button and try make your Player jump!
Platformer Template Step 28: Go to Screen Editor, create a new actor by clicking +, and name it Walls.
Step 29: Double-click Walls, go to Attributes, then Physics, and uncheck Movable.
Step 30: Go to Screen Editor, then to Player, add Collide behavior, and set to Walls.
Step 31: Go to Screen Editor and place the Walls on the sides (stretch as needed).
Platformer Template Step 32: Create 2 new actors by pressing + and name them Door and DeathZone.
Step 33: Double-click Door actor, look at Attributes, and uncheck Movable.
Step 34: Repeat Step 33, but for the DeathZone actor.
10
Platformer Template Step 35: Go to Screen Editor, double-click Player actor, and minimize coding. **To minimize coding, click the Triangles to the left of the On buttons**
Step 36: Create a New Rule, name it Level Win, and set the following conditions: When ALL conditions are valid: Actor receives event overlaps or collides with actor of type Door
Step 37: Add the Display Text behavior to the rule, type You Win! and pick a color.
Step 38: Add the Timer behavior to the Level Win rule and set it to After 1 second.
11
Platformer Template
Step 39: Add the Reset Scene behavior into the Timer and minimize rule.
Step 40: Create a New Rule, name it Player Death, and set the following conditions: When ALL conditions are valid: Actor receives event overlaps or collides with actor of type DeathZone
Step 41: Add the Reset Scene behavior into the Player Death rule.
Step 42: Go to Screen Editor and add the Door and DeathZone actors on the screen.
If you want: -Stretch Door and DeathZone actors -Add a few DeathZone actors -Rearrange the scene
12
Platformer Template Step 43: Go to Scene, then Layers, click Background, and move Player to top.
------------------>
Step 44: Click Preview and that is it! You are done!
13