User prompt
make red flash longer when killed
Code edit (1 edits merged)
Please save this source code
User prompt
also play killed_1 after accident_1
User prompt
play accident_1 when killed
User prompt
when setting killer[2] active, play ambulance_1
User prompt
when setting killer[1] active, play police_1
User prompt
when setting killer[0] active, play car_1
Code edit (4 edits merged)
Please save this source code
User prompt
play levelWin_1 when wining a level
User prompt
add a function playHit() thay randmoly plays hit_1, hit_2 or hit_3
User prompt
play hit_1 when hitting an obstacle
User prompt
stop bgMusic when player is killed
User prompt
play coin_1 when player collects a coin
User prompt
play bgMusic repeatedly after start button press
User prompt
Please fix the bug: 'ReferenceError: currentTime is not defined' in or related to this line: 'self.lastKillerUpdate = currentTime;' Line Number: 425
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'resetKillers')' in or related to this line: 'killerManager.resetKillers();' Line Number: 1452
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'resetKillers')' in or related to this line: 'killerManager.resetKillers();' Line Number: 1451
Code edit (1 edits merged)
Please save this source code
User prompt
create a KillerManager class to organize killers to activate killers[0] after killerDelay, then killers[1] after killerDelay, then killers[2] after killerDelay, then killers[0] after killerDelay, ....
User prompt
organize killers to activate killers[0] after killerDelay, then killers[1] after killerDelay, then killers[2] after killerDelay, then killers[0] after killerDelay, ....
User prompt
create 3 different killers instead of 1
User prompt
add an index to Killer constructor that allow asset selection
User prompt
create a global array for killers
Code edit (3 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -99,9 +99,9 @@
/*
if (coinsCollected % nextCoinTypeThreshold === 0 && currentSpeed < maxSpeed) {
currentSpeed += 3; // Increase speed by 3
}
- */
+ */
}
};
self.reset = function () {
self.y = startY;
@@ -295,20 +295,11 @@
self.update = function () {
if (!isPlaying) {
return;
}
- /*
- var currentTime = Date.now();
if (self.inactive) {
- if (currentTime - self.inactiveStartTime >= killerDelay) {
- self.inactive = false;
- }
return;
}
- */
- if (self.inactive) {
- return;
- }
if (!isKilled && player && self.y > 2500 && self.y < 2732 && player.shadow.intersects(self)) {
isKilled = true;
player.visible = false;
LK.effects.flashScreen(0xff0000, 2000);
@@ -365,9 +356,10 @@
self.killers.push(killer);
};
self.update = function () {
var currentTime = Date.now();
- if (currentTime - self.lastKillerUpdate >= self.killerDelay) {
+ var currentDelay = currentTime - self.lastKillerUpdate;
+ if (currentDelay >= self.killerDelay) {
self.killers[self.currentKillerIndex].inactive = false;
self.currentKillerIndex = (self.currentKillerIndex + 1) % self.killers.length;
self.lastKillerUpdate = currentTime;
}
@@ -1509,5 +1501,5 @@
isPlaying = false;
}
gameInitialize();
// DEVLOG:
-// Delay isPlaying when start button pressed
\ No newline at end of file
+// Make 3 killers and alternate between them
\ No newline at end of file
Directly overhead, plumb view of a beggar heading top (we see his back).. Zenith view, directly overhead, plumb view. NOT PERSPECTIVE! Fantasy theme. Pixel art
a traffic cone. video game sprite
face view of a big start button in the shape of a dollar bill. video game style
a tree. video game style
a black garbage bag. video game style
Dollar bill. Perspective. video game sprite
perspective of a simple snake rolled up on itself.. video game sprite
Ball of dry desert bushes. video game sprite
tractor. high definition video game sprite
street ad billboard with 1 or 2 posts with "Get rich!" on it. high definition video game sprite
a dog sleeping on a street. video game sprite
desert bush. video game sprite
profile view of an empty motorcycle helmet. black with a white vertical central band and another thiner orange band on the center. NOT PERSPECTIVE!. Pixel art high definition
simple red and white magnet. video game style
gold sign with a "X" and a "2". video game style
bgMusic
Music
coin_1
Sound effect
hit_1
Sound effect
hit_2
Sound effect
hit_3
Sound effect
levelWin_1
Sound effect
car_1
Sound effect
police_1
Sound effect
ambulance_1
Sound effect
accident_1
Sound effect
killed_1
Sound effect
jump_1
Sound effect
rip_1
Sound effect
bonus_take
Sound effect
bonus_approaching
Sound effect