Reset Timer Doodad + Various Fixes
* Bird is not solid when colliding with other birds. * If the dev shell is used to run JavaScript during Play Mode, consider it cheating (so player can't `$ d.Scene.ResetTimer()` for example) * On Survival Mode levels, DieByFire immediately opens the End Level (silver score) modal rather than respawn from checkpoint, so levels don't need checkpoint contraptions to end the level. * During level loading screens, wait and call doodads' main() function until the very end.
This commit is contained in:
parent
c8479adde9
commit
66382739bb
|
@ -31,7 +31,7 @@ function main() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (e.Actor.IsMobile() && e.InHitbox) {
|
||||
if (e.Actor.IsMobile() && e.Actor.HasGravity() && e.InHitbox) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -28,6 +28,10 @@ build:
|
|||
doodad edit-doodad --tag "color=invisible" reg-warp-door.doodad
|
||||
doodad install-script ../warp-door/warp-door.js reg-warp-door.doodad
|
||||
|
||||
# Reset Level Timer
|
||||
doodad convert -t "Reset Level Timer" timer-64.png reg-reset-timer.doodad
|
||||
doodad install-script reset-timer.js reg-reset-timer.doodad
|
||||
|
||||
for i in *.doodad; do\
|
||||
doodad edit-doodad --tag "category=technical" $${i};\
|
||||
done
|
||||
|
|
30
dev-assets/doodads/regions/reset-timer.js
Normal file
30
dev-assets/doodads/regions/reset-timer.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Reset Level Timer.
|
||||
function main() {
|
||||
Self.Hide();
|
||||
|
||||
// Reset the level timer only once.
|
||||
let hasReset = false;
|
||||
|
||||
Events.OnCollide((e) => {
|
||||
if (!e.Settled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only care if it's the player.
|
||||
if (!e.Actor.IsPlayer()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.InHitbox && !hasReset) {
|
||||
Level.ResetTimer();
|
||||
hasReset = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Receive a power signal resets the doodad.
|
||||
Message.Subscribe("power", (powered) => {
|
||||
if (powered) {
|
||||
hasReset = true;
|
||||
}
|
||||
});
|
||||
}
|
BIN
dev-assets/doodads/regions/timer-64.png
Normal file
BIN
dev-assets/doodads/regions/timer-64.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 901 B |
Loading…
Reference in New Issue
Block a user