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
User prompt
when level changes update presentTypedisplay to include new present type based upon level
User prompt
when level changes and new present type added update presenttype to display new type added
User prompt
if a new present type is added when level changes update currentdisplaytype to include new present type
User prompt
add routine that runs at start of game to blank namedisplay before restarting it
User prompt
add routine that runs at start of game to blank out displayname
User prompt
add a click event to the popuptext box to close it
Code edit (8 edits merged)
Please save this source code
User prompt
in game class add a delay before creatpresent of 5 seconds
Code edit (5 edits merged)
Please save this source code
User prompt
add a second image to popup text box
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Add pop up text box in middle of screen
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'width')' in this line: 'presentType.x = Math.random() * (mainContainer.width - presentType.width);' Line Number: 524
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'width')' in this line: 'presentType.x = Math.random() * (mainContainer.width - presentType.getBounds().width);' Line Number: 524
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'width')' in this line: 'presentType.x = Math.random() * (mainContainer.width - presentType.width);' Line Number: 524
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'width')' in this line: 'presentType.x = Math.random() * (mainContainer.width - presentAsset.width);' Line Number: 524
User prompt
Fix Bug: 'Uncaught ReferenceError: type is not defined' in this line: 'var presentAsset = presentType.createAsset(type, type + ' Graphics', .5, .5);' Line Number: 523
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'width')' in this line: 'presentType.x = Math.random() * (mainContainer.width - presentType.createAsset(type, type + ' Graphics', .5, .5).width);' Line Number: 523
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'width')' in this line: 'presentType.x = Math.random() * (mainContainer.width - presentType.width);' Line Number: 523
User prompt
Fix Bug: 'Uncaught ReferenceError: mainContainer is not defined' in this line: 'self.createPresents(presentTypesCount, mainContainer);' Line Number: 530
User prompt
Fix Bug: 'Uncaught TypeError: LK.stopTick is not a function' in this line: 'LK.stopTick();' Line Number: 414
===================================================================
--- original.js
+++ change.js
@@ -181,9 +181,10 @@
self.rotationSpeed = 0.0002;
});
var presentTypeDisplay = Container.expand(function (nameDisplay) {
var self = Container.call(this);
- self.updatePresentTypesBasedOnLevel = function (level) {
+ presentTypeDisplay.prototype.updatePresentTypesBasedOnLevel = function () {
+ var level = LevelManager.getCurrentLevel();
var presentTypesCount = 2;
if (level >= 3 && level <= 4) {
presentTypesCount = 3;
} else if (level >= 5 && level <= 6) {
@@ -200,9 +201,9 @@
presentTypesCount = 9;
} else if (level >= 17) {
presentTypesCount = 10;
}
- self.setRandomPresentTypeIndex(presentTypesCount);
+ return presentTypesCount;
};
var level = LevelManager.getCurrentLevel();
var presentTypesCount = 2;
if (level >= 3 && level <= 4) {
@@ -229,9 +230,9 @@
self.currentPresentType = '';
self.getCurrentPresentType = function () {
return self.currentPresentType;
};
- self.setRandomPresentTypeIndex = function (presentTypesCount) {
+ self.setRandomPresentTypeIndex = function () {
var presentTypeIndex = Math.floor(Math.random() * presentTypesCount);
self.currentPresentType = presentTypes[presentTypeIndex];
var displayGraphic = self.createAsset(self.currentPresentType, self.currentPresentType + ' Graphics', -0.2, -0.2);
displayGraphic.scale.x = 1.5;
@@ -524,9 +525,9 @@
LK.gui.topCenter.addChild(scoreTxt);
var popupTextBox = new PopupTextBox('A silly elf has spilt\nmagic dust in the\npresent sack causing\nthe presents to\nfloat away!\nCan you catch\nthem all!');
self.addChild(popupTextBox, 2);
var level = self.levelManager.getCurrentLevel();
- self.presentDisplay.updatePresentTypesBasedOnLevel(level);
+ var presentTypesCount = self.presentDisplay.updatePresentTypesBasedOnLevel();
self.createPresents = function (presentTypesCount, mainContainer) {
for (var i = 0; i < presentTypesCount; i++) {
var levelAdjustment = LevelManager.getCurrentLevel() > 15 ? 3 : Math.max(0, Math.floor((LevelManager.getCurrentLevel() - 11) / 2));
var numPresentsToCreate = 6 - levelAdjustment;
@@ -538,9 +539,8 @@
self.presents.push(presentType);
}
}
};
- var presentTypesCount = self.presentDisplay.updatePresentTypesBasedOnLevel(self.levelManager.getCurrentLevel());
self.createPresents(presentTypesCount, mainContainer);
self.presentDisplay.setRandomPresentTypeIndex();
self.presentDisplay.setRandomPresentTypeIndex();
LK.on('tick', function () {
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.