Code edit (2 edits merged)
Please save this source code
User prompt
set displaylimit in createPresentDisplay to numPresentsToCreate value each time level changes
User prompt
in game code add a variable that captures the current catchpresentDisplay value that can be used for comparison to presents that have been clicked
Code edit (15 edits merged)
Please save this source code
User prompt
set displayedPresentType so its equal to the current catchPresentDisplay Present asset value
Code edit (1 edits merged)
Please save this source code
User prompt
in catchPresentDisplay for displaylimit count number presents created based upon level of game
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'self.displayLimit = self.catchPresentsList.length;' Line Number: 5
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught ReferenceError: catchPresentsList is not defined' in this line: 'self.catchPresentsList = catchPresents.slice(0, catchPresentsList.length);' Line Number: 7
Code edit (11 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'scoreText')' in this line: 'self.scoreDisplay.scoreText.anchor.set(.5, 0);' Line Number: 476
User prompt
Fix Bug: 'Uncaught ReferenceError: scoreTxt is not defined' in this line: 'scoreTxt.anchor.set(.5, 0);' Line Number: 476
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setText')' in this line: 'scoreTxt.setText(gameInstance.score);' Line Number: 220
Code edit (1 edits merged)
Please save this source code
User prompt
in present graphics check to see if the clicked present type matches the catchdisplayedpresent type shown. if so delete clicked present and add 1 to score. if not delete a life
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'type')' in this line: 'var currentDisplayType = randomIndex < gameInstance.catchPresentsDisplay.catchPresentsList.length ? gameInstance.catchPresentsDisplay.catchPresentsList[randomIndex].type : null;' Line Number: 217
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'type')' in this line: 'var currentDisplayType = gameInstance.catchPresentsDisplay.catchPresentsList[randomIndex].type;' Line Number: 217
User prompt
remove presenttypedisplay code
User prompt
remove NameDsiplay code
User prompt
Fix Bug: 'ReferenceError: randomIndex is not defined' in this line: 'var currentDisplayType = gameInstance.catchPresentsDisplay.catchPresentsList[randomIndex].type;' Line Number: 276
User prompt
change currentDisplayType variable to equal the currentcatchPresentDisplay asset displayed
User prompt
change currentDisplayType variable to equal the currentcatchPresentDisplay asset type
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading '0')' in this line: 'if (presentAsset && presentAsset.textureCacheIds[0] === selectedPresent.assetId) {' Line Number: 13
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading '0')' in this line: 'if (presentAsset.textureCacheIds[0] === selectedPresent.assetId) {' Line Number: 13
var CatchPresentsDisplay = Container.expand(function () {
var self = Container.call(this);
self.x = 10;
self.y = 10;
self.catchPresentsList = [];
self.updateList = function (catchPresents) {
self.catchPresentsList = catchPresents.slice(0, self.displayLimit);
self.removeChildren();
var randomIndex = Math.floor(Math.random() * self.catchPresentsList.length);
if (self.catchPresentsList.length > 0) {
var selectedPresent = self.catchPresentsList[randomIndex];
var presentAsset = self.createAsset(selectedPresent.type, selectedPresent.type + ' Graphics', 0.5, 0.5);
if (presentAsset && presentAsset.textureCacheIds[0] === selectedPresent.assetId) {
presentAsset.x = self.width / 2 + 350;
presentAsset.y = 145;
} else {
console.error('Mismatch between present graphics and asset list.');
}
var presentText = new Text2(self.catchPresentsList[randomIndex].name, {
size: 45,
fill: '#000000',
font: "Comic Sans MS"
});
presentText.anchor.set(0.5, 0.5);
presentText.x = self.width / 2 + 560;
presentText.y = 140;
}
if (presentText) {
presentText.y = 140;
self.addChild(presentText);
var particleEffect = new ParticleEffect();
particleEffect.x = 335;
particleEffect.y = 70;
self.addChild(particleEffect);
particleEffect.emit('particleAsset', 10, 6, 0.8, 0.03);
}
};
});
var PopupTextBox = Container.expand(function (message) {
var self = Container.call(this);
self.interactive = true;
self.on('down', function () {
self.parent.initialized = true;
self.destroy();
});
var textBoxBg = self.createAsset('BoxBg', 'Box Background', 0.5, 0.5);
textBoxBg.width = 2048;
textBoxBg.height = 2732;
textBoxBg.x = 2048 / 2;
textBoxBg.y = 2732 / 2;
self.addChild(textBoxBg);
var textBoxBg = self.createAsset('textBoxBg', 'Text Box Background', 0.5, 0.5);
textBoxBg.width = 1200;
textBoxBg.height = 1200;
textBoxBg.x = 2048 / 2;
textBoxBg.y = 2732 / 2;
self.addChild(textBoxBg);
var secondImage = self.createAsset('secondImageAsset', 'Second Image', 0.5, 0.5);
secondImage.x = 2048 / 2 + 280;
secondImage.y = 2732 / 2 + 220;
self.addChild(secondImage);
var text = new Text2(message, {
size: 70,
fill: '#000000',
font: "Comic Sans MS",
anchor: {
x: 0.5,
y: 0.5
}
});
text.x = 700;
text.y = 2732 / 2 - 370;
self.addChild(text);
});
var ParticleEffect = Container.expand(function () {
var self = Container.call(this);
self.emit = function (assetId, count, speed, scale, alphaDecay) {
for (var i = 0; i < count; i++) {
var particle = new Particle(assetId, speed, scale, alphaDecay);
particle.x = self.x;
particle.y = self.y;
self.addChild(particle);
}
};
});
var Particle = Container.expand(function (assetId, speed, scale, alphaDecay) {
var self = Container.call(this);
var particleGraphics = self.createAsset(assetId, 'Particle Graphics', 0.5, 0.5);
particleGraphics.rotation = Math.random() * Math.PI * 2;
particleGraphics.scale.x = scale;
particleGraphics.scale.y = scale;
self.vx = Math.random() * speed - speed / 2;
self.vy = Math.random() * speed - speed / 2;
self.alpha = 1;
self.lifetime = 60;
self.tick = function () {
self.x += self.vx;
self.y += self.vy;
self.alpha -= alphaDecay;
if (self.alpha <= 0) self.destroy();
};
LK.on('tick', self.tick);
});
var BonusItem = Container.expand(function () {
var self = Container.call(this);
self.speed = (Math.random() - 0.5) * 10;
self.rotationSpeed = (Math.random() - 0.5) * 0.1;
self.bounce = Math.random() * 0.7 + 0.5;
self.gravity = Math.random() * 0.2 + 0.1;
self.vx = self.speed;
self.vy = self.speed;
BonusItem.prototype.startDestructionTimer = function (resetBonusTimerCallback) {
var self = this;
var destructionTimeout = LK.setTimeout(function () {
self.destroy();
resetBonusTimerCallback();
}, 15000);
self.destructionTimeout = destructionTimeout;
};
self.interactive = true;
self.bonusAmount = Math.floor(Math.random() * (10 - 4 + 1)) + 4;
var bonusGraphics = self.createAsset('bonusItem', 'Bonus Item Graphics', 0.5, 0.5);
self.vx = (Math.random() > 0.5 ? 1 : -1) * (Math.random() * 2 + 1);
self.on('down', function () {
var gameInstance = this.parent.parent;
gameInstance.score += self.bonusAmount;
var scoreTxt = LK.gui.topCenter.children[0];
scoreTxt.setText(gameInstance.score);
LK.clearTimeout(self.destructionTimeout);
self.destroy();
gameInstance.resetBonusTimer();
});
self.move = function () {
self.x += self.vx;
self.y += self.vy;
self.rotation += self.rotationSpeed;
if (self.x < 0 || self.x > 2048) {
self.vx = -self.vx * self.bounce;
}
if (self.y < 0 || self.y > 2732) {
self.vy = -self.vy * self.bounce;
}
};
});
var LifeCounter = Container.expand(function (initialLives) {
var self = Container.call(this);
var lifeCounterBg = self.createAsset('lifeCounterBg', 'Life Counter Background', 0.5, 0.5);
lifeCounterBg.x = 1710;
lifeCounterBg.y = 190;
lifeCounterBg.alpha = 0.2;
self.addChild(lifeCounterBg);
self.refreshLifeDisplay = function () {
while (self.lifeIcons.length > self.lives) {
var lifeToRemove = self.lifeIcons.pop();
lifeToRemove.destroy();
}
for (var i = 0; i < self.lifeIcons.length; i++) {
self.lifeIcons[i].x = 1948 - i * (self.lifeIcons[i].width + 10);
}
};
self.lives = initialLives;
self.lifeIcons = [];
for (var i = 0; i < self.lives; i++) {
var lifeIcon = self.createAsset('lifeIcon', 'Life Icon', 0.5, 0.5);
lifeIcon.x = 1948 - i * (lifeIcon.width + 10);
lifeIcon.y = 250;
self.lifeIcons.push(lifeIcon);
self.addChild(lifeIcon);
}
self.removeLife = function () {
if (self.lives > 0) {
self.lives--;
self.refreshLifeDisplay();
if (self.lives <= 0) {
LK.showGameOver();
}
}
};
self.resetLives = function () {
while (self.lifeIcons.length < initialLives) {
var lifeIcon = self.createAsset('lifeIcon', 'Life Icon', 0.5, 0.5);
lifeIcon.x = 1948 - (initialLives - self.lifeIcons.length - 1) * (lifeIcon.width + 10);
lifeIcon.y = 250;
self.lifeIcons.push(lifeIcon);
self.addChild(lifeIcon);
}
self.lives = initialLives;
};
});
var NameDisplay = Container.expand(function () {
var self = Container.call(this);
self.nameText = new Text2('', {
size: 45,
fill: "#000000",
font: "Comic Sans MS",
anchor: {
x: 0.0,
y: 0.0
}
});
self.nameText.x = 580;
self.nameText.y = 1120;
LK.gui.topLeft.addChild(self.nameText);
});
var Background = Container.expand(function () {
var self = Container.call(this);
var background = self.createAsset('background', 'Background Image', 0, 0);
background.width = 2048;
background.height = 2732;
self.addChild(background);
});
var RotatingBackground = Container.expand(function () {
var self = Container.call(this);
var rotatingImage = self.createAsset('rotatingBackground', 'Rotating Background Image', 0.5, 0.5);
rotatingImage.x = 2048 / 2;
rotatingImage.y = 2732 / 2;
self.addChild(rotatingImage);
self.rotationSpeed = 0.0003;
});
var presentTypeDisplay = Container.expand(function (nameDisplay) {
var self = Container.call(this);
var level = LevelManager.getCurrentLevel();
var presentTypesCount = 2;
if (level >= 3 && level <= 4) {
presentTypesCount = 3;
} else if (level >= 5 && level <= 6) {
presentTypesCount = 4;
} else if (level >= 7 && level <= 8) {
presentTypesCount = 5;
} else if (level >= 9 && level <= 10) {
presentTypesCount = 6;
} else if (level >= 11 && level <= 12) {
presentTypesCount = 7;
} else if (level >= 13 && level <= 14) {
presentTypesCount = 8;
} else if (level >= 15 && level <= 16) {
presentTypesCount = 9;
} else if (level >= 17) {
presentTypesCount = 10;
}
var presentTypes = [];
for (var i = 0; i < presentTypesCount; i++) {
presentTypes.push('presentType' + (i + 1));
}
self.currentPresentType = '';
self.getCurrentPresentType = function () {
return self.currentPresentType;
};
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;
displayGraphic.scale.y = 1.5;
if (self.children.length > 0) {
self.removeChildAt(0);
}
self.addChild(displayGraphic);
var randomName = nameStorage[Math.floor(Math.random() * nameStorage.length)];
nameDisplay.nameText.setText(randomName);
};
self.setRandomPresentTypeIndex();
LK.setInterval(self.setRandomPresentTypeIndex, (Math.random() * (9 - 3) + 3) * 1000);
});
var Present = Container.expand(function (type) {
var self = Container.call(this);
self.type = type;
self.applyGravity = function () {
var level = LevelManager.getCurrentLevel() - 1;
var gravity = levelParameters[level].gravity;
self.vy += gravity;
};
var presentGraphics = self.createAsset(type, type + ' Graphics', .5, .5);
self.vx = (Math.random() - 0.5) * 10;
self.vy = (Math.random() - 0.5) * 10;
self.rotationSpeed = (Math.random() - 0.5) * 0.2;
self.interactive = true;
self.on('down', function () {
var gameInstance = this.parent.parent;
var currentDisplayType = gameInstance.getCurrentPresentType();
if (self.type === currentDisplayType) {
gameInstance.score++;
var scoreTxt = LK.gui.topCenter.children[0];
scoreTxt.setText(gameInstance.score);
gameInstance.presents.splice(gameInstance.presents.indexOf(self), 1);
gameInstance.CatchPresents.splice(gameInstance.CatchPresents.findIndex(p => p.type === self.type), 1);
gameInstance.catchPresentsDisplay.updateList(gameInstance.CatchPresents);
self.destroy();
} else {
gameInstance.lifeCounter.removeLife();
}
});
self.move = function () {
self.applyMovement();
};
self.applyMovement = function () {
var levelIndex = LevelManager.getCurrentLevel() - 1;
var level = levelParameters[Math.max(0, Math.min(levelIndex, levelParameters.length - 1))];
var presentSpeedFactor = level.presentSpeedFactor;
self.x += self.vx * presentSpeedFactor;
self.y += self.vy * presentSpeedFactor;
self.rotation += self.rotationSpeed;
self.applyBounds();
};
self.applyBounds = function () {
var mainContainer = self.parent;
if (self.x < 0) {
self.x = 0;
self.vx = -self.vx;
}
if (mainContainer && self.x > mainContainer.width - self.width) {
self.x = mainContainer.width - self.width;
self.vx = -self.vx;
}
if (self.y < 0) {
self.y = 0;
self.vy = -self.vy;
}
if (mainContainer && self.y > mainContainer.height - self.height) {
self.y = mainContainer.height - self.height;
self.vy = -self.vy;
}
};
self.bounce = function (collisionNormal) {
self.applyBounce(collisionNormal);
};
self.applyBounce = function (collisionNormal) {
var level = LevelManager.getCurrentLevel() - 1;
var bounceFactor = levelParameters[level].bounceFactor;
if (collisionNormal.x !== 0) {
self.vx = -self.vx * bounceFactor;
}
if (collisionNormal.y !== 0) {
self.vy = -self.vy * bounceFactor;
}
};
});
var MainContainer = Container.expand(function () {
var self = Container.call(this);
self.width = 1942;
self.height = 1900;
self.x = 50;
self.y = 400;
var background = self.createAsset('whiteBackground', 'White Background', 0, 0);
background.width = self.width;
background.height = self.height;
background.alpha = 0.01;
self.addChild(background);
});
var SantaSack = Container.expand(function () {
var self = Container.call(this);
var sackGraphics = self.createAsset('santaSack', 'Santa Toy Sack', 0.5, 1);
self.x = 2048 / 2;
self.y = 3200;
});
var nameStorage = ['James', 'Mary', 'John', 'Pat', 'Robert', 'Jenni', 'Michael', 'Linda', 'William', 'Elizabeth', 'David', 'Barbara', 'Richard', 'Susan', 'Joseph', 'Jessica', 'Thomas', 'Sarah', 'Charles', 'Karen', 'Chris', 'Nancy', 'Daniel', 'Lisa', 'Matthew', 'Margaret', 'Anthony', 'Betty', 'Mark', 'Sandra', 'Donald', 'Ashley', 'Steven', 'Kimberly', 'Paul', 'Emily', 'Andrew', 'Donna', 'Joshua', 'Michelle', 'Kenneth', 'Dorothy', 'Kevin', 'Carol', 'Brian', 'Amanda', 'George', 'Melissa', 'Edward', 'Stephanie'];
var LevelManager = (function () {
var currentLevel = 1;
var maxLevel = 20;
function getNextLevel() {
currentLevel++;
return currentLevel;
}
function resetLevels() {
currentLevel = 1;
}
return {
getNextLevel: getNextLevel,
resetLevels: resetLevels,
getCurrentLevel: function () {
return currentLevel;
}
};
})();
var levelParameters = [{
presentSpeedFactor: 2,
bounceFactor: 0.6,
gravity: 0.1
}, {
presentSpeedFactor: 2.2,
bounceFactor: 0.65,
gravity: 0.12
}, {
presentSpeedFactor: 3,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 4,
bounceFactor: 0.8,
gravity: 0.3
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}, {
presentSpeedFactor: 3.5,
bounceFactor: 0.8,
gravity: 0.2
}];
var Game = Container.expand(function () {
var self = Container.call(this);
self.initialized = false;
self.createBonusItem = function (mainContainer) {
var bonusItem = new BonusItem();
bonusItem.x = Math.random() * (mainContainer.width - bonusItem.width) + mainContainer.x;
bonusItem.y = Math.random() * (mainContainer.height - bonusItem.height) + mainContainer.y;
mainContainer.addChild(bonusItem);
bonusItem.startDestructionTimer(self.resetBonusTimer);
self.bonusItem = bonusItem;
};
self.resetBonusTimer = function () {
LK.clearTimeout(bonusItemTimeout);
bonusItemTimeout = LK.setTimeout(function () {
self.createBonusItem(mainContainer);
}, (Math.random() * (120 - 60) + 60) * 1000);
};
var bonusItemTimeout = LK.setTimeout(function () {
self.createBonusItem(mainContainer);
}, (Math.random() * (120 - 60) + 60) * 1000);
LK.on('tick', function () {
if (!self.initialized) return;
if (self.bonusItem) {
self.bonusItem.move();
}
});
self.presents = [];
self.levelManager = LevelManager;
var rotatingBackground = new RotatingBackground();
self.addChild(rotatingBackground, 0);
LK.on('tick', function () {
rotatingBackground.children[0].rotation += rotatingBackground.rotationSpeed;
});
var background = new Background();
self.addChildAt(background, 1);
var santaSack = new SantaSack();
self.addChild(santaSack);
var mainContainer = new MainContainer();
self.addChild(mainContainer);
var scroll = self.createAsset('newImageAsset', 'Scroll', 0.5, 0.5);
scroll.x = 950;
scroll.y = 220;
self.addChild(scroll);
var nameDisplay = new NameDisplay('');
LK.setTimeout(function () {
nameDisplay.nameText.setText(nameStorage[Math.floor(Math.random() * nameStorage.length)]);
}, 1000);
var presentDisplay = self.addChild(new presentTypeDisplay(nameDisplay));
self.presentDisplay = presentDisplay;
var catchPresentsDisplay = new CatchPresentsDisplay();
LK.gui.topLeft.addChild(catchPresentsDisplay);
self.catchPresentsDisplay = catchPresentsDisplay;
self.getCurrentPresentType = function () {
return self.presentDisplay.getCurrentPresentType();
};
self.presentDisplay.x = 450;
self.presentDisplay.y = 0;
self.lifeCounter = new LifeCounter(5);
self.addChild(self.lifeCounter);
self.score = 0;
var score = self.score;
var scoreTxtXAdjust = 335;
var scoreTxtYAdjust = 20;
self.score = 0;
var scoreTxt = new Text2(self.score, {
size: 80,
fill: "#ffffff",
weight: 800,
dropShadow: true,
dropShadowColor: '#ff0000',
dropShadowAngle: Math.PI / 6,
dropShadowDistance: 5
});
scoreTxt.x += scoreTxtXAdjust;
scoreTxt.y += scoreTxtYAdjust;
self.levelManager.resetLevels();
self.currentLevelTxt = new Text2('LV' + self.levelManager.getCurrentLevel(), {
size: 80,
fill: "#ffffff",
weight: 800,
dropShadow: true,
dropShadowColor: '#ff0000',
dropShadowAngle: Math.PI / 6,
dropShadowDistance: 3
});
self.currentLevelTxt.anchor.set(0.5, 0);
self.currentLevelTxt.x = 1315;
self.currentLevelTxt.y = 30;
LK.gui.topLeft.addChild(self.currentLevelTxt);
scoreTxt.anchor.set(.5, 0);
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.addChildAt(popupTextBox, self.children.length);
var level = self.levelManager.getCurrentLevel();
var presentTypesCount = 2;
if (level >= 3 && level <= 4) {
presentTypesCount = 3;
} else if (level >= 5 && level <= 6) {
presentTypesCount = 4;
} else if (level >= 7 && level <= 8) {
presentTypesCount = 5;
} else if (level >= 9 && level <= 10) {
presentTypesCount = 6;
} else if (level >= 11 && level <= 12) {
presentTypesCount = 7;
} else if (level >= 13 && level <= 14) {
presentTypesCount = 8;
} else if (level >= 15 && level <= 16) {
presentTypesCount = 9;
} else if (level >= 17) {
presentTypesCount = 10;
}
self.createPresents = function (presentTypesCount, mainContainer) {
self.CatchPresents = [];
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 = 'presentType' + (i + 1);
var presentName = nameStorage[Math.floor(Math.random() * nameStorage.length)];
var present = new Present(presentType);
present.x = Math.random() * (mainContainer.width - present.width);
present.y = Math.random() * (mainContainer.height - present.height);
mainContainer.addChild(present);
self.presents.push(present);
self.CatchPresents.push({
type: presentType,
name: presentName
});
self.catchPresentsDisplay.updateList(self.CatchPresents);
}
}
};
self.createPresents(presentTypesCount, mainContainer);
LK.on('tick', function () {
for (var i = self.presents.length - 1; i >= 0; i--) {
var present = self.presents[i];
present.move();
if (present.y >= LK.stageContainer.height - present.height) {
present.y = LK.stageContainer.height - present.height;
present.vy = 0;
present.destroy();
self.presents.splice(i, 1);
self.catchPresentsDisplay.updateList(self.CatchPresents);
}
}
if (self.presents.length === 0) {
var newLevel = self.levelManager.getNextLevel();
self.currentLevelTxt.setText('LV ' + newLevel);
var level = self.levelManager.getCurrentLevel();
var presentTypesCount = 2;
if (level >= 3 && level <= 4) {
presentTypesCount = 3;
} else if (level >= 5 && level <= 6) {
presentTypesCount = 4;
} else if (level >= 7 && level <= 8) {
presentTypesCount = 5;
} else if (level >= 9 && level <= 10) {
presentTypesCount = 6;
} else if (level >= 11 && level <= 12) {
presentTypesCount = 7;
} else if (level >= 13 && level <= 14) {
presentTypesCount = 8;
} else if (level >= 15 && level <= 16) {
presentTypesCount = 9;
} else if (level >= 17) {
presentTypesCount = 10;
}
self.createPresents(presentTypesCount, mainContainer);
}
});
});
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.