Code edit (3 edits merged)
Please save this source code
User prompt
if a closest enemy was found, increase the baseAngle by the angle from the hero to the closestEnemy
User prompt
In the weaponCross class replace the TODO comment by finding the closest (square distance) child in the midgroundContainer, making sure that the child has tag TAG_ENEMY and not TAG_PROJECTILE
Code edit (2 edits merged)
Please save this source code
User prompt
Rename the midBackContainer to midgroundContainer
User prompt
Remove the midFrontContainer, replacing any occurrences with midBackContainer
Code edit (1 edits merged)
Please save this source code
Code edit (21 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: e is undefined' in or related to this line: 'LK.effects.flashObject(self.collision, 0xAA0000, 1000);' Line Number: 508
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: heightDifference is not defined' in or related to this line: 'var dy = hero.y + heightDifference - self.y;' Line Number: 97
Code edit (16 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: self is undefined' in or related to this line: 'var updateBase = self.update;' Line Number: 117
User prompt
Please fix the bug: 'ReferenceError: WeaponFireball is not defined' in or related to this line: 'startingWeapons.push(backgroundContainer.addChild(new PickupWeapon({' Line Number: 525
Code edit (2 edits merged)
Please save this source code
User prompt
add a hero asset with anchor (0.5, 1.0) to the Hero class
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: tint is not defined' in or related to this line: 'var bar = self.attachAsset('shapeBox', {' Line Number: 73
Code edit (7 edits merged)
Please save this source code
User prompt
add an outlineSmall asset to the joystickKnob and an outlineLarge asset to the joystick
Code edit (2 edits merged)
Please save this source code
User prompt
add a new sorting container (inheriting from Container) that has an update function that sorts it's children array by their ascending y value
===================================================================
--- original.js
+++ change.js
@@ -42,5 +42,116 @@
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
+});
+
+/****
+* Game Code
+****/
+;
+//==============================================================================
+// Global constants & settings
+//==============================================================================
+;
+var GAME_TICKS = 60;
+var GAME_WIDTH = 2048;
+var GAME_HEIGHT = 2732;
+;
+// Hero settings
+var HERO_COLOUR = 0x0FA0FF;
+var HERO_BORDER = 200;
+var HERO_HEALTH_BASE = 100;
+var HERO_HEALTH_BONUS = 30;
+var HERO_SPEED_BASE = 8;
+var HERO_SPEED_BONUS = 2;
+// Enemy settings
+var ENEMY_COLOUR = 0xAA0000;
+var ENEMY_BORDER = 50; // Forced minimum move distance from the edge of the screen
+var ENEMY_BORDER_SPAWN = -100;
+var ENEMY_SPAWN_DELAY = 2 * GAME_TICKS;
+var ENEMY_SPAWN_RATE_BASE = 1 * GAME_TICKS;
+var ENEMY_SPAWN_RATE_SCALE = 0.75 * GAME_TICKS;
+var ENEMY_SPAWN_RATE_MIN = 0.25 * GAME_TICKS;
+var ENEMY_LIMIT = 40;
+var ENEMY_XP_RANGE = 50;
+var ENEMY_STATE_MOVE = 'move';
+var ENEMY_STATE_FLEE = 'flee';
+var ENEMY_STATE_ATTACK = 'attack';
+var ENEMY_BASIC_SPEED = 2.5;
+var ENEMY_BASIC_HEALTH_BASE = 10;
+var ENEMY_BASIC_HEALTH_SCALE = 50;
+var ENEMY_BASIC_HEALTH_OFFSET = 30;
+var ENEMY_BASIC_ATTACK_RANGE = 100;
+var ENEMY_BASIC_ATTACK_DAMAGE = 10;
+var ENEMY_BASIC_ATTACK_COOLDOWN = GAME_TICKS / 6;
+var ENEMY_BASIC_GRAPHICS_OFFSET = -100;
+var ENEMY_BASIC_BOB_MAGNITUDE = 2;
+var ENEMY_BASIC_BOB_PERIOD = 10;
+var ENEMY_BASIC_XP_DROP_CHANCE = 0.3; // Per level of Luck
+var ENEMY_RANGED_SPEED = 1.5;
+var ENEMY_RANGED_HEALTH_BASE = 20;
+var ENEMY_RANGED_HEALTH_SCALE = 60;
+var ENEMY_RANGED_HEALTH_OFFSET = 20;
+var ENEMY_RANGED_RANGE_MIN = 500;
+var ENEMY_RANGED_RANGE_VAR = 250;
+var ENEMY_RANGED_ATTACK_DAMAGE = 5;
+var ENEMY_RANGED_MOVE_COOLDOWN_ADJUSTMENT = -0.5;
+var ENEMY_RANGED_GRAPHICS_OFFSET = -100;
+var ENEMY_RANGED_FLEE_DISTANCE_FACTOR = 0.35;
+var ENEMY_RANGED_FLEE_SPEED_FACTOR = 1.5;
+var ENEMY_RANGED_SCALE_PERIOD = 20;
+var ENEMY_RANGED_SCALE_MAGNITUDE = 0.05;
+var ENEMY_RANGED_XP_DROP_BASE = 2;
+var ENEMY_RANGED_XP_DROP_CHANCE = 0.5; // Per level of Luck
+var ENEMY_RANGED_DIFFICULTY = 0.2;
+var ENEMY_RANGED_SPAWN_CHANCE_MIN = 0.4;
+var ENEMY_RANGED_SPAWN_CHANCE_FACTOR = 0.5;
+// Pickup settings
+var PICKUP_HEAL_MINOR = 0.1;
+var PICKUP_HEAL_MAJOR = 1.0;
+var PICKUP_HEALTH_COUNT = 3;
+var PICKUP_HEALTH_CHANCE = 0.02; // Per level of luck
+var PICKUP_CRUCIFIX_COUNT = 1;
+var PICKUP_CRUCIFIX_RANGE = 100;
+var PICKUP_WEAPON_RANGE = 100;
+;
+//==============================================================================
+// Instances & variables
+//==============================================================================
+;
+// Variables
+var isPaused = false;
+var enemyCount = 0;
+var minorBoonCount = 0;
+var majorBoonCount = 0;
+var pickupHealthCount = 0;
+var pickupCrucifixCount = 0;
+var difficultyScale = 0;
+var startingWeapons = [];
+var minorBoonLevels = {
+ 'Luck': 0,
+ 'Scale': 0,
+ 'Range': 0,
+ 'Damage': 0,
+ 'Rearm': 0,
+ 'Duration': 0,
+ 'Health': 0,
+ 'Speed': 0
+};
+var majorBoonLevels = {
+ 'Growth': 0,
+ 'Split': 0
+};
+;
+// Game instances
+game.attachAsset('grassBot', {
+ y: GAME_HEIGHT - HERO_BORDER,
+ x: GAME_WIDTH / 2,
+ anchorX: 0.5,
+ anchorY: 1.0
+});
+game.attachAsset('grassTOP', {
+ y: HERO_BORDER,
+ x: GAME_WIDTH / 2,
+ anchorX: 0.5
});
\ No newline at end of file
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