Code edit (7 edits merged)
Please save this source code
User prompt
after creating all the columns in the firewall, invert the array of children
Code edit (3 edits merged)
Please save this source code
User prompt
add an update function to the firewall which randomly selects 1 column from the columns array and inverts it's scaleX
Code edit (6 edits merged)
Please save this source code
User prompt
firewall columns should begin with a random xflip
Code edit (1 edits merged)
Please save this source code
User prompt
The firewall instance should be created after the camera instance and added to the camera instance instead of game
User prompt
Please fix the bug: 'ReferenceError: firewallColumn is not defined' in or related to this line: 'var column = self.attachAsset('firewallColumn', {' Line Number: 50
User prompt
Add a new "Firewall" class inheriting from ConfigContainer. It should consist of 1 firewallBase asset (with an anchor of 0.5,1.0) and multiple firewallColumn assets stacked on top of each other (also with anchors of 0.5,1.0). The number of firewallColumn assets should be configurable
Code edit (1 edits merged)
Please save this source code
User prompt
give the camera an update function which sets the moon's scale to the zoom
User prompt
create an empty "camera" class that contains only "var zoom = 1.0;" and initialize an instance after the moon
User prompt
Create a moon asset in the middle of the screen
User prompt
Remove all game logic and classes
Initial prompt
Swing Frog
===================================================================
--- original.js
+++ change.js
@@ -24,23 +24,24 @@
return self;
});
var Firewall = ConfigContainer.expand(function (config) {
var self = ConfigContainer.call(this, config);
+ var columns = [];
+ var columnCount = config.columns || 0;
var firewallBase = self.attachAsset('firewallBase', {
anchorX: 0.5,
anchorY: 1.0
});
- var columns = config.columns || 0;
- self.columns = [];
- for (var i = 0; i < columns; i++) {
+ columns.push(firewallBase);
+ for (var i = 0; i < columnCount; i++) {
var firewallColumn = LK.getAsset('firewallColumn', {});
var column = self.attachAsset('firewallColumn', {
anchorX: 0.5,
anchorY: 1.0,
y: -firewallBase.height * FIREWALL_OFFSET - i * firewallColumn.height * FIREWALL_OFFSET,
flipX: Math.random() > 0.5 ? 1 : 0
});
- self.columns.push(column);
+ columns.push(column);
}
return self;
});
var Camera = ConfigContainer.expand(function (config) {
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