Code edit (12 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: self.bonusIcon is null' in or related to this line: 'self.bonusIcon.destroy();' Line Number: 269
Code edit (4 edits merged)
Please save this source code
User prompt
play bonus_approaching when bonus manager activate a bonus
User prompt
play bonus_take when taking a bonus
Code edit (1 edits merged)
Please save this source code
User prompt
in BOnus update, make bonusHalo rotate sequencially
===================================================================
--- original.js
+++ change.js
@@ -113,9 +113,12 @@
});
var BonusManager = Container.expand(function () {
var self = Container.call(this);
self.bonuses = [];
+ self.bonusIcon = null;
+ self.bonusIcon = null;
self.currentBonusIndex = 0;
+ self.bonusIcon = null;
self.currentActiveBonus = 0;
self.lastBonusUpdate = 0;
self.bonusDelay = 16000; // Delay in milliseconds before updating bonus
self.addBonus = function (bonus) {
@@ -137,14 +140,15 @@
LK.gui.top.addChild(self.bonusIcon);
}
} else if (self.bonusIcon) {
self.bonusIcon.visible = false;
+ self.bonusIcon = null;
}
var currentTime = Date.now();
var currentDelay = currentTime - self.lastBonusUpdate;
if (currentDelay >= self.bonusDelay) {
LK.getSound('bonus_approaching').play();
- self.currentBonusIndex = (self.currentBonusIndex + 1) % self.bonuses.length;
+ self.currentBonusIndex = 0; // TEMP DEBUG (self.currentBonusIndex + 1) % self.bonuses.length;
self.bonuses[self.currentBonusIndex].inactive = false;
self.lastBonusUpdate = currentTime;
}
};
@@ -185,10 +189,14 @@
}, baseBonusDelay - 3000);
};
self.stopBonus = function () {
self.currentActiveBonus = 0;
- LK.gui.top.removeChild(self.bonusIcon);
- self.bonusIcon.destroy();
+ if (self.bonusIcon) {
+ LK.gui.top.removeChild(self.bonusIcon);
+ }
+ if (self.bonusIcon) {
+ self.bonusIcon.destroy();
+ }
self.bonusIcon = null;
self.lastBonusUpdate = Date.now();
};
});
@@ -978,9 +986,9 @@
self.helmet.visible = bonusManager.currentActiveBonus == 1;
if (self.helmet.visible) {
self.helmet.scale.x *= -1;
self.helmet.x *= -1;
- self.helmet.y = currentLevel == 2 ? 20 : 0;
+ self.helmet.y = currentLevel == 2 ? -190 : -210;
}
}
}
};
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