Code edit (1 edits merged)
Please save this source code
User prompt
in menuHandling use ticks instead of setInterval
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: game.getChildByName is not a function' in or related to this line: 'var drone = game.getChildByName('drone');' Line Number: 925
User prompt
in menuHandling, alternate visibility of the drones
Code edit (2 edits merged)
Please save this source code
User prompt
in initMenuState , use drone class
Code edit (6 edits merged)
Please save this source code
User prompt
create a new Drone class
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
in checkForCollisions, the setTimeout uses the iterator line, this can cause unwanted behaviour, secrure this part of the code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: opponents[(line - 1)] is undefined' in or related to this line: 'opponents[line - 1].isRunning = true;' Line Number: 1217
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: blocker is not defined' in or related to this line: 'if (blocker) {' Line Number: 1111
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: opponents[(line - 1)] is undefined' in or related to this line: 'opponents[line - 1].isRunning = true;' Line Number: 1210
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: opponents[(line - 1)] is undefined' in or related to this line: 'log("Line " + line + " : opponent " + opponents[line - 1].lineIndex + " Restore after block");' Line Number: 1207
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: opponents[(line - 1)] is undefined' in or related to this line: 'opponents[line - 1].isRunning = true;' Line Number: 1203
Code edit (17 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: opponent is not defined' in or related to this line: 'opponent.restore();' Line Number: 1202
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -405,8 +405,23 @@
self.speedX = globalSpeedPerLine[0];
self.x += self.speedX;
};
});
+var Drone = Container.expand(function () {
+ var self = Container.call(this);
+ self.droneGraphics = self.attachAsset('drone', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speedX = 5;
+ self._update_migrated = function () {
+ self.x += self.speedX;
+ // Reverse direction at screen edges
+ if (self.x > 2048 || self.x < 0) {
+ self.speedX *= -1;
+ }
+ };
+});
/****************************************************************************************** */
/************************************** FINISH LINE CLASS ************************************ */
/****************************************************************************************** */
var FinishLine = Container.expand(function () {
@@ -928,12 +943,12 @@
// PLAYING HURDLES
function initPlayingState() {
scoreTxt = new Text2("0/" + numberOfObstacles.toString(), {
size: 100,
- fill: "#ffffff" // White color for better visibility
+ fill: "#000000" // White color for better visibility
});
//scoreTxt.anchor.set(1.1, 0.15); // Center the score text horizontally
- scoreTxt.anchor.set(0.5, 0.5); // Center the score text horizontally
+ scoreTxt.anchor.set(0.25, 0); // Center the score text horizontally
LK.gui.top.addChild(scoreTxt); // Add the score text to the GUI overlay at the top center
currentFinishPosition = 1;
// Remove starting blocks offset
for (var i = numberOfOpponents - 1; i >= 0; i--) {
Elongated elipse with black top half and white bottom half.
full close and front view of empty stands. retro gaming style
delete
delete
Basquettes à ressort futuriste. vue de profile. Retro gaming style
a blue iron man style armor flying. Retro gaming style
a blue iron man style armor flying horizontally. Retro gaming style
round button with a big "up" arrow icon and a small line under it. UI
A big black horizontal arrow pointing left with centred text 'YOU' in capital letters, painted on an orange floor.. horizontal and pointing left
remove
gold athletics medal with ribbon. retro gaming style
a black oval with a crying smiley face.