User prompt
change displayname so that it reads names randomly from presenttype and displays the name associated present
User prompt
when createpresents is run create an array to assign each present created a random name from namestorage
Code edit (1 edits merged)
Please save this source code
User prompt
in game code when a new level is achieved refresh presentTypeDisplay
User prompt
place popuptext above all other game objects
User prompt
Fix Bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'parent')' in this line: 'self.parent.parent.updateName(nameStorage[Math.floor(Math.random() * nameStorage.length)]);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'updateName')' in this line: 'self.parent.updateName(nameStorage[Math.floor(Math.random() * nameStorage.length)]);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'nameDisplayInstance')' in this line: 'self.parent.nameDisplayInstance.updateName(nameStorage[Math.floor(Math.random() * nameStorage.length)]);' Line Number: 8
User prompt
Fix Bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'children')' in this line: 'self.parent.children.find(child => child instanceof NameDisplay).updateName(nameStorage[Math.floor(Math.random() * nameStorage.length)]);' Line Number: 8
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of null (reading 'parent')' in this line: 'if (!this.parent.parent.initialized) return;' Line Number: 170
User prompt
in displayname if popup is active then pause code. when popup cleared resume code
User prompt
in displayname if popup is active then pause code until cleraed
User prompt
in namedisplay when popuptext cleared then resume particle effects
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of null (reading 'initialized')' in this line: 'if (!self.parent.initialized) {' Line Number: 170
User prompt
in displayname if popup is active dont run particleeffect
User prompt
when popup is active pause particle tick
User prompt
Fix Bug: 'ReferenceError: particleEffect is not defined' in this line: 'particleEffect.alpha = 1;' Line Number: 7
User prompt
Fix Bug: 'ReferenceError: nameDisplay is not defined' in this line: 'nameDisplay.nameText.alpha = 1;' Line Number: 6
User prompt
Fix Bug: 'TypeError: LK.gui.getChildByName is not a function' in this line: 'LK.gui.getChildByName('nameDisplay').alpha = 1;' Line Number: 6
User prompt
Fix Bug: 'Uncaught ReferenceError: particleEffect is not defined' in this line: 'particleEffect.alpha = 0;' Line Number: 517
User prompt
Fix Bug: 'Uncaught TypeError: LK.gui.getChildByName is not a function' in this line: 'LK.gui.getChildByName('nameDisplay').alpha = 0;' Line Number: 516
User prompt
when popuptext is displayed set namedisplay and particle effects aplha to 0. reset to normal value when popuptext cleared
User prompt
Change In game code remove name change time and set it so name changes when a present is removed
User prompt
add logic to allow control of `emit` for `ParticleEffect` and `updateName` for `DisplayName` to allow them to be paused when popuptext displayed
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'toggleEmission')' in this line: 'self.particleEffect.toggleEmission(false);' Line Number: 458
===================================================================
--- original.js
+++ change.js
@@ -535,17 +535,17 @@
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;
for (var j = 0; j < numPresentsToCreate; j++) {
- var presentType = new Present('presentType' + (i + 1));
+ var randomNameIndex = Math.floor(Math.random() * nameStorage.length);
+ var presentType = new Present('presentType' + (i + 1), nameStorage[randomNameIndex]);
presentType.x = Math.random() * (mainContainer.width - presentType.width);
presentType.y = Math.random() * (mainContainer.height - presentType.height);
mainContainer.addChild(presentType);
self.presents.push(presentType);
}
}
};
- self.presentDisplay.setRandomPresentTypeIndex(presentTypesCount);
self.createPresents(presentTypesCount, mainContainer);
LK.on('tick', function () {
for (var i = self.presents.length - 1; i >= 0; i--) {
var present = self.presents[i];
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.