Code edit (3 edits merged)
Please save this source code
User prompt
Create a new StartButton class which extends the ConfigContainer class and contains an asset with id of startButton, and create an instance in the middle of the screen
User prompt
Create a new StartButton class which contains an asset with id of startButton, and create an instance in the middle of the screen
Code edit (1 edits merged)
Please save this source code
User prompt
Add a global score variable and display the score in the top-right of the screen
Code edit (7 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: foreground is undefined' in or related to this line: 'var countdownText = foreground.addChild(new BorderedText(Math.ceil(countdown / GAME_TICKS).toString(), {' Line Number: 542
User prompt
Add a BorderedText to the top center of the screen which will show the remaining time. In the on tick event, update the text to show the remaining seconds (rounded up) of the countdown
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: leaderAsset is undefined' in or related to this line: 'var borderedShape = self.attachAsset('shapeRectangle', {' Line Number: 139
User prompt
Add a borderedShape of shapeRect to the Leader class after the leaderAsset has been created. It should have a black fill and white border
Code edit (3 edits merged)
Please save this source code
User prompt
The update function first increases the y position (from 0, to the height of the leaderAsset) over LEADER_SPAWN_TIME duration, then decrements the countdownTime until it reaches zero, then decreases the y position (until 0) over LEADER_SPAWN_TIME, then returns true.
Code edit (1 edits merged)
Please save this source code
User prompt
Similarly to the particleList, iterate over the leaderList in the tick event
User prompt
Add to the Leader class a countdownTime variable (initially set to LEADER_DURATION) and an empty update function.
Code edit (1 edits merged)
Please save this source code
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
===================================================================
--- original.js
+++ change.js
@@ -50,9 +50,8 @@
return self;
});
var Table = ConfigContainer.expand(function (config) {
var self = ConfigContainer.call(this, config);
- config = config || {};
;
var currentY = 0;
var spawnPoints = [];
var indices = [];
@@ -100,13 +99,14 @@
return self;
});
var StartButton = ConfigContainer.expand(function (config) {
var self = ConfigContainer.call(this, config);
- config = config || {};
+ ;
var startButtonAsset = self.attachAsset('startButton', {
anchorX: 0.5,
anchorY: 0.5
});
+ ;
return self;
});
// Create an instance of StartButton in the middle of the screen
var Leader = ConfigContainer.expand(function (imageId, config) {
@@ -514,14 +514,8 @@
/****
* Game Code
****/
-// Create an instance of StartButton in the middle of the screen
-var startButton = game.addChild(new StartButton({
- x: GAME_WIDTH / 2,
- y: GAME_HEIGHT / 2
-}));
-var score = 0; // Global score variable
;
//==============================================================================
// Global constants & settings
//==============================================================================
@@ -579,8 +573,9 @@
//==============================================================================
// Global variables
//==============================================================================
;
+var score = 0;
var messageIndex = 0;
var countdown = COUNTDOWN_GAME;
var spawnTime = LEADER_SPAWN_MIN;
var spawnTimer = spawnTime;
@@ -595,8 +590,12 @@
x: GAME_WIDTH / 2,
y: GAME_HEIGHT / 2 - 600,
width: 2500
}));
+var startButton = foreground.addChild(new StartButton({
+ x: GAME_WIDTH / 2,
+ y: GAME_HEIGHT / 2
+}));
;
var textbox = game.addChild(new Textbox(MESSAGE_INTRO, {
x: 100,
y: GAME_HEIGHT - 100,
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.