User prompt
when present is clicked compare present type selected with present type dislayed. If they do not match then reduce live by 1
Code edit (8 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught ReferenceError: score is not defined' in this line: 'scoreTxt = new Text2(score, {' Line Number: 295
Code edit (1 edits merged)
Please save this source code
User prompt
add scorecounter text at x=1024 y=100
Code edit (1 edits merged)
Please save this source code
User prompt
Store presentDisplay and log to console
User prompt
store presentDisplay details and add to consul log
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'removeLife')' in this line: 'self.lifeCounter.removeLife();' Line Number: 266
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'removeLife')' in this line: 'self.lifeCounter.removeLife();' Line Number: 266
User prompt
Fix Bug: 'ReferenceError: lifeCounter is not defined' in this line: 'lifeCounter.removeLife();' Line Number: 265
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'getCurrentPresentType')' in this line: 'if (presentType === self.presentDisplay.getCurrentPresentType()) {' Line Number: 264
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'getCurrentPresentType')' in this line: 'if (presentType === self.parent.presentDisplay.getCurrentPresentType()) {' Line Number: 263
User prompt
Fix Bug: 'ReferenceError: presentDisplay is not defined' in this line: 'if (presentType === presentDisplay.getCurrentPresentType()) {' Line Number: 263
User prompt
Fix Bug: 'ReferenceError: presentDisplay is not defined' in this line: 'if (presentType === presentDisplay.getCurrentPresentType()) {' Line Number: 263
User prompt
Fix Bug: 'Uncaught ReferenceError: presentTypeIndex is not defined' in this line: 'var displayGraphic = self.createAsset(presentTypes[presentTypeIndex], presentTypes[presentTypeIndex] + ' Graphics', -0.2, -0.2);' Line Number: 177
User prompt
if storePresentTypeDetails matches presentType then reduce life by 1
User prompt
When a present in the main container is clicked store the present type details
User prompt
Fix Bug: 'TypeError: self.applyMovement is not a function' in this line: 'self.applyMovement();' Line Number: 206
User prompt
when present is selected capture present type and compare it to presentTypedisplay. If they dont match reduce life by one and refresh life counter
User prompt
Update the LifeCounter class to refresh life display when a life is removed Add a new method refreshLifeDisplay in LifeCounter class to update the life icons display
User prompt
when life updated refresh life display
User prompt
in game when present is selected refresh life counter
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'removeLife')' in this line: 'gameInstance.lifeCounter.removeLife();' Line Number: 200
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'currentPresentType')' in this line: 'if (self.assetId === gameInstance.presentTypeDisplay.currentPresentType) {' Line Number: 196
===================================================================
--- original.js
+++ change.js
@@ -179,8 +179,9 @@
}
self.addChild(displayGraphic);
var randomName = nameStorage[Math.floor(Math.random() * nameStorage.length)];
nameDisplay.updateName(randomName);
+ self.parent.currentPresentType = presentTypes[presentTypeIndex];
};
self.setRandomPresentTypeIndex();
LK.setInterval(self.setRandomPresentTypeIndex, (Math.random() * (9 - 3) + 3) * 1000);
});
@@ -255,10 +256,14 @@
background.width = self.width;
background.height = self.height;
background.alpha = 0.1;
self.addChild(background);
+ self.currentPresentType = '';
self.storePresentTypeDetails = function (presentType) {
console.log('Present type clicked:', presentType);
+ if (self.currentPresentType !== presentType) {
+ self.parent.lifeCounter.removeLife();
+ }
};
});
var SantaSack = Container.expand(function () {
var self = Container.call(this);
@@ -290,9 +295,9 @@
var santaSack = new SantaSack();
self.addChild(santaSack);
var lifeCounter = new LifeCounter(5);
self.addChild(lifeCounter);
- self.score = 1000;
+ self.score = 0;
var score = self.score;
var scoreTxt = new Text2(score, {
size: 120,
fill: "#ffffff",
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.