136 : Keys for level 2 and 3
Balthazar:
Note that you the goal doesn't indicate whether or not it is currently locked. We'll update that code once we start adding images.
Balthazar:
We can add a key to level 2
function init_level2() {
...
add_default_platforms(level);
var item_data = [
[250, 360, 20, 20, "key"],
];
add_items(level, item_data);
level.goal = create_goal(500, 360, 2);
...
}
Balthazar:
Rather than add a key to level 3 (which would just allow us to loop back to level 1 in any case), we can add a new item that ends the game when you acquire it.
function init_level3() {
...
add_default_platforms(level);
var item_data = [
[500, 360, 20, 20, "finish"],
];
add_items(level, item_data);
level.goal = create_goal(500, 360, 0);
_levels.push(level);
}
GOTO 141