Noah Petherbridge
2c1185cc9f
* The blue and orange ON/OFF state blocks have all been increased in size to better match the player character (42x42 up from 33x33) * Added a new mob: the Red Bird. It flies back and forth while maintaining its altitude, similar to the Red Azulian. Planned AI behavior is to divebomb the player when it gets close. Dive sprites are included but not yet hooked up in JavaScript. * Warp Doors! (WIP). They have a golden "W" on them and come in three varieties: Brown, Blue and Orange. The blue and orange ones are sensitive to the State Block and will become dotted outlines when inactive (and can not be entered in this state). The door opens for the player character, makes him disappear, then closes again. The plan is it will then warp you to the location of a linked Warp Door elsewhere on the level, but for now it will just make the player re-appear after completing the Close Door animation.
24 lines
414 B
JavaScript
24 lines
414 B
JavaScript
// Orange State Block
|
|
function main() {
|
|
Self.SetHitbox(0, 0, 42, 42);
|
|
|
|
// Orange block is OFF by default.
|
|
var state = false;
|
|
|
|
Message.Subscribe("broadcast:state-change", function(newState) {
|
|
state = newState;
|
|
|
|
// Layer 0: OFF
|
|
// Layer 1: ON
|
|
Self.ShowLayer(state ? 1 : 0);
|
|
});
|
|
|
|
Events.OnCollide(function(e) {
|
|
if (e.Actor.IsMobile() && e.InHitbox) {
|
|
if (state) {
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
}
|