Code edit (4 edits merged)
Please save this source code
User prompt
change the interface text colours to black
Code edit (8 edits merged)
Please save this source code
User prompt
Instead of adding the gameInterface to the game, add it to the middle GUI element
User prompt
Add an Interface class that contains a score (displaying only the score value) and a multiplier below (displayed as the numerical rounded to 1 decimal place, and an "x", eg: "1.0x").
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: soundFireCrackling is undefined' in or related to this line: 'soundFireCrackling.volume = volume;' Line Number: 438
User prompt
Please fix the bug: 'ReferenceError: volume is not defined' in or related to this line: 'soundFireCrackling.volume = volume;' Line Number: 438
Code edit (1 edits merged)
Please save this source code
User prompt
Add a slightly transparent black tinted shapeBox to the firewall. It should have a width of 2 * GAME_WIDTH, a height of 2 * GAME_HEIGHT and an anchor of 1,1
Code edit (2 edits merged)
Please save this source code
User prompt
In the game.update function add an empty if statement, checking if the tick counter is at 10s
Code edit (2 edits merged)
Please save this source code
User prompt
In the game.update method, play the backgroundAmbient sound every 10s
Code edit (1 edits merged)
Please save this source code
User prompt
backgroundAmbient should loop
User prompt
loop the backgroundAmbient sound on game start
Code edit (3 edits merged)
Please save this source code
User prompt
When calling game over also play the frogDeath sound effect
User prompt
When calling game over, also flash the screen red
Code edit (9 edits merged)
Please save this source code
User prompt
add a game.update function that checks if the frogs y position is greater than 0 or it's x position is less than the firewall's x position and call game over
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -38,8 +38,36 @@
anchorY: 0.5
});
return self;
});
+var Interface = ConfigContainer.expand(function (config) {
+ var self = ConfigContainer.call(this, config);
+ // Score Text
+ var scoreText = new Text2('0', {
+ size: 100,
+ fill: "#ffffff"
+ });
+ scoreText.anchor.set(0.5, 0);
+ scoreText.y = -50;
+ self.addChild(scoreText);
+ // Multiplier Text
+ var multiplierText = new Text2('1.0x', {
+ size: 50,
+ fill: "#ffffff"
+ });
+ multiplierText.anchor.set(0.5, 0);
+ multiplierText.y = 50;
+ self.addChild(multiplierText);
+ // Update score
+ self.updateScore = function (score) {
+ scoreText.setText(score);
+ };
+ // Update multiplier
+ self.updateMultiplier = function (multiplier) {
+ multiplierText.setText(multiplier.toFixed(1) + 'x');
+ };
+ return self;
+});
var Hook = ConfigContainer.expand(function (config) {
var self = ConfigContainer.call(this, config);
var highlightContainer = self.addChild(new Container());
var hook = self.attachAsset('hook', {
@@ -259,38 +287,8 @@
self.scale.set(self.zoom);
moon.scale.set(1 - MOON_SCALING + MOON_SCALING * self.zoom);
};
});
-var Interface = Container.expand(function () {
- var self = Container.call(this);
- // Score Text
- var scoreText = new Text2('0', {
- size: 100,
- fill: "#ffffff"
- });
- scoreText.anchor.set(0.5, 0);
- scoreText.x = GAME_WIDTH / 2;
- scoreText.y = 50;
- self.addChild(scoreText);
- // Multiplier Text
- var multiplierText = new Text2('1.0x', {
- size: 50,
- fill: "#ffffff"
- });
- multiplierText.anchor.set(0.5, 0);
- multiplierText.x = GAME_WIDTH / 2;
- multiplierText.y = 150;
- self.addChild(multiplierText);
- // Update score
- self.updateScore = function (score) {
- scoreText.setText(score);
- };
- // Update multiplier
- self.updateMultiplier = function (multiplier) {
- multiplierText.setText(multiplier.toFixed(1) + 'x');
- };
- return self;
-});
/****
* Initialize Game
****/
fireCrackle
Sound effect
frogTongue
Sound effect
frogDeath
Sound effect
lilypadBounce
Sound effect
noTarget
Sound effect
backgroundAmbient
Sound effect
fireCrackling1
Sound effect
fireCrackling2
Sound effect
fireCrackling3
Sound effect
fireCrackling4
Sound effect
frogBounce
Sound effect
pickupCaught
Sound effect