User prompt
Move the naughty house warning text box 300 pixels left
User prompt
Move the naughty house warning text box 300 pixels left
User prompt
Move the naughty house warning text box 600 pixels left
User prompt
Center-align and make bold the naughty house warning text box, and anchor that box to the exact center of the screen
User prompt
Center the the naughty house warning equally from left edge to right edge
User prompt
Center the naughty house warning on the screen and move it up 600 pixels
User prompt
The first time a naughty house turns dark, text appears at the bottom third of the screen that says "Avoid naughty houses!" The test is red. It disappears after 3 seconds.
User prompt
The first time the player collects the Naughty Bounce! powerup define NaughtyHouse.prototype.requiredHitCount as 2. Every subsequent time the player collects Naughty Bounce! increase that by 1.
User prompt
The first time the player collects the Naughty Bounce! powerup define NaughtyHouse.prototype.requiredHitCount as 1. Every subsequent time the player collects Naughty Bounce! increase that by 1.
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')' in this line: 'NaughtyHouse.prototype.requiredHitCount = 1;' Line Number: 23
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')' in this line: 'NaughtyHouse.prototype.requiredHitCount = 1;' Line Number: 23
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')' in this line: 'NaughtyHouse.prototype.requiredHitCount = 1;' Line Number: 23
User prompt
At the start of the game, define NaughtyHouse.prototype.requiredHitCount as 1. Every time the player collects Naughty Bounce! increase that by 1.
User prompt
Why isn't naughty bounce making naughty houses take more presents before they turn dark?
User prompt
Every time the player earns Naughty Bounce, all NaughtyHouses get +1 hitpoint
User prompt
NaughtyHouse starts with 1 hitpoint. They lose a hitpoint whenever they are hit with a present. After being hit with a present, if they still have hitpoints left, the present is deflected. If they do not have hitpoints left, the house turns dark.
User prompt
There can only be 50 snowflakes in existence at a time. destroy the oldest if necessary.
User prompt
There can only be 30 houses in existence at a time. destroy the oldest if necessary.
function wrapText(text, maxWidth) { var words = text.split(' '); var wrappedText = ''; var currentLine = ''; var testText = new Text2('', { size: 70 }); for (var i = 0; i < words.length; i++) { var word = words[i]; var testLine = currentLine + word + ' '; testText.setText(testLine); if (testText.width > 1000 && i > 0) { wrappedText += currentLine.trim() + '\n'; currentLine = word + ' '; } else { currentLine = testLine; } } wrappedText += currentLine.trim(); return wrappedText; } var allowPresentAngle = false; NaughtyHouse.prototype.requiredHitCount = 1; var MerryChristmasPopup = Container.expand(function (score, onDismiss) { var self = Container.call(this); var background = self.createAsset('popupBackground', 'Popup Background', 0.5, 0.5); background.width = 2048 * 0.85; background.height = 2732 * 0.85; background.x = 2048 / 2; background.y = 2732 / 2; var titleText = new Text2('Merry Christmas', { size: 130, fill: '#000000' }); titleText.anchor.set(0.5); titleText.x = background.x; titleText.y = background.y - background.height / 2 + 220; self.addChild(titleText); var bodyTextContent; if (score < 30) { bodyTextContent = 'Oh no, you need to score at least 30 points to make the Nice List! Then you can see the holiday message. Remember, you lose points for delivering to naughty houses!'; } else if (score <= 74) { bodyTextContent = 'Wishing you a wonderful year ahead! We have moved north to Marin and the clear air and nearby family are really suiting us. We miss our friends in LA and around the world though. Annie loves her new DA office and colleagues. Matt is working remotely in new game development at his same firm, Scopely. Score over 75 points for an update on the kids! Human Kindness is OP.'; } else if (score <= 199) { bodyTextContent = 'Over 75 points, wow! Score less for Part 1. The boys are doing great! Lincoln rides the school bus 5 days a week and gets amazing speech and PT therapies right there. Finn and our au pair Tobias love playing at the creek, and Finn has new words every day. Have an amazing holiday! The high score is 200, can you beat it?'; } else { bodyTextContent = 'WHAT IS YOUR SECRET? Seriously, I programmed this message but have never gotten over 200 points. Screenshot this for me! AND HAVE A VERY MERRY CHRISTMAS, INDEED!'; } var bodyText = new Text2(wrapText(bodyTextContent, 100), { size: 70, fill: '#000000', align: 'center' }); bodyText.anchor.set(0.5); bodyText.x = background.x; bodyText.y = background.y - 50; self.addChild(bodyText); var dismissButton = new Button('Retry', onDismiss); dismissButton.scale.set(dismissButton.scale.x * 0.75, dismissButton.scale.y * 0.75); dismissButton.x = background.x + background.width / 2 - dismissButton.width * dismissButton.scale.x / 2 - 290; dismissButton.y = background.y + background.height / 2 - dismissButton.height * dismissButton.scale.y / 2 - 90; self.addChild(dismissButton); }); var Button = Container.expand(function (label, onClick) { var self = Container.call(this); var buttonGraphics = self.createAsset('button', label, 0.5, 0.5); buttonGraphics.scale.set(6); buttonGraphics.interactive = true; buttonGraphics.buttonMode = true; var nameLabel = new Text2(label.split(' ').reduce(function (acc, word) { if (acc.length && acc[acc.length - 1].length + word.length <= 12) { acc[acc.length - 1] += ' ' + word; } else { acc.push(word); } return acc; }, []).join('\n'), { size: 84.375, fill: '#008000', stroke: '#FFFFFF', strokeThickness: 6, fontWeight: '800', align: 'center' }); nameLabel.anchor.set(0.5); nameLabel.y = 50; self.addChild(nameLabel); var descriptionLabel = new Text2(label.split(' ').reduce(function (acc, word) { if (acc.length && acc[acc.length - 1].length + word.length <= 12) { acc[acc.length - 1] += ' ' + word; } else { acc.push(word); } return acc; }, []).join('\n') + ' Description', { size: 45, fill: '#000000' }); descriptionLabel.anchor.set(0.5); descriptionLabel.y = buttonGraphics.height / 2 + 240; var powerupDescriptions = { 'Pitching Arm!': ' ', 'More Carrots!': ' ', 'City Flying!': ' ', 'Present Frenzy!': ' ', 'Human Kindness!': ' ', 'Naughty Deflector!': ' ', 'Joyous!': ' ', 'New Time Zone!': ' ' }; descriptionLabel.setText(powerupDescriptions[label] || ''); descriptionLabel.anchor.set(0.5); descriptionLabel.x = 0; self.addChild(descriptionLabel); self.on('down', function (obj) { onClick(); }); }); var Present = Container.expand(function () { var self = Container.call(this); self.creationTime = LK.ticks; var presentGraphics = self.createAsset('present', 'Present Graphics', .5, .5); self.speed = -10; self.distanceTraveled = 0; self.speedX = 0; self.speedY = self.speed; self.lastMoved = LK.ticks; self.isCounter = false; self.move = function () { self.x += self.speedX; self.y += self.speedY; self.distanceTraveled += Math.sqrt(self.speedX * self.speedX + self.speedY * self.speedY); if (self.distanceTraveled <= 300) { self.scale.set((1 + self.distanceTraveled / 300 * 0.25) * 1.5); } else if (self.distanceTraveled <= 1200) { self.scale.set((1.25 - (self.distanceTraveled - 300) / 900 * 0.75) * 1.5); } else if (self.distanceTraveled <= 1500) { self.scale.set((0.5 - (self.distanceTraveled - 1200) / 300 * 0.5) * 1.5); } self.lastMoved = LK.ticks; if (self.counterLifetime && LK.ticks > self.counterLifetime || self.distanceTraveled > 1500) { self.destroy(); } }; }); var NaughtyHouse = Container.expand(function () { var self = Container.call(this); NaughtyHouse.prototype.spawnCounterPresent = function () { var counterPresent = new Present(); counterPresent.x = this.x; counterPresent.y = this.y; var angle = Math.random() < 0.5 ? 240 : 300; angle *= Math.PI / 180; counterPresent.speedX = counterPresent.speed * Math.cos(angle); counterPresent.speedY = counterPresent.speed * Math.sin(angle); counterPresent.counterLifetime = LK.ticks + 60; counterPresent.isCounter = true; return counterPresent; }; var houseGraphics = self.createAsset('naughtyHouse', 'Naughty House Graphics', .5, .5); houseGraphics.scale.set(3.5); self.speed = 4; self.lastMoved = LK.ticks; self.move = function () { self.y += self.speed; self.lastMoved = LK.ticks; if (self.y > 2732 + self.height) { self.destroy(); } }; }); var NiceHouse = Container.expand(function () { var self = Container.call(this); NiceHouse.prototype.hitByPresent = function () { var originalScale = this.scale.x; var bounceHeight = 0.1; var self = this; var bounce = function () { self.scale.y = originalScale + bounceHeight; LK.setTimeout(function () { self.scale.y = originalScale; }, 200); }; bounce(); }; var houseGraphics = self.createAsset('niceHouse', 'Nice House Graphics', .5, .5); houseGraphics.scale.set(3.5); self.speed = 4; self.hitCount = 0; self.move = function () { self.y += self.speed; if (self.y > 2732 + self.height) { self.destroy(); } }; }); var HappyHouse = Container.expand(function () { var self = Container.call(this); HappyHouse.prototype.bounce = function () { var self = this; var originalScaleY = self.scale.y; var bounceHeight = 0.1; var bounceDuration = 5; var bounceCount = 0; var bounce = function () { if (bounceCount < bounceDuration) { self.scale.y = originalScaleY + bounceHeight * (bounceCount % 2 === 0 ? -1 : 1); LK.setTimeout(bounce, 100); bounceCount++; } else { self.scale.y = originalScaleY; } }; bounce(); }; var houseGraphics = self.createAsset('happyHouse', 'Happy House Graphics', .5, .5); houseGraphics.scale.set(3.5); self.speed = 4; self.move = function () { self.y += self.speed; if (self.y > 2732 + self.height) { self.destroy(); } }; }); var DarkHouse = Container.expand(function () { var self = Container.call(this); var houseGraphics = self.createAsset('darkHouse', 'Dark House Graphics', .5, .5); houseGraphics.scale.set(3.5); self.speed = 4; self.shake = function () { var originalX = self.x; var shakeIntensity = 5; var shakeDuration = 10; var shakeCount = 0; var shake = function () { if (shakeCount < shakeDuration) { self.x += shakeIntensity * (shakeCount % 2 === 0 ? 1 : -1); LK.setTimeout(shake, 50); shakeCount++; } else { self.x = originalX; } }; shake(); }; self.move = function () { self.y += self.speed; if (self.y > 2732 + self.height) { self.destroy(); } }; }); var Santa = Container.expand(function () { var self = Container.call(this); Santa.prototype.temporarilyGrow = function () { var self = this; var growScale = 1.15; var duration = 100; var step = 1; var steps = duration / (1000 / 60); var scaleIncrement = (growScale - 1) / steps; var currentStep = 0; function growStep() { if (currentStep < steps) { self.scale.x *= 1 + scaleIncrement; self.scale.y *= 1 + scaleIncrement; currentStep++; LK.setTimeout(growStep, 1000 / 60); } else { shrinkBack(); } } function shrinkBack() { if (currentStep > 0) { self.scale.x /= 1 + scaleIncrement; self.scale.y /= 1 + scaleIncrement; currentStep--; LK.setTimeout(shrinkBack, 1000 / 60); } } growStep(); }; var santaGraphics = self.createAsset('santa', 'Santa Graphics', .5, .5); santaGraphics.scale.set(santaGraphics.scale.x * 1.3, santaGraphics.scale.y * 1.3); self.targetPosition = null; self.moveSpeed = 7; self.move = function (position) { if (position) { self.targetPosition = position; } if (self.targetPosition) { var dx = self.targetPosition.x - self.x; var dy = self.targetPosition.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); var threshold = 15; if (distance > threshold) { var angle = Math.atan2(dy, dx); var tentativeX = self.x + Math.cos(angle) * self.moveSpeed; var tentativeY = self.y + Math.sin(angle) * self.moveSpeed; self.x = tentativeX; if (tentativeY > 2732 - 2732 / 3) { self.y = tentativeY; } } else { self.targetPosition = null; } } }; }); var Snowflake = Container.expand(function () { var self = Container.call(this); var flakeGraphics = self.createAsset('snowflake', 'Snowflake Graphics', 0.5, 0.5); self.speedX = (Math.random() * 2 - 1) * 2; self.speedY = (Math.random() * 1 + 2) * 2; self.alpha = Math.random() * 0.5 + 0.5; self.scale.set(Math.random() * 0.5 + 0.5); self.move = function () { self.x += self.speedX; self.y += self.speedY; if (self.y > 2732 || self.x < -50 || self.x > 2098) { self.destroy(); } }; }); var Game = Container.expand(function () { var self = Container.call(this); var snowflakes = []; self.spawnSnowflake = function () { var snowflake = new Snowflake(); snowflake.x = Math.random() * 2048; snowflake.y = -50; if (snowflakes.length >= 50) { var oldestSnowflake = snowflakes.shift(); oldestSnowflake.destroy(); } snowflakes.push(snowflake); self.addChild(snowflake); }; for (var i = 0; i < 20; i++) self.spawnSnowflake(); var whiteBackground = self.createAsset('whiteRectangle', 'White Background', 0, 0); whiteBackground.width = 2048; whiteBackground.height = 2732; whiteBackground.tint = 0xFFFFFF; self.addChildAt(whiteBackground, 0); function startPresentFrenzy() { var originalFireRate = presentFireRate; var originalPresentSpeed = Present.prototype.speed; presentFireRate /= 3; Present.prototype.speed *= 2; if (typeof self.frenzyTimeout !== 'undefined') { LK.clearTimeout(self.frenzyTimeout); self.frenzyTimeout = LK.setTimeout(function () { presentFireRate = originalFireRate; Present.prototype.speed = originalPresentSpeed; allowPresentAngle = false; delete self.frenzyTimeout; }, 7000 + (self.frenzyTimeout - LK.ticks)); } else { self.frenzyTimeout = LK.setTimeout(function () { presentFireRate = originalFireRate; Present.prototype.speed = originalPresentSpeed; allowPresentAngle = false; delete self.frenzyTimeout; }, 7000); } allowPresentAngle = true; } function checkRankUp() { var xpThreshold = Math.floor(9 * Math.pow(1.20, rank - 1)); if (xp >= xpThreshold) { rank++; var excessXP = xp - xpThreshold; xp = excessXP; rankTxt.setText('Rank: ' + rank); updateXPDisplay(); self.spawnButtons(); } } var countdown = 75; var score = 0; var naughtyToNiceConversionRate = 3; var humanKindnessActive = false; var scoreTxt = new Text2('Score: ' + score, { size: 75, fill: "#228B22", stroke: "#FFFFFF", strokeThickness: 6 }); scoreTxt.anchor.set(0, 0); scoreTxt.x += 150; scoreTxt.y += 30; LK.gui.topLeft.addChild(scoreTxt); var timerTxt = new Text2(countdown.toString(), { size: 150, fill: "#228B22", stroke: "#FFFFFF", strokeThickness: 6 }); timerTxt.anchor.set(.5, 0); LK.gui.topCenter.addChild(timerTxt); var xp = 0; var rank = 1; var rankTxt = new Text2('Rank: ' + rank, { size: 75, fill: "#228B22", stroke: "#FFFFFF", strokeThickness: 6 }); rankTxt.anchor.set(0, 0); rankTxt.x = timerTxt.x + timerTxt.width + 180; rankTxt.y = scoreTxt.y; LK.gui.topCenter.addChild(rankTxt); var xpDisplayTxt = new Text2(xp + ' / ' + Math.floor(9 * Math.pow(1.20, rank - 1)), { size: 75, fill: "#228B22", stroke: "#FFFFFF", strokeThickness: 6 }); xpDisplayTxt.anchor.set(0, 0); xpDisplayTxt.x = rankTxt.x + 20; xpDisplayTxt.y = rankTxt.y + rankTxt.height + 20; LK.gui.topCenter.addChild(xpDisplayTxt); function updateXPDisplay() { var xpThreshold = Math.floor(9 * Math.pow(1.20, rank - 1)); xpDisplayTxt.setText(xp + ' / ' + xpThreshold); } function addXP(amount) { if (amount > 0 && countdown > 0) { xp += amount; checkRankUp(); updateXPDisplay(); } } var timer = LK.setInterval(function () { countdown--; if (countdown >= 0) { timerTxt.setText(countdown.toString()); xpDisplayTxt.visible = true; } else if (countdown === -1) { xpDisplayTxt.visible = false; var popup = new MerryChristmasPopup(score, function () { score += 1000; scoreTxt.setText('Score: ' + score); popup.destroy(); }); self.addChild(popup); self.addChildAt(santa, self.children.length); countdown = -2; } else { timerTxt.visible = false; buttons.forEach(function (button) { button.destroy(); }); buttons = []; } }, 1000); var houses = []; var houseSpawnRate = 1; var buttons = []; self.spawnButtons = function () { buttons.forEach(function (button) { button.destroy(); }); buttons = []; var powerups = [{ label: 'Throw Faster!', action: function () { presentFireRate *= 0.65; } }, { label: 'Dash Around!', action: function () { santa.moveSpeed *= 2.08; } }, { label: 'More Time!', action: function () { countdown += 15; timerTxt.setText(countdown.toString()); } }, { label: 'Present Frenzy!', action: function () { startPresentFrenzy(); } }, { label: 'Human Kindness!', action: function () { humanKindnessActive = true; } }, { label: 'Naughty Bounce!', action: function () { NaughtyHouse.prototype.requiredHitCount++; } }, { label: 'Just Points!', action: function () { score += Math.ceil(score * 0.2); scoreTxt.setText('Score: ' + score); } }, { label: 'More Houses!', action: function () { houseSpawnRate *= 0.5; } }].filter(function (powerup) { if (powerup.label === 'Just Points!' && rank <= 4) { return false; } if (powerup.label === 'Present Frenzy!' && rank <= 6) { return false; } if (powerup.label === 'Dash Around!' && rank >= 5) { return false; } if (powerup.label === 'Throw Faster!' && rank >= 7) { return false; } return true; }); var chosenPowerups = powerups.sort(function () { return Math.random() - Math.random(); }).slice(0, 2); chosenPowerups.forEach(function (powerup, index) { var button = new Button(powerup.label, function () { powerup.action(); buttons.forEach(function (btn) { btn.destroy(); }); }); button.x = 2048 / 2 + (index === 0 ? -375 : 375); button.y = 2732 / 2 - 350; buttons.push(button); self.addChild(button); }); }; self.spawnHouse = function () { var nextSpawnTime = (Math.random() * 700 + 700) * houseSpawnRate; var houseWidth = 3.5 * self.createAsset('niceHouse', 'Nice House Graphics', .5, .5).width; var newHouseX = Math.random() * (2048 - houseWidth) + houseWidth / 2; var houseHeight = self.createAsset('niceHouse', 'Nice House Graphics', .5, .5).height; var newHouseY = -Math.random() * 500 - houseHeight; var canSpawn = true; for (var i = 0; i < houses.length; i++) { var house = houses[i]; if (Math.abs(newHouseX - house.x) < house.width * 1.5 && Math.abs(newHouseY - house.y) < house.height * 1.5) { canSpawn = false; break; } } if (canSpawn) { var houseTypes = [NaughtyHouse, NiceHouse]; var naughtyCount = houses.reduce(function (acc, house) { return acc + (house instanceof NaughtyHouse ? 1 : 0); }, 0); var randomIndex; if (humanKindnessActive && naughtyCount % 3 === 0) { randomIndex = 1; } else { randomIndex = Math.random() < 0.5 ? 0 : 1; } var house = new houseTypes[randomIndex](); house.x = newHouseX; house.y = newHouseY; houses.push(house); if (houses.length > 30) { var oldestHouse = houses.shift(); oldestHouse.destroy(); } var buttonIndex = buttons.length > 0 ? self.children.indexOf(buttons[0]) : self.children.length; buttonIndex = buttonIndex === -1 ? self.children.length : buttonIndex; self.addChildAt(house, buttonIndex); self.addChildAt(santa, self.children.length); } if (countdown > 2) { LK.setTimeout(self.spawnHouse, nextSpawnTime); } }; self.spawnHouse(); var houses = []; var presents = []; var santa = self.addChild(new Santa()); santa.x = 2048 / 2; santa.y = 2732 - 2732 * 0.1; var presentFireRate = 52.5; var presentFireCounter = 0; var moveInterval; stage.on('down', function (obj) { var pos = obj.event.getLocalPosition(self); santa.move(pos); if (moveInterval) { LK.clearInterval(moveInterval); } moveInterval = LK.setInterval(function () { var newPos = obj.event.getLocalPosition(self); santa.move(newPos); }, 300); }); stage.on('up', function (obj) { if (moveInterval) { LK.clearInterval(moveInterval); moveInterval = null; } }); LK.on('tick', function () { for (var i = snowflakes.length - 1; i >= 0; i--) { var snowflake = snowflakes[i]; snowflake.move(); if (snowflake.y > 2732 || snowflake.x < -50 || snowflake.x > 2098) { snowflake.destroy(); snowflakes.splice(i, 1); } } if (LK.ticks % 15 === 0) self.spawnSnowflake(); santa.move(); if (countdown > 0 && presentFireCounter++ >= presentFireRate) { var present = new Present(); present.x = santa.x; present.y = santa.y; if (allowPresentAngle) { var angle = (Math.random() * 20 + 80) * (Math.PI / 180); present.speedX = present.speed * Math.cos(angle); present.speedY = present.speed * Math.sin(angle); } else { present.speedX = 0; present.speedY = present.speed; } if (presents.length >= 15) { var oldestPresent = presents.shift(); oldestPresent.destroy(); } presents.push(present); var buttonIndex = buttons.length > 0 ? self.children.indexOf(buttons[0]) : self.children.length; buttonIndex = buttonIndex === -1 ? self.children.length : buttonIndex; self.addChildAt(present, buttonIndex); presentFireCounter = 0; } for (var i = presents.length - 1; i >= 0; i--) { var present = presents[i]; if (LK.ticks - present.lastMoved > 6) { present.destroy(); presents.splice(i, 1); continue; } present.move(); for (var j = houses.length - 1; j >= 0; j--) { var house = houses[j]; if (house instanceof NaughtyHouse && present.intersects(house) && !present.isCounter && LK.ticks - present.creationTime <= 240) { house.hitCount = (house.hitCount || 0) + 1; if (house.hitCount >= (NaughtyHouse.prototype.requiredHitCount || 1)) { var darkHouse = new DarkHouse(); darkHouse.x = house.x; darkHouse.y = house.y; darkHouse.shake(); houses[j] = darkHouse; self.addChild(darkHouse); self.addChildAt(santa, self.children.length); score = Math.max(0, score - 1); scoreTxt.setText('Score: ' + score); house.destroy(); } else { var counterPresent = house.spawnCounterPresent(); presents.push(counterPresent); self.addChild(counterPresent); } present.destroy(); presents.splice(i, 1); break; } else if (house instanceof HappyHouse && santa.intersects(house)) { if (!house.collisionStartTime) { house.collisionStartTime = LK.ticks; } if (LK.ticks - house.collisionStartTime >= 30) { score += 2; addXP(2); scoreTxt.setText('Score: ' + score); santa.temporarilyGrow(); house.destroy(); houses.splice(j, 1); } } else if (house instanceof NiceHouse && present.intersects(house) && LK.ticks - present.creationTime <= 240) { house.hitCount++; house.hitByPresent(); score++; addXP(1); scoreTxt.setText('Score: ' + score); present.destroy(); presents.splice(i, 1); if (house.hitCount >= 3) { var happyHouse = new HappyHouse(); happyHouse.x = house.x; happyHouse.y = house.y; houses[j] = happyHouse; self.addChild(happyHouse); self.addChildAt(santa, self.children.length); happyHouse.bounce(); house.destroy(); } break; } } if (score > 1000) { LK.showGameOver(); } } for (var i = houses.length - 1; i >= 0; i--) { var house = houses[i]; if (LK.ticks - house.lastMoved > 6) { house.destroy(); houses.splice(i, 1); continue; } house.move(); if (house.y > 2732 + house.height) { houses.splice(i, 1); } } }); });
===================================================================
--- original.js
+++ change.js
@@ -19,8 +19,9 @@
wrappedText += currentLine.trim();
return wrappedText;
}
var allowPresentAngle = false;
+NaughtyHouse.prototype.requiredHitCount = 1;
var MerryChristmasPopup = Container.expand(function (score, onDismiss) {
var self = Container.call(this);
var background = self.createAsset('popupBackground', 'Popup Background', 0.5, 0.5);
background.width = 2048 * 0.85;
@@ -143,9 +144,8 @@
};
});
var NaughtyHouse = Container.expand(function () {
var self = Container.call(this);
- this.hitpoints = 1;
NaughtyHouse.prototype.spawnCounterPresent = function () {
var counterPresent = new Present();
counterPresent.x = this.x;
counterPresent.y = this.y;
@@ -491,9 +491,9 @@
}
}, {
label: 'Naughty Bounce!',
action: function () {
- NaughtyHouse.prototype.hitpoints += 1;
+ NaughtyHouse.prototype.requiredHitCount++;
}
}, {
label: 'Just Points!',
action: function () {
@@ -647,10 +647,10 @@
present.move();
for (var j = houses.length - 1; j >= 0; j--) {
var house = houses[j];
if (house instanceof NaughtyHouse && present.intersects(house) && !present.isCounter && LK.ticks - present.creationTime <= 240) {
- house.hitpoints--;
- if (house.hitpoints <= 0) {
+ house.hitCount = (house.hitCount || 0) + 1;
+ if (house.hitCount >= (NaughtyHouse.prototype.requiredHitCount || 1)) {
var darkHouse = new DarkHouse();
darkHouse.x = house.x;
darkHouse.y = house.y;
darkHouse.shake();
overhead view of simple box house christmas decorations giant christmas tree out front video game asset 2d blank background Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
overhead view of drab house with giant prohibition symbol snowy lawn video game asset 2d blank background Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
overhead view of charred remains of a completely burned down box house snowy lawn video game asset 2d blank background Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Santa on sleigh pulled by reindeer blank background no shadows flying forward away straight top down Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
simple red christmas ornament 2d blank background high contrast no shadows in game asset Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
simple snowflake In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
old white scroll unfurled blank no shadows Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
top down simple wrapped red present with gold bow. 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.
top down plate of cookies glass of milk. In-Game asset. Blank background. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.