Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: jumpButtonHelpText is undefined' in or related to this line: 'jumpButtonHelpText.visible = true;' Line Number: 1686
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
implement setRoundColors use a random color for the tint except the 1st color '0x1188FF' which is fixed for the player (line 0)
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: athlete is undefined' in or related to this line: 'usedColors.push(opponents[i] ? opponents[i].tint : athlete.tint);' Line Number: 1624
Code edit (3 edits merged)
Please save this source code
User prompt
in getRunnerColor, ensure that runners don't get the same color
Code edit (1 edits merged)
Please save this source code
User prompt
in Athlete class, use a random color for the tint except the 1st color '0x1188FF' which is fixed for the player (line 0)
User prompt
add more unique colors to the colorsArray
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: 'TypeError: LK.gameover is not a function' in or related to this line: 'LK.gameover();' Line Number: 1008
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (11 edits merged)
Please save this source code
User prompt
in gamePlayingDown when "// Make the athlete run" animate the button width and height to simulate a button press
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
add a 'down' handler for runbutton
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -290,9 +290,9 @@
self.justTookBonus = false;
self.jumpSpeed = self.jumpSpeedDefault;
self.speedBeforeBonus = 0;
self.nbJumps = 0;
- globalSpeedPerLine[self.lineIndex] = globalBaseSpeed;
+ globalSpeedPerLine[self.lineIndex] = globalBaseSpeed * speedGauge;
bonusManager.endBonus();
}
}
self.speedY = self.jumpSpeed;
@@ -841,15 +841,18 @@
var droneEnrtyObstacleNumber = 5;
var droneStaySeconds = 3;
var globalBaseSpeed = -20 - 10 * difficultyLevel;
var globalSpeedPerLine = []; // Global speed for tracks and obstacles default -10 / min = -4
+var speedGauge = 0;
var raceFinishTime = 0;
var colorsArray = [0x1188FF, 0xFF0000, 0x00FF00, 0xFFFF00, 0xFF00FF, 0x00FFFF, 0xFFFFFF, 0xFF8811];
var isDebug = true;
var debugMarker;
// UI
var startText;
var startButton;
+var runButton;
+var jumpButton;
/****************************************************************************************** */
/************************************** POSTURES ****************************************** */
/****************************************************************************************** */
var idlePosture = {
@@ -955,8 +958,12 @@
log("gameMenuDown...");
cleanMenuState();
initHurdlesStartingState();
}
+function hurdlesStartingPlayingDown() {
+ cleanHurdlesStartingState();
+ initPlayingState();
+}
function gamePlayingDown() {
log("gamePlayingDown ...");
if (athlete.isRunning && !finishLine.isCut) {
// Make the athlete jump
@@ -969,12 +976,8 @@
initMenuState();
}
}
}
-function hurdlesStartingPlayingDown() {
- cleanHurdlesStartingState();
- initPlayingState();
-}
/****************************************************************************************** */
/************************************* AI FUNCTIONS *************************************** */
/****************************************************************************************** */
/****************************************************************************************** */
@@ -1081,26 +1084,8 @@
startText.anchor.set(0.5, 0.5); // Center the text horizontally and vertically
startText.x = 2048 / 2; // Center horizontally
startText.y = 2732 / 2; // Center vertically
game.addChild(startText);
- var runButton = LK.getAsset('runButton', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 2048 / 4,
- y: 2732 / 4,
- alpha: 0.75
- });
- game.addChild(runButton);
- // Add second semi-transparent runButton in the upper half of the screen
- var jumpButton = LK.getAsset('runButton', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 2048 * 3 / 4,
- y: 2732 / 4,
- alpha: 0.75,
- rotation: Math.PI
- });
- game.addChild(jumpButton);
// TEMP DEBUG TEST BLOCKER
//var blocker = new Blocker(-1024, groundLevel - 200 - 475 * 1);
//game.addChild(blocker);
/*
@@ -1152,9 +1137,9 @@
log("initHurdlesStartingState...");
// Initialize ground levels & speeds
for (var line = 0; line < numberOfLines; line++) {
linesGroundLevels[line] = groundLevel - 200 - 220 * line;
- globalSpeedPerLine[line] = globalBaseSpeed;
+ globalSpeedPerLine[line] = globalBaseSpeed * (line ? 1.0 : speedGauge);
}
// Spawn obstacles
spawnObstacles();
// Add starting blocks to each athlete's starting position
@@ -1175,8 +1160,33 @@
athlete.restore();
athlete.isRunning = false;
athlete.setPosture(startingBlockPosture);
athlete.y += 150;
+ runButton = LK.getAsset('runButton', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 2048 / 4,
+ y: 2732 / 3,
+ alpha: 0.7,
+ tint: 0xcccccc
+ });
+ runButton.down = function (x, y, obj) {
+ if (gameState === GAME_STATE.STARTING) {
+ hurdlesStartingPlayingDown();
+ }
+ };
+ game.addChild(runButton);
+ // Add second semi-transparent runButton in the upper half of the screen
+ jumpButton = LK.getAsset('runButton', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 2048 * 3 / 4,
+ y: 2732 / 3,
+ alpha: 0.7,
+ tint: 0xcccccc,
+ rotation: -1 * Math.PI / 2
+ });
+ game.addChild(jumpButton);
gameState = GAME_STATE.STARTING;
}
function cleanHurdlesStartingState() {
for (var i = numberOfOpponents - 1; i >= 0; i--) {
@@ -1508,9 +1518,9 @@
LK.effects.flashScreen(0xff0000, 500); // Flash screen red for half a second
athlete.hasFlashedGround = true;
globalSpeedPerLine[0] = 0;
LK.setTimeout(function () {
- globalSpeedPerLine[0] = globalBaseSpeed;
+ globalSpeedPerLine[0] = globalBaseSpeed * speedGauge;
globalSlowDownAfterJump = false;
athlete.restore();
}, 1000); // Delay game over to allow fall animation to be seen
}
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.