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
User prompt
I didn't say to remove the previous button!
User prompt
in initMenuState, add two semi-transparent runButtons in the upper half of the screen
Code edit (20 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: difficulty is not defined' in or related to this line: 'self.nextHurdleSpeedX = -1 * Math.min(0, 2 - difficulty) + (-5 + 10 * Math.random() * (1 + 0.5 * (difficulty - 1))); // Level n' Line Number: 216
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: bonusGraphics is not defined' in or related to this line: 'bonusGraphics.visible = false;' Line Number: 502
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: BonusManager is not defined' in or related to this line: 'bonusManager = new BonusManager();' Line Number: 1041
Code edit (4 edits merged)
Please save this source code
User prompt
add a new class Bonus
Code edit (10 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: drone is undefined' in or related to this line: 'drone._update_migrated();' Line Number: 1076
Code edit (2 edits merged)
Please save this source code
User prompt
in DeliveryDrone class, add a bonus1 asset to the class and make it pop from the box when on ground
User prompt
in DeliveryDrone class, add an asset for the bonus that pops up from the box when on ground
Code edit (1 edits merged)
Please save this source code
Code edit (3 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.