Code edit (3 edits merged)
Please save this source code
User prompt
when the countdowntimer summons the boss, also play the clockChime sound
Code edit (4 edits merged)
Please save this source code
User prompt
when the enemyboss dies, play the enemyroar sound
Code edit (2 edits merged)
Please save this source code
User prompt
when the hero dies, show the game over on the next frame
User prompt
when the hero dies, play the heroDeath sound
User prompt
when the hero takes damage, play the heroImpact sound
Code edit (1 edits merged)
Please save this source code
User prompt
when a projectilecross deals damage to an enemy, play the weaponCrossImpact sound
Code edit (2 edits merged)
Please save this source code
User prompt
when an enemy dies play the enemyDeath sound
Code edit (2 edits merged)
Please save this source code
User prompt
when the hero is healed, play the heroHealed sound effect
Code edit (1 edits merged)
Please save this source code
User prompt
in the enemyboss onupdate function, self.graphics.scale.x *= -1 every 15 LK.ticks
Code edit (1 edits merged)
Please save this source code
Code edit (17 edits merged)
Please save this source code
User prompt
on game start play the backgroundAmbient sound and every 10 seconds
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: ENEMY_RANGED_SPEED_PROJECTILE is not defined' in or related to this line: 'self.moveInDirection(config.direction, ENEMY_RANGED_SPEED_PROJECTILE);' Line Number: 454
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: adjustStateBase is not defined' in or related to this line: 'var newStateValues = adjustStateBase(state, stateValues);' Line Number: 944
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -780,9 +780,9 @@
case ENEMY_STATE_MOVE:
stateValues.speedFactor = 1;
break;
case ENEMY_STATE_FLEE:
- stateValues.cooldownAdjustment = self.attackCooldown - cooldown;
+ stateValues.cooldownAdjustment = self.attackCooldown - cooldown; // Reset cooldown
stateValues.speedFactor = -1;
break;
case ENEMY_STATE_ATTACK:
stateValues.cooldownAdjustment = -1;
@@ -896,8 +896,9 @@
self.speed = ENEMY_BOSS_SPEED;
self.health = ENEMY_BOSS_HEALTH;
self.attackRange = ENEMY_BOSS_ATTACK_RANGE;
self.attackCooldown = ENEMY_BOSS_ATTACK_COOLDOWN;
+ self.fleeRange = ENEMY_BOSS_FLEE_RANGE;
self.graphics = container.attachAsset('enemyBoss', {
anchorX: 0.5,
anchorY: 1.0
});
@@ -910,8 +911,13 @@
}
self.adjustState = function (state, stateValues) {
var newStateValues = adjustStateBase(state, stateValues);
switch (state) {
+ case ENEMY_STATE_FLEE:
+ newStateValues.speedFactor = 0;
+ newStateValues.cooldownAdjustment = -1;
+ newStateValues.canAttack = true;
+ break;
case ENEMY_STATE_ATTACK:
newStateValues.speedFactor = 1;
break;
}
@@ -921,8 +927,9 @@
hero.takeDamage(ENEMY_BOSS_ATTACK_DAMAGE);
};
self.onDestroy = function () {
LK.effects.flashScreen(0x000000, 1000);
+ enemyCount--;
enemySpawner.setEnabled(false);
upgradeButton.setHidden(true);
for (var i = midgroundContainer.children.length - 1; i >= 0; i--) {
var child = midgroundContainer.children[i];
@@ -952,9 +959,9 @@
anchorY: 0.5
}));
};
self.healthOffset = -self.graphics.height + ENEMY_BOSS_HEALTH_OFFSET;
- self.setRadius(self.graphics.width / 2);
+ self.setRadius(ENEMY_BOSS_FLEE_RANGE);
self.takeDamage(0);
return self;
});
var EnemyBasic = Enemy.expand(function (config) {
@@ -1189,8 +1196,9 @@
var BOON_FULL_HEAL = 'Full Heal';
var BOON_MINOR_HEAL = 'Minor Heal';
;
// Weapon settings
+var WEAPON_OFFSET = 350;
var WEAPON_HEIGHT_BASE = 50;
var WEAPON_HEIGHT_PERIOD = 10;
var WEAPON_HEIGHT_MAGNITUDE = 10;
var WEAPON_CROSS_SPLIT_INCREMENT = 20 / 180 * Math.PI;
@@ -1265,13 +1273,14 @@
var ENEMY_RANGED_PROJECTILE_SPEED = 10;
var ENEMY_RANGED_PROJECTILE_RADIUS = 100;
;
var ENEMY_BOSS_SPEED = 3.0;
-var ENEMY_BOSS_HEALTH = 5;
+var ENEMY_BOSS_HEALTH = 5000;
var ENEMY_BOSS_HEALTH_OFFSET = -30;
var ENEMY_BOSS_ATTACK_RANGE = 200;
var ENEMY_BOSS_ATTACK_DAMAGE = 5;
-var ENEMY_BOSS_ATTACK_COOLDOWN = GAME_TICKS / 10;
+var ENEMY_BOSS_ATTACK_COOLDOWN = GAME_TICKS / 6;
+var ENEMY_BOSS_FLEE_RANGE = 90;
var ENEMY_BOSS_PROJECTILE_COUNT = 5;
var ENEMY_BOSS_PROJECTILE_ROTATION = MATH_2_PI / GAME_TICKS;
var ENEMY_BOSS_PROJECTILE_OFFSET = -100;
;
@@ -1351,10 +1360,10 @@
weaponClass: WeaponFireball
}));
*/
backgroundContainer.addChild(new PickupWeapon({
- x: GAME_WIDTH / 4 * 2,
- y: GAME_HEIGHT / 4 * 3,
+ x: GAME_WIDTH / 2 - WEAPON_OFFSET,
+ y: GAME_HEIGHT / 2 + WEAPON_OFFSET * GAME_PERSPECTIVE,
scale: 1.25,
graphics: 'weaponCross',
weaponClass: WeaponCross
}));
pixel art cross with blue accents Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a white orb. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a white orb with a halo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a pulsating white heart with a halo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a dark goo projectile with red highlights. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art tall blue fireball. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of an evil fantasy sword facing downward. Minor red details. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
backgroundAmbient
Sound effect
heroHealed
Sound effect
pickupExperience
Sound effect
heroLeveled
Sound effect
weaponCrossImpact
Sound effect
heroImpact
Sound effect
enemyDeath
Sound effect
pickupWeapon
Sound effect
pickupCrucifix
Sound effect
weaponCrossLaunch
Sound effect
heroDeath
Sound effect
enemyRoar
Sound effect
clockChime
Sound effect