OLD | NEW |
1 # Level description file. This file describes a single level. It | 1 # Level description file. This file describes a single level. It |
2 # is designed to be referenced from the game.def file. | 2 # is designed to be referenced from the game.def file. |
3 # It should not pollute the global namespace and should return a | 3 # It should not pollute the global namespace and should return a |
4 # single value which is the table describing the level. | 4 # single value which is the table describing the level. |
5 # vi: filetype=yaml | 5 # vi: filetype=yaml |
6 | 6 |
7 num_stars: 3 | 7 num_stars: 3 |
8 | 8 |
9 sprites: | 9 shapes: |
10 - { pos: [ 100, 500 ], image: ball_image, script: ball.lua, tag: BALL } | 10 # Create sprites |
11 - { pos: [ 700, 40 ], image: goal_image, tag: GOAL, sensor: true } | 11 - { type: image, dynamic: true, pos: [ 100, 500 ], image: ball_image, script:
ball.lua, tag: BALL } |
12 - { pos: [ 200, 480 ], image: star_image, tag: STAR1, sensor: true } | 12 - { type: image, pos: [ 700, 40 ], image: goal_image, tag: GOAL, sensor: true
} |
13 - { pos: [ 200, 240 ], image: star_image, tag: STAR2, sensor: true } | 13 - { type: image, pos: [ 200, 480 ], image: star_image, tag: STAR1, sensor: tru
e } |
14 - { pos: [ 420, 90 ], image: star_image, tag: STAR3, sensor: true } | 14 - { type: image, pos: [ 200, 240 ], image: star_image, tag: STAR2, sensor: tru
e } |
| 15 - { type: image, pos: [ 420, 90 ], image: star_image, tag: STAR3, sensor: tru
e } |
15 | 16 |
16 shapes: | |
17 # create three ramps for the ball to roll down | 17 # create three ramps for the ball to roll down |
18 - { type: line, color: [ 50, 230, 0 ], start: [ 20, 450 ], finish: [ 550, 400
] } | 18 - { type: line, color: [ 50, 230, 0 ], start: [ 20, 450 ], finish: [ 550, 400
] } |
19 | 19 |
20 - { type: line, color: [ 230, 50, 0 ], start: [ 200, 200], finish: [ 780, 380
] } | 20 - { type: line, color: [ 230, 50, 0 ], start: [ 200, 200], finish: [ 780, 380
] } |
21 | 21 |
22 - { type: line, color: [ 0, 50, 230 ], start: [ 20, 240 ], finish: [ 200, 50
] } | 22 - { type: line, color: [ 0, 50, 230 ], start: [ 20, 240 ], finish: [ 200, 50
] } |
23 | 23 |
24 # create a box | 24 # Create a box made of 4 lines. |
25 - { type: line, start: [ 500, 200 ], finish: [ 500, 300 ] } | 25 - { type: compound, pos: [ 500, 200 ], |
26 - { type: line, start: [ 500, 300 ], finish: [ 600, 300 ] } | 26 children: [ |
27 - { type: line, start: [ 600, 300 ], finish: [ 600, 200 ] } | 27 { type: line, start: [ 0, 0 ], finish: [ 0, 100 ] }, |
28 - { type: line, start: [ 600, 200 ], finish: [ 500, 200 ] } | 28 { type: line, start: [ 0, 100 ], finish: [ 100, 100 ] }, |
| 29 { type: line, start: [ 100, 100 ], finish: [ 100, 0 ] }, |
| 30 { type: line, start: [ 100, 0 ], finish: [ 0, 0 ] }, |
| 31 { type: image, pos: [ 50, 50 ], image: star_image } |
| 32 ] |
| 33 } |
29 | 34 |
30 # create a dynamic line anchored to the world at a fixed point. | 35 # create a dynamic line anchored to the world at a fixed point. |
31 - { type: line, start: [ 220, 50 ], finish: [ 620, 50 ], dynamic: true, anchor
: [ 420, 50 ] } | 36 - { type: line, start: [ 220, 50 ], finish: [ 620, 50 ], dynamic: true, anchor
: [ 420, 50 ] } |
32 | 37 |
33 # create a 'floor' object using the 'edge' type | 38 # create a 'floor' object using the 'edge' type |
34 - { type: edge, start: [ 0, 0 ], finish: [ 800, 0 ], tag: FLOOR } | 39 - { type: edge, start: [ 0, 0 ], finish: [ 800, 0 ], tag: FLOOR } |
OLD | NEW |