User prompt
To ensure that the `presentTypeDisplay` includes the new present type when the level changes, the game logic in the `Game` class should include a call to `setRandomPresentTypeIndex` or a similar method to update the display whenever a new level is started. This would ensure that the present types displayed are always in sync with the current level of the game.
User prompt
Fix Bug: 'TypeError: self.presentTypeDisplay is not a function' in this line: 'self.presentTypeDisplay(presentTypesCount);' Line Number: 573
Code edit (1 edits merged)
Please save this source code
User prompt
when level changes in game code update presentTypeIndex
User prompt
when level changes in game code update presentTypeIndex to reflect current number of present types
User prompt
when the level changes and a new presenttype is added add in game code an update to update presentdisplaytype also
User prompt
Fix Bug: 'Timeout.tick error: this.updatePresentTypesCount is not a function' in this line: 'var presentTypeIndex = Math.floor(Math.random() * this.updatePresentTypesCount());' Line Number: 217
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypesCount is not defined' in this line: 'self.createPresents(presentTypesCount, mainContainer);' Line Number: 542
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypesCount is not defined' in this line: 'var presentTypeIndex = Math.floor(Math.random() * presentTypesCount);' Line Number: 217
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypesCount is not defined' in this line: 'for (var i = 0; i < presentTypesCount; i++) {' Line Number: 209
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypesCount is not defined' in this line: 'for (var i = 0; i < presentTypesCount; i++) {' Line Number: 209
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypesCount is not defined' in this line: 'for (var i = 0; i < presentTypesCount; i++) {' Line Number: 209
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypesCount is not defined' in this line: 'for (var i = 0; i < presentTypesCount; i++) {' Line Number: 209
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypesCount is not defined' in this line: 'for (var i = 0; i < presentTypesCount; i++) {' Line Number: 209
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypesCount is not defined' in this line: 'for (var i = 0; i < presentTypesCount; i++) {' Line Number: 209
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypesCount is not defined' in this line: 'for (var i = 0; i < presentTypesCount; i++) {' Line Number: 209
User prompt
Fix Bug: 'presentTypesCount is not defined' in this line: 'for (var i = 0; i < presentTypesCount; i++) {' Line Number: 209
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypesCount is not defined' in this line: 'for (var i = 0; i < presentTypesCount; i++) {' Line Number: 209
User prompt
when a level changes update presenttypecount in presentTypeDisplay
User prompt
Fix Bug: 'TypeError: self.presentDisplay.refreshPresentTypeDisplay is not a function' in this line: 'self.presentDisplay.refreshPresentTypeDisplay();' Line Number: 562
User prompt
in game add refresh code to refresh presentdisplaytype after a levelchange
User prompt
add in to game code that when a new level the presentdisplaytype is updated according to the level now on
Code edit (1 edits merged)
Please save this source code
User prompt
when level changes update presentTypedisplay to include new present type based upon current level
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypesCount is not defined' in this line: 'self.createPresents(presentTypesCount, mainContainer);' Line Number: 542
===================================================================
--- original.js
+++ change.js
@@ -535,8 +535,9 @@
}
}
};
self.createPresents(presentTypesCount, mainContainer);
+ self.presentDisplay.setRandomPresentTypeIndex();
LK.on('tick', function () {
for (var i = self.presents.length - 1; i >= 0; i--) {
var present = self.presents[i];
present.move();
basic snowflake. white Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
open top of Santa's sack. wrapped presents with ribbons and box, vivid colours, candy canes Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
close up of a Snow covered roof, Winter scene, star lit night sky, brick chimbly on right hand side, Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gift wrapped box, vivid colours. with bow on top Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gift wrapped box, vivid colours. with bow on top Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
stary night sky.dark blue. no land. only sky Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gift wrapped box, vivid colours. with bow on top Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gift wrapped box, vivid colours. with bow on top Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gift wrapped box, vivid colours. with bow on top Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Candy cane, vivid colours. with bow on top Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gift wrapped box, vivid colours. with bow on top Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gift wrapped box, vivid colours. with bow on top Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
old paper scroll, blank with no writing, Single Game Texture. In-Game asset. 2d. transparent Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
rudolf the red nose raindeer Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gift wrapped box, bright colours. with bow on top Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture.
gift wrapped box, bright light colours. with bow on top Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture.
Santa's sleigh with a team of reindeer moving across a star light sky. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.