From 33f2dca5bcfeb7511aafa6161a0657d2eea6f604 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Thu, 2 Sep 2021 21:26:55 -0700 Subject: [PATCH] Editor: Doodad Properties Window The Doodad Properties window brings many features that used to be available only in the `doodad` CLI tool into the Doodad Editor. * In the Doodad Editor there is a new menubar item: "Doodad" which corresponds to the "Level" menu when you're editing a level. * The "Doodad" menu has two items: - "Doodad Properties" (NEW) - "Layers" (moved here from the Tools menu) * The Doodad Properties window lets you edit the Title and Author values of the doodad, as well as modify its Tags and manage its Script. * Its script can be attached (browse for .js file on disk), its existing script saved back to disk (dev shell prompt) or deleted altogether from the doodad. * You can create, modify, and delete Tags on the doodad. Other changes: * In the Level Editor, the "Level->Page Settings" menu is renamed to "Level->Level Properties" to match with "Doodad->Doodad Properties" and the pop-up window is retitled accordingly. * The Exit Flag only exits if the Player touches it - not just any mobile doodad! --- dev-assets/doodads/objects/exit-flag.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dev-assets/doodads/objects/exit-flag.js b/dev-assets/doodads/objects/exit-flag.js index fe530fe..9e65bf1 100644 --- a/dev-assets/doodads/objects/exit-flag.js +++ b/dev-assets/doodads/objects/exit-flag.js @@ -1,12 +1,17 @@ // Exit Flag. function main() { - Self.SetHitbox(22+16, 16, 75-16, 86); + Self.SetHitbox(22 + 16, 16, 75 - 16, 86); - Events.OnCollide(function(e) { + Events.OnCollide(function (e) { if (!e.Settled) { return; } + // Only care if it's the player. + if (!e.Actor.IsPlayer()) { + return; + } + if (e.InHitbox) { EndLevel(); }