White Azulian, Respawn invincibility timer

* Respawning from a checkpoint grants 3 seconds of immunity in case
  enemies are spawn camping.
* Add the white Azulian as an even faster and harder enemy than the red
  Azulian: twice as fast, jumps higher, and can detect the player from
  further away.
This commit is contained in:
Noah 2022-01-18 18:32:15 -08:00
parent 2913e706e2
commit 0ee7fb4210
13 changed files with 25 additions and 10 deletions

View File

@ -14,6 +14,11 @@ build:
doodad edit-doodad --tag "color=red" azu-red.doodad
doodad install-script azulian.js azu-red.doodad
doodad convert -t "White Azulian" white-front.png white-back.png \
white-wr{1,2,3,4}.png white-wl{1,2,3,4}.png azu-white.doodad
doodad edit-doodad --tag "color=white" azu-white.doodad
doodad install-script azulian.js azu-white.doodad
# Tag the category for these doodads
for i in *.doodad; do\
doodad edit-doodad --tag "category=creatures" $${i};\

View File

@ -9,9 +9,17 @@ var playerSpeed = color === 'blue' ? 2 : 4,
direction = "right",
lastDirection = "right";
// white Azulian is faster yet than the red
if (color === 'white') {
aggroX = 1000;
aggroY = 400;
playerSpeed = 8;
jumpSpeed = 16;
}
function setupAnimations(color) {
let left = color === 'blue' ? 'blu-wl' : 'red-wl',
right = color === 'blue' ? 'blu-wr' : 'red-wr',
let left = color === 'blue' ? 'blu-wl' : color+'-wl',
right = color === 'blue' ? 'blu-wr' : color+'-wr',
leftFrames = [left + '1', left + '2', left + '3', left + '4'],
rightFrames = [right + '1', right + '2', right + '3', right + '4'];

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 999 B

View File

@ -4,13 +4,13 @@ let speed = 4,
Vx = Vy = 0,
altitude = Self.Position().Y; // original height in the level
let direction = "left",
lastDirection = "left";
let states = {
flying: 0,
diving: 1,
};
let state = states.flying;
let direction = "left",
lastDirection = "left";
let states = {
flying: 0,
diving: 1,
};
let state = states.flying;
function main() {
Self.SetMobile(true);
@ -106,6 +106,8 @@ function main() {
// A.I. subroutine: scan for the player character.
// The bird scans in a 45 degree angle downwards, if the
// player is seen nearby in that scan it will begin a dive.
// It's not hostile towards characters that can fly (having
// no gravity).
function AI_ScanForPlayer() {
let stepY = 12, // number of pixels to skip
stepX = stepY,
@ -130,7 +132,7 @@ function AI_ScanForPlayer() {
scanX += stepX;
scanY += stepY;
for (let actor of Actors.At(Point(scanX, scanY))) {
if (actor.IsPlayer()) {
if (actor.IsPlayer() && actor.HasGravity()) {
state = states.diving;
return;
}