Code edit (1 edits merged)
Please save this source code
User prompt
ensure that there is alwas a objdash generated before there is an objspikey
Code edit (10 edits merged)
Please save this source code
User prompt
ensure at least one objjump is generated when the avoid event begins
Code edit (5 edits merged)
Please save this source code
User prompt
add a console.log when the objevent is being destroyed
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: fase is not defined' in or related to this line: 'var objSpikeyIncrease1 = fase;' Line Number: 1324
Code edit (1 edits merged)
Please save this source code
User prompt
allow to have 2 objspikey to be on the screen at the same time
Code edit (3 edits merged)
Please save this source code
User prompt
ensure that function destroyspikey destroys all instances of objspikey
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: spikeys.length is not a function' in or related to this line: 'for (var i = 0; i < spikeys.length(); i++) {' Line Number: 1287
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: spikeys.length is not a function' in or related to this line: 'for (var i = 0; i < spikeys.length(); i++) {' Line Number: 1287
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
ad a second objspikey at traveleddistance 1000 and a third objspikey once traveleddistance has reached 3000
Code edit (9 edits merged)
Please save this source code
User prompt
ensure objNightFilter is above the city when being added to the game
Code edit (6 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'destroy')' in or related to this line: 'objNightFilter.destroy();' Line Number: 2030
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -1206,8 +1206,24 @@
return obstacle instanceof ObjSPIKEY;
}).length >= 1) {
return;
}
+ // Add a third objspikey at traveleddistance 3000
+ if (Math.floor(distanceTraveled) === 3000) {
+ var objSPIKEY3 = new ObjSPIKEY();
+ objSPIKEY3.x = game.width;
+ objSPIKEY3.y = hero.y;
+ obstacles.push(objSPIKEY3);
+ game.addChild(objSPIKEY3);
+ }
+ // Add a second objspikey at traveleddistance 1000
+ if (Math.floor(distanceTraveled) === 1000) {
+ var objSPIKEY2 = new ObjSPIKEY();
+ objSPIKEY2.x = game.width;
+ objSPIKEY2.y = hero.y;
+ obstacles.push(objSPIKEY2);
+ game.addChild(objSPIKEY2);
+ }
LK.setTimeout(function () {
var objSPIKEY = new ObjSPIKEY();
objSPIKEY.x = game.width;
var spawnChance = Math.random();
@@ -1311,9 +1327,9 @@
}
// Function to destroy all instances of ObjGO, ObjRALLY, and ObjJUMP
function destroyAllObjs() {
for (var i = obstacles.length - 1; i >= 0; i--) {
- if (obstacles[i] instanceof ObjGO || obstacles[i] instanceof ObjRALLY || obstacles[i] instanceof ObjJUMP || obstacles[i] instanceof ObjACCELERATE) {
+ if (obstacles[i] instanceof ObjGO || obstacles[i] instanceof ObjRALLY || obstacles[i] instanceof ObjJUMP || obstacles[i] instanceof ObjACCELERATE || obstacles[i] instanceof ObjSPIKEY) {
if (obstacles[i]) {
var explosion = new ParticleExplosion(obstacles[i].x, obstacles[i].y);
game.addChild(explosion);
obstacles[i].destroy();
@@ -1647,12 +1663,21 @@
obstacles[i].destroy();
obstacles.splice(i, 1);
handleCollisionWithObj();
// Ensure event text is displayed
- var events = distanceTraveled <= 200 ? ['Avoid', 'Collect'] : ['Catch', 'Survive'];
- //set the random event
- randomEvent = "";
- //randomEvent = events[Math.floor(Math.random() * events.length)];
+ var eventsNight = ['Catch', 'Survive'];
+ var eventsDay = ['Avoid', 'Collect'];
+ //get a random number between 0 and 1 to get the index randomly selected.
+ var indexEvent = Math.round(Math.random());
+ // set the random events selection depending on the background that is present.
+ //night we want a random between catcha and survive.
+ if (objNightFilter) {
+ randomEvent = eventsNight[indexEvent];
+ }
+ //if we are during the day we want to choose between avoid and collect
+ else {
+ randomEvent = eventsDay[indexEvent];
+ }
//set the event text once an event type has been selected.
eventTxt.setText('Event: ' + randomEvent);
console.log("Random event selected:", randomEvent);
if (randomEvent === 'Collect') {
@@ -1974,25 +1999,21 @@
objNightFilter.destroy();
}
} else if (Math.floor(distanceTraveled) % 100 == 0 && distanceTraveled > 100) {
lastNightFilterDistance = Math.floor(distanceTraveled / 100);
- console.log("last night filter distance" + lastNightFilterDistance % 2);
//if the number is not even, add the night filter
if (lastNightFilterDistance % 2 != 0 && !objNightFilter) {
- console.log("initiating the night filter");
objNightFilter = LK.getAsset('objnightfilter', {
anchorX: 0.5,
anchorY: 0.5
});
objNightFilter.alpha = 0.6; // Set transparency to 80%
objNightFilter.x = game.width / 2;
objNightFilter.y = game.height / 2;
- console.log("adding asset to the game");
game.addChildAt(objNightFilter, game.getChildIndex(parallaxCity) + 1); // Ensure objNightFilter is above objcity
}
//else it means it is even, we remove the nightfilter
else if (lastNightFilterDistance % 2 == 0 && objNightFilter) {
- console.log("destroying the night filter");
objNightFilter.destroy();
}
}
//adjusting the distance that is being traveled.
2d cyberpunk particle of a dash ability. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
blue jetfuel. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art speech bubble that says "?" neon color. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art speech bubble that says "Go" neon color. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art speech bubble that says "Ok" neon color.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a bubble a wing inside in neon color.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art bubble with 2 fast foward arrows neon color. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Gray Cyber neon lit logo of the word Rush. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
side profile of a flying car in the art style of a 16 bit neon cyberpunk game. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro cyberpunk datadisk in neon colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro cyberpunk pole flag in neon colors with the words 'events' on it.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "Hold to Dash" in neon colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "Tap to Move" in neon colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "catch" with an flying drone symbol in neon colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro flying drone in neon colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
retro sign that says "Survive" with an face symbol in neon colors... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
neon colored cyberpunk round electricity. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
SynthwaveMusic
Music
snd_letsgo
Sound effect
snd_announcer
Sound effect
snd_powerup
Sound effect
snd_dataacquire
Sound effect
snd_walkie
Sound effect
snd_nice
Sound effect
snd_carhonk
Sound effect
snd_enemy
Sound effect
snd_sphere
Sound effect
snd_windup
Sound effect
snd_spikey
Sound effect
snd_drone
Sound effect