How to make a ladder work in a platformer game
Jason Berman
|
44 steps
|
2 minutes
Construct
1
Double click on the layout to create a new object
2
Select a tiled background
3
Click the "Name" field. Type "Ladder [[Enter]]"
4
Draw a ladder (or import a picture)
5
Click "Crop transparent edges (⌥ + C)\ (Hold Ctrl for no padding)"
6
Click "Resize (⌥ + R)"
7
Type 40 or 50 so your ladder is not too big for your screen
8
Click here.
9
Close the animation editor
10
Double-click on the layout to create a new keyboard object
11
Click "Event sheet 1"
12
Click "Add event"
13
Select your player object
14
Double-click "Is overlapping another object"
15
Click "<click to choose>"
16
Double-click "Ladder" Click "Done"
17
Click "Add action"
18
Double-click "player"
19
Double-click "Set vector Y"
20
Keep the number as 0 Click "Done"
21
Right-click "playerIs overlapping Ladder" in the small magic spot highlighted and click on create new sub event
22
Select your keyboard object
23
Double-click "Key is down"
24
Click "<click to choose>"
25
Press the up arrow on your keyboard
26
Click "Done"
27
Click "Add action"
28
Double-click on the player object
29
Double-click "Set vector Y"
30
Type "-300", this will make him climb the ladder when he is on it and pressing up
31
Click "Done"
32
Right-click "playerIs overlapping Ladder" and select Add new sub event again
33
Double-click on your keyboard object
34
Double-click "Key is down"
35
Click "<click to choose>"
36
Press the Down Arrow on your keyboard
37
Click "OK"
38
Click "Done"
39
Click "Add action"
40
Double-click "player"
41
Double-click "Set vector Y"
42
Type "500" so it will go down fast when you hold down the arrow key
43
Click "Done"
44
Click "Preview layout" to test out your new ladder!