Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: leaderClass is not defined' in or related to this line: 'leaderList.push(spawnPoint.addChild(new LeaderClass({' Line Number: 126
Code edit (7 edits merged)
Please save this source code
User prompt
When spawning a leader, add it to the leaderList
Code edit (2 edits merged)
Please save this source code
User prompt
Add a leaderHat asset to the top of the leaderTroll2 class
User prompt
Rename the leaderHat asset to leaderTrollHat
Code edit (1 edits merged)
Please save this source code
User prompt
To each LeaderTroll
Code edit (2 edits merged)
Please save this source code
User prompt
when the spawnTimer expires, call the global table's spawn function after a random timeout of 0 to LEADER_SPAWN_VAR
Code edit (1 edits merged)
Please save this source code
User prompt
Add a spawn function to the table class which checks if the leaders array is not empty, then randomly pops an item off the array and creates an instance of it
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
Add a new global function called handleSpawnTimer, which is called on tick. In the function: decrement the spawnTimer, if the spawnTimer is <= 0 then restart it with the spawnTime value, then multiply the spawnTime by the LEADER_SPAWN_FACTOR
Code edit (15 edits merged)
Please save this source code
User prompt
every tick reduce the countdown by 1, end the game when the countdown reaches 0
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: pox is not defined' in or related to this line: 'particleList.push(foreground.addChild(new HammerParticle({' Line Number: 498
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
Create 3 empty Containers; background, midground and foreground
Code edit (6 edits merged)
Please save this source code
User prompt
The ImpactParticles that HammerParticles create, should be added to the particleList array
===================================================================
--- original.js
+++ change.js
@@ -123,16 +123,20 @@
});
var HammerParticle = ConfigContainer.expand(function (config) {
var self = ConfigContainer.call(this, config);
config = config || {};
+ ;
+ var stage = 1;
+ var elapsedTicks = 0;
var hammer = self.attachAsset('hammer', {
- anchorX: 0.5,
- anchorY: 0.5
+ anchorX: 0.75,
+ anchorY: 0.75
});
- hammer.x = hammer.width / 2;
- var elapsedTicks = 0;
- var stage = 1;
- self.update = function () {
+ hammer.x = -hammer.width * (3 / 5);
+ ;
+ self.update = update;
+ ;
+ function update() {
elapsedTicks++;
if (stage === 1) {
if (elapsedTicks <= PARTICLE_HAMMER_STAGE_1) {
hammer.rotation += PARTICLE_HAMMER_SPIN / PARTICLE_HAMMER_STAGE_1;
@@ -151,9 +155,10 @@
} else {
return true;
}
}
- };
+ }
+ ;
return self;
});
/**
* config {
@@ -388,8 +393,12 @@
/****
* Game Code
****/
+// Create 3 empty Containers; background, midground and foreground
+var background = game.addChild(new Container());
+var midground = game.addChild(new Container());
+var foreground = game.addChild(new Container());
;
//==============================================================================
// Global constants & settings
//==============================================================================
@@ -415,9 +424,9 @@
var GAME_WIDTH = 2048;
var GAME_HEIGHT = 2732;
;
// Particle settings
-var PARTICLE_HAMMER_SPIN = -MATH_QUARTER_PI * 3;
+var PARTICLE_HAMMER_SPIN = MATH_QUARTER_PI * 2.5;
var PARTICLE_HAMMER_STAGE_1 = Math.round(0.075 * GAME_TICKS);
var PARTICLE_HAMMER_STAGE_2 = Math.round(0.075 * GAME_TICKS);
var PARTICLE_HAMMER_STAGE_3 = Math.round(0.4 * GAME_TICKS);
var PARTICLE_HAMMER_ASSETS = 5;
@@ -436,9 +445,8 @@
x: GAME_WIDTH / 2,
y: GAME_HEIGHT / 2 - 500,
width: 2500
}));
-// Initialize an array to keep track of HammerParticles
var particleList = [];
;
//==============================================================================
// Game events
logo for a company called "blue lizard entertainment" using a damaged font and frozen elements.
Pixel art of the bam symbol. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of bam comic symbol.
pixel art of pow comic symbol.
pixel art of plastic squeaky hammer.
pixel art of a large, round, red start button.