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
User prompt
Create a HammerParticle instead of an ImpactParticle on click
User prompt
Create a new HammerParticle class that extends ConfigContainer, and has a hammer asset with anchor .5,.5 and x equal to half its width. It has an update function (which will be called every tick) which updates it's rotation by PARTICLE_HAMMER_SPIN over PARTICLE_HAMMER_STAGE_1 ticks, then creates a new ImpactParticle at it's location, then fades out over PARTICLE_HAMMER_STAGE_2 time, and finally returns true, indicating it should be destroyed
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
in the on tick event, iterate through all the particles in the particleList calling their update function, if it returns true, then destroy and remove the particle from the array
Code edit (2 edits merged)
Please save this source code
User prompt
When clicking in the game, create a new HammerParticle at the click position, and add it to a new particleList array
User prompt
Instead of using delta time, use ticks
User prompt
Convert the delta time to ticks
User prompt
The HammerParticle scaling and fading should be performed in a new update function, and should be performed over time
User prompt
Rename ImpactParticle to HammerParticle
User prompt
Create a new ImpactParticle class that inherits from the ConfigContainer. The class has an asset randomized from hammerParticle1-5, has a slightly random rotation, and grows to 1.5x scale over 100ms, then fades (to 0 opacity) and shrinks (to 0x scale) over 500ms.
User prompt
Rename all trollLeader
User prompt
Add a new LeaderTroll1 class that inherits from the Leader class
User prompt
Add a new Leader class that inherits from ConfigContainer
Code edit (1 edits merged)
Please save this source code
User prompt
Please remove the width and height of the hole Containers, they should only act as points
User prompt
After creating a tableSlice asset, also create a number of empty Containers based on the value of the current TABLE_HOLES index, these should be positioned at the current y values, and evenly centered along the x position with a gap between each of TABLE_HOLE_GAP
Code edit (1 edits merged)
Please save this source code
User prompt
Instead of a forEach iterating through an array of tableSlice assets, use a for-loop with a max bound of TABLE_SLICES, and construct the asset name from the for loop's index
Code edit (2 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -142,9 +142,9 @@
hammer.rotation += PARTICLE_HAMMER_SPIN / PARTICLE_HAMMER_STAGE_1;
} else {
elapsedTicks = 0;
stage++;
- particleList.push(game.addChild(new ImpactParticle({
+ particleList.push(midground.addChild(new ImpactParticle({
x: self.x,
y: self.y
})));
}
@@ -393,12 +393,8 @@
/****
* 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
//==============================================================================
@@ -440,23 +436,27 @@
//==============================================================================
// Global variables
//==============================================================================
;
-var centerTable = game.addChild(new Table({
+var particleList = [];
+;
+var background = game.addChild(new Container());
+var midground = game.addChild(new Container());
+var foreground = game.addChild(new Container());
+var centerTable = background.addChild(new Table({
x: GAME_WIDTH / 2,
y: GAME_HEIGHT / 2 - 500,
width: 2500
}));
-var particleList = [];
;
//==============================================================================
// Game events
//==============================================================================
;
game.on('down', function (obj) {
var event = obj.event;
var pos = event.getLocalPosition(game);
- particleList.push(game.addChild(new HammerParticle({
+ particleList.push(foreground.addChild(new HammerParticle({
x: pos.x,
y: pos.y
})));
});
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.