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
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
===================================================================
--- original.js
+++ change.js
@@ -504,8 +504,9 @@
/****
* Game Code
****/
+var score = 0; // Global score variable
;
//==============================================================================
// Global constants & settings
//==============================================================================
@@ -539,9 +540,9 @@
var PARTICLE_HAMMER_ASSETS = 5;
var PARTICLE_HAMMER_ROTATION = MATH_QUARTER_PI;
var PARTICLE_HAMMER_SCALE_MAX = 2.0;
// Leader settings
-var LEADER_DURATION = 1 * GAME_TICKS * 1000;
+var LEADER_DURATION = 1 * GAME_TICKS;
var LEADER_SPAWN_MIN = 2 * GAME_TICKS;
var LEADER_SPAWN_VAR = 1 * GAME_TICKS;
var LEADER_SPAWN_FACTOR = 0.95;
var LEADER_SPAWN_TIME = Math.round(0.075 * GAME_TICKS);
@@ -549,13 +550,22 @@
var COUNTDOWN_GAME = 60 * GAME_TICKS;
var TABLE_SLICES = 6;
var TABLE_HOLES = [1, 2, 3, 2, 1, 0];
var TABLE_HOLE_GAP = 778;
+// Messages
+var MESSAGE_INTRO = 'Blue Lizzard Entertainment proudly presents: #####Whac-a-Mo...##########\n... Whac-a-##########Politician? Are we getting sued again?';
+var MESSAGE_WRONG = 'Don\t bonk the Kiwi##########, apparently...';
+var MESSAGE_OUTRO = 'Well that\'s all... Good job! Thanks for playing.';
+var MESSAGE_EXTRA = 'Sneak one that... Good job! Thanks for playing.';
+var MESSAGE_RANDO = [];
+MESSAGE_RANDO.push('Was this a "Bobby-proposal"?');
+MESSAGE_RANDO.push('Oh, we are S###O###O###O### getting sued for this.');
;
//==============================================================================
// Global variables
//==============================================================================
;
+var messageIndex = 0;
var countdown = COUNTDOWN_GAME;
var spawnTime = LEADER_SPAWN_MIN;
var spawnTimer = spawnTime;
var leaders = [LeaderGreat1, LeaderTroll1, LeaderTroll2, LeaderTroll3, LeaderTroll4, LeaderTroll5, LeaderTroll6];
@@ -566,21 +576,29 @@
var midground = game.addChild(new Container());
var foreground = game.addChild(new Container());
var table = background.addChild(new Table({
x: GAME_WIDTH / 2,
- y: GAME_HEIGHT / 2 - 500,
+ y: GAME_HEIGHT / 2 - 600,
width: 2500
}));
;
+var textbox = game.addChild(new Textbox(MESSAGE_INTRO, {
+ x: 100,
+ y: GAME_HEIGHT - 100,
+ width: GAME_WIDTH - 200,
+ height: 200
+}));
var countdownText = LK.gui.top.addChild(new BorderedText(Math.ceil(countdown / GAME_TICKS), {
- x: GAME_WIDTH / 2,
- y: 100,
anchorX: 0.5,
anchorY: 0,
- size: 100,
- fill: '#FFFFFF',
- border: '#000000'
+ size: 200
}));
+// Display the score in the top-right of the screen
+var scoreText = LK.gui.topRight.addChild(new BorderedText(score.toString(), {
+ anchorX: 0.5,
+ anchorY: 0,
+ size: 150
+}));
;
//==============================================================================
// Game events
//==============================================================================
@@ -599,9 +617,9 @@
handleSpawnTimer();
if (--countdown <= 0) {
LK.showGameOver();
}
- countdownText.setText(Math.ceil(countdown / GAME_TICKS).toString());
+ countdownText.setText(Math.ceil(countdown / GAME_TICKS));
for (var i = particleList.length - 1; i >= 0; i--) {
if (particleList[i].update()) {
particleList[i].destroy();
particleList.splice(i, 1);
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.