Code edit (17 edits merged)
Please save this source code
User prompt
add a debugMarker to the game
Code edit (1 edits merged)
Please save this source code
User prompt
separate gamePlaying code in functions
Code edit (1 edits merged)
Please save this source code
Code edit (22 edits merged)
Please save this source code
User prompt
divide globalspeed by when falling
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Don’t Count a point when falling
Code edit (1 edits merged)
Please save this source code
User prompt
Update score text
Code edit (15 edits merged)
Please save this source code
User prompt
Add a text2 at top center for the score
User prompt
Add 1 to score for each hurdle passed
User prompt
In Athlete update() Jumpspeed and gravity should grow with globalSpeed
User prompt
Jumpspeed and gravity should grow with globalSpeed
Code edit (1 edits merged)
Please save this source code
User prompt
In gamePlaying after the first flash on collision , add a second flash when athlete reache the ground ( isOnGround==true)
User prompt
after the first flash on collision , add a second flash when athlete reache s the ground ( isOnGround==true)
User prompt
Add a second flash when isFalling and isOnGround
User prompt
Add an additional one time flash when isFalling and isOnGround
User prompt
Add another one time flash when isFalling and isOnGround
Code edit (1 edits merged)
Please save this source code
User prompt
Reduce jump speed as global speed increases
===================================================================
--- original.js
+++ change.js
@@ -284,17 +284,8 @@
/****
* Game Code
****/
-// Debug Marker
-var debugMarker = LK.getAsset('debugMarker', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 1024,
- // Center of the screen horizontally
- y: 1366 // Center of the screen vertically
-});
-game.addChild(debugMarker);
// Enumeration for game states
/****************************************************************************************** */
/************************************** GLOBAL VARIABLES ********************************** */
/****************************************************************************************** */
@@ -313,15 +304,16 @@
var groundLevel = 2732 - 200; // Ground level set 200px from the bottom
var obstacleSpawnTicker = 0;
var obstacleSpawnRate = 180; // Spawn an obstacle every 2 seconds
var obstacleJustPassed = false;
-var isDebug = true;
var track;
var track2;
var track3;
var scoreTxt;
var globalSpeed = -10; //-10; // Global speed for tracks and obstacles min = -4
var globalSpeedIncreaseStep = 5;
+var isDebug = true;
+var debugMarker;
/****************************************************************************************** */
/************************************** POSTURES ****************************************** */
/****************************************************************************************** */
var idlePosture = {
@@ -410,8 +402,20 @@
athlete.setPosture(idlePosture);
// Set the ground level globally accessible within the game instance
game.groundLevel = groundLevel;
gameState = GAME_STATE.PLAYING;
+ if (isDebug) {
+ // Debug Marker
+ debugMarker = LK.getAsset('debugMarker', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ // Center of the screen horizontally
+ y: 1366 // Center of the screen vertically
+ });
+ game.addChild(debugMarker);
+ debugMarker.y = groundLevel;
+ }
}
function gamePlaying() {
//log("Game playing...");
// Spawn obstacles
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.