Code edit (1 edits merged)
Please save this source code
User prompt
add a text that says "Collect the data!" once the randomEvent=='Collect'
Code edit (11 edits merged)
Please save this source code
User prompt
movement of objdata should be hovering at their instanciated locations
User prompt
ensure that objdata object are static once generated
User prompt
make sure that the objData is instanciated in the layer above the background
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'stringify')' in or related to this line: 'console.log("eventtxt obj" + JSON.stringify(eventTxt));' Line Number: 807
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'stringify')' in or related to this line: 'console.log("eventtxt obj" + JSON.stringify(eventTxt));' Line Number: 807
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'stringify')' in or related to this line: 'console.log("eventtxt obj" + JSON.stringify(eventTxt));' Line Number: 806
Code edit (1 edits merged)
Please save this source code
User prompt
fix it
User prompt
remove the spawn over three seconds
User prompt
objdata never spawns any idea why
User prompt
don't put objevents in the obstacles array
User prompt
make sure the function generateobjdata is called when the event collect is triggered
User prompt
make sure the function generateobjdata is correctly updated
User prompt
objdata should be on the left half not right half
User prompt
make sure objdata are being instantiated on the playspace when the event is collect
User prompt
the objdata are not instantiated correctly fix it
User prompt
i need to debug the collect event, i need it to be triggered 100% of the time ttemporarily
User prompt
temporarily make sure collect event is triggered
User prompt
can you temporarily make sure that its the collect event getting triggered 100% of the time
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'includes')' in or related to this line: 'if (eventTxt && eventTxt.text.includes('Collect')) {' Line Number: 805
User prompt
Please fix the bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'includes')' in or related to this line: 'if (eventTxt && eventTxt.text.includes('Survive')) {' Line Number: 1279
===================================================================
--- original.js
+++ change.js
@@ -824,45 +824,21 @@
isEventOngoing = true;
}
}
function generateObjData() {
- if (randomEvent == 'Collect') {
- // Add text that says "Collect the data!"
- var collectText = new Text2('Collect the data!', {
- size: 100,
- fill: "#ffffff",
- stroke: "#000000",
- strokeThickness: 5,
- fontWeight: 'bolder'
- });
- collectText.anchor.set(0.5, 0);
- collectText.x = game.width / 2;
- collectText.y = 100;
- game.addChild(collectText);
- // Fade out and destroy the text after 3 seconds
- LK.setTimeout(function () {
- var fadeOutInterval = LK.setInterval(function () {
- collectText.alpha -= 0.05;
- if (collectText.alpha <= 0) {
- LK.clearInterval(fadeOutInterval);
- collectText.destroy();
- }
- }, 60);
- }, 3000);
- for (var i = 0; i < 10; i++) {
- (function (index) {
- LK.setTimeout(function () {
- var objData = new ObjData();
- objData.x = Math.random() * (game.width / 2); // Ensure ObjData objects are instantiated on the left half of the screen
- var minY = 300;
- var maxY = game.height - 300; // Ensure objData spawns within the vertical boundaries
- objData.y = minY + Math.random() * (maxY - minY);
- objData.y = minY + Math.random() * (maxY - minY);
- objDataArray.push(objData);
- game.addChild(objData); // Ensure ObjData objects are instantiated on the correct layer
- }, index * 300); // Spread instantiation over 3 seconds
- })(i);
- }
+ for (var i = 0; i < 10; i++) {
+ (function (index) {
+ LK.setTimeout(function () {
+ var objData = new ObjData();
+ objData.x = Math.random() * (game.width / 2); // Ensure ObjData objects are instantiated on the left half of the screen
+ var minY = 300;
+ var maxY = game.height - 300; // Ensure objData spawns within the vertical boundaries
+ objData.y = minY + Math.random() * (maxY - minY);
+ objData.y = minY + Math.random() * (maxY - minY);
+ objDataArray.push(objData);
+ game.addChild(objData); // Ensure ObjData objects are instantiated on the correct layer
+ }, index * 300); // Spread instantiation over 3 seconds
+ })(i);
}
}
// Function to destroy all instances of ObjGO, ObjRALLY, and ObjJUMP
function destroyAllObjs() {
@@ -1147,8 +1123,30 @@
//set the event text once an event type has been selected.
eventTxt.setText('Event: ' + randomEvent);
console.log("Random event selected:", randomEvent);
if (randomEvent === 'Collect') {
+ // Add text that says "Collect the data!"
+ var collectText = new Text2('Collect the data!', {
+ size: 100,
+ fill: "#ffffff",
+ stroke: "#000000",
+ strokeThickness: 5,
+ fontWeight: 'bolder'
+ });
+ collectText.anchor.set(0.5, 0);
+ collectText.x = game.width / 2;
+ collectText.y = 100;
+ game.addChild(collectText);
+ // Fade out and destroy the text after 3 seconds
+ LK.setTimeout(function () {
+ var fadeOutInterval = LK.setInterval(function () {
+ collectText.alpha -= 0.05;
+ if (collectText.alpha <= 0) {
+ LK.clearInterval(fadeOutInterval);
+ collectText.destroy();
+ }
+ }, 60);
+ }, 3000);
generateObjData();
} else if (randomEvent === 'Avoid') {
//behaviour for the avoid event
} else if (randomEvent === 'Survive') {
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