Noah Petherbridge
4d08bf1d85
* Switch from otto to goja for JavaScript engine. * goja supports many ES6 syntax features like arrow functions, const/let, for-of with more coming soon. * Same great features as otto, more modern environment for doodads!
20 lines
333 B
JavaScript
20 lines
333 B
JavaScript
// Goal Region.
|
|
function main() {
|
|
Self.Hide();
|
|
|
|
Events.OnCollide((e) => {
|
|
if (!e.Settled) {
|
|
return;
|
|
}
|
|
|
|
// Only care if it's the player.
|
|
if (!e.Actor.IsPlayer()) {
|
|
return;
|
|
}
|
|
|
|
if (e.InHitbox) {
|
|
FailLevel("You have died!");
|
|
}
|
|
});
|
|
}
|