Level Exit Doodad
* Add a Level Exit doodad, which for now is a little blue flag on a pole that reads "END" * JavaScript API: global function EndLevel() will end the level. The exit doodad calls this when touched by the player. * Add a "Level Completed" alert box UI to PlayScene with dynamic button layouts. * The alert box pops up when a doodad calls EndLevel() and contains action buttons what to do next. * "Play Again" restarts the current level again. * "Edit Level" if you came from the EditorScene; otherwise this button is not visible. * "Next Level" is a to-be-implemented button to advance in the single player story mode. Only shows up when PlayScene.HasNext=true. * "Exit to Menu" is always visible and closes out to the MainScene.
This commit is contained in:
parent
5bc5319543
commit
3f8e4f1926
|
@ -86,7 +86,19 @@ azulians() {
|
||||||
cd ..
|
cd ..
|
||||||
}
|
}
|
||||||
|
|
||||||
|
objects() {
|
||||||
|
cd objects/
|
||||||
|
|
||||||
|
doodad convert -t "Exit Flag" exit-flag.png exit-flag.doodad
|
||||||
|
doodad install-script exit-flag.js exit-flag.doodad
|
||||||
|
|
||||||
|
cp *.doodad ../../../assets/doodads/
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
}
|
||||||
|
|
||||||
buttons
|
buttons
|
||||||
doors
|
doors
|
||||||
trapdoors
|
trapdoors
|
||||||
azulians
|
azulians
|
||||||
|
objects
|
||||||
|
|
11
dev-assets/doodads/objects/exit-flag.js
Normal file
11
dev-assets/doodads/objects/exit-flag.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
// Exit Flag.
|
||||||
|
function main() {
|
||||||
|
console.log("%s initialized!", Self.Doodad.Title);
|
||||||
|
Self.SetHitbox(22+16, 16, 75-16, 86);
|
||||||
|
|
||||||
|
Events.OnCollide(function(e) {
|
||||||
|
if (e.InHitbox) {
|
||||||
|
EndLevel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
BIN
dev-assets/doodads/objects/exit-flag.png
Normal file
BIN
dev-assets/doodads/objects/exit-flag.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 932 B |
Loading…
Reference in New Issue
Block a user