User prompt
Presents can only travel 500 pixels before they despawn
User prompt
Make human kindness a little bit less effective at turning naughty houses nice
User prompt
If a player gets a second present frenzy while the first is still active, simply add 7 seconds to the remaining time on the first without triggering a new present frenzy.
User prompt
Make the powerup description text 50% larger
User prompt
Change the Human Kindness description to "More nice houses" Change the Naughty Deflector description to "Avoid naughty houses" Change the Joyous description to "More points now" Change the Time Zones description to "More time to fly" Change the City Flying description to "Denser houses"
User prompt
Change the Present Frenzy description to "A barrage of presents"
User prompt
Create an array entry for every powerup's description text. If text doesn't exist, create it.
User prompt
The description text for Time Zones reads "More time to fly"
User prompt
The description text for City Flying reads "More houses"
User prompt
Create a powerup called "City Flying!" description "More houses" that increases the house spawn rate by 50%
User prompt
Make houses move faster
User prompt
Make santa's base rate of fire just a smidge faster
User prompt
Make santa's base speed slightly faster
User prompt
Fix Bug: 'TypeError: self.updateHouseSpeeds is not a function' in this line: 'self.updateHouseSpeeds(1.5);' Line Number: 291
User prompt
Why didn't the rocket sleigh powerup work?
User prompt
Create a powerup called "Rocket Sleigh!" description "Go faster" that immediately adds 50% to the movement speed of all four types of houses so that the player sees the houses moving faster as soon as he selects this powerup
User prompt
Create a powerup called "Rocket Sleigh!" description "Go faster" that Increases NaughtyHouse movement speed by 35% Increases NiceHouse movement speed by 35% Increases HappyHouse movement speed by 35% and Increases DarkHouse movement speed by 35%
User prompt
Houses move 35% faster
User prompt
Create a powerup called "Rocket Sleigh!" description "Go faster" that makes the game play at 40% faster speed
User prompt
Create a powerup called "Rocket Sleigh!" description "Go faster" that instantly makes all houses move 2 speed faster
User prompt
Fix Bug: 'Timeout.tick error: Maximum call stack size exceeded' in this line: 'self.spawnHouse();' Line Number: 295
User prompt
Fix Bug: 'Timeout.tick error: Maximum call stack size exceeded' in this line: 'LK.setTimeout(self.spawnHouse, nextSpawnTime);' Line Number: 293
User prompt
Create a powerup called "Rocket Sleigh!" description "Go faster" that doubles the speed of houses and doubles the spawn rate of houses
User prompt
Double the speed of houses and double the spawn rate of houses
User prompt
Fix Bug: 'Error: [object Object]addChildAt: The index undefined supplied is out of bounds 10' in this line: 'self.addChildAt(darkHouse, buttonIndex);' Line Number: 382
var allowPresentAngle = false; 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(4); 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: 50, fill: '#ffffff', align: 'center' }); nameLabel.anchor.set(0.5); nameLabel.y = -buttonGraphics.height / 2 - (label.length > 12 ? 25 : 0) + 40; 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: 30, fill: '#ffffff' }); descriptionLabel.anchor.set(0.5); descriptionLabel.y = buttonGraphics.height / 2 + 240; if (label === 'Pitching Arm!') { descriptionLabel.setText('Throw more presents'); } else if (label === 'More Reindeer!') { descriptionLabel.setText('Fly faster'); } else if (label === 'Time Zones!') { descriptionLabel.setText('Add 10 seconds'); } 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); var presentGraphics = self.createAsset('present', 'Present Graphics', .5, .5); self.speed = -10; 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.lastMoved = LK.ticks; if (self.counterLifetime && LK.ticks > self.counterLifetime) { 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.tint = 0xFF0000; self.speed = 2; 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); var houseGraphics = self.createAsset('niceHouse', 'Nice House Graphics', .5, .5); houseGraphics.tint = 0x00FF00; self.speed = 2; 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); var houseGraphics = self.createAsset('happyHouse', 'Happy House Graphics', .5, .5); houseGraphics.tint = 0xFFFF00; self.speed = 2; 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.tint = 0x808080; self.speed = 2; 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); var santaGraphics = self.createAsset('santa', 'Santa Graphics', .5, .5); self.targetPosition = null; self.moveSpeed = 5; 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); if (distance > 1) { 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 { if (self.targetPosition.y > 2732 - 2732 / 3) { self.x = self.targetPosition.x; self.y = self.targetPosition.y; } self.targetPosition = null; } } }; }); var Game = Container.expand(function () { var self = Container.call(this); function startPresentFrenzy() { var originalFireRate = presentFireRate; var originalPresentSpeed = Present.prototype.speed; presentFireRate /= 5; Present.prototype.speed *= 2; var frenzyTimeout = LK.setTimeout(function () { presentFireRate = originalFireRate; Present.prototype.speed = originalPresentSpeed; allowPresentAngle = false; }, 7000); allowPresentAngle = true; } function checkRankUp() { var xpThreshold = Math.floor(6 * Math.pow(1.20, rank - 1)); if (xp >= xpThreshold) { rank++; xp = 0; rankTxt.setText('Rank: ' + rank); updateXPDisplay(); self.spawnButtons(); } } var countdown = 100; var score = 0; var naughtyToNiceConversionRate = 3; var humanKindnessActive = false; var scoreTxt = new Text2('Score: ' + score, { size: 75, fill: "#ffffff" }); scoreTxt.anchor.set(0, 0); scoreTxt.x += 50; scoreTxt.y += 30; LK.gui.topLeft.addChild(scoreTxt); var timerTxt = new Text2(countdown.toString(), { size: 150, fill: "#ffffff" }); 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: "#ffffff" }); 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(6 * Math.pow(1.20, rank - 1)), { size: 75, fill: "#ffffff" }); 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(6 * Math.pow(1.20, rank - 1)); xpDisplayTxt.setText(xp + ' / ' + xpThreshold); } function addXP(amount) { if (amount > 0) { xp += amount; checkRankUp(); } updateXPDisplay(); } var timer = LK.setInterval(function () { countdown--; timerTxt.setText(countdown.toString()); if (countdown <= 0) { LK.clearInterval(timer); LK.showGameOver(); } }, 1000); var houses = []; var buttons = []; self.spawnButtons = function () { buttons.forEach(function (button) { button.destroy(); }); buttons = []; var powerups = [{ label: 'Pitching Arm!', action: function () { presentFireRate *= 0.65; } }, { label: 'More Reindeer!', action: function () { santa.moveSpeed *= 1.6; } }, { label: 'Time Zones!', action: function () { countdown += 10; timerTxt.setText(countdown.toString()); } }, { label: 'Present Frenzy!', action: function () { startPresentFrenzy(); } }, { label: 'Human Kindness!', action: function () { humanKindnessActive = true; } }, { label: 'Naughty Deflector!', action: function () { NaughtyHouse.prototype.requiredHitCount = 2; } }, { label: 'Joyous!', action: function () { score += Math.ceil(score * 0.2); scoreTxt.setText('Score: ' + score); } }, { label: 'Rocket Sleigh!', action: function () { NaughtyHouse.prototype.speed += 2; NiceHouse.prototype.speed += 2; HappyHouse.prototype.speed += 2; DarkHouse.prototype.speed += 2; } }]; 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 ? -300 : 300); button.y = 2732 / 2 - 100; buttons.push(button); self.addChild(button); }); }; self.spawnHouse = function () { var nextSpawnTime = Math.random() * 1000 + 1000; var newHouseX = Math.random() * 2048; var newHouseY = -Math.random() * 500; var canSpawn = true; for (var i = 0; i < houses.length; i++) { var house = houses[i]; if (Math.abs(newHouseX - house.x) < house.width && Math.abs(newHouseY - house.y) < house.height) { 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 % 2 === 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); var buttonIndex = buttons.length > 0 ? self.children.indexOf(buttons[0]) : self.children.length; buttonIndex = buttonIndex === -1 ? self.children.length : buttonIndex; self.addChildAt(house, buttonIndex); } 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 = 81; var presentFireCounter = 0; stage.on('down', function (obj) { var pos = obj.event.getLocalPosition(self); santa.move(pos); }); LK.on('tick', function () { santa.move(); if (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; } 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) { 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; houses[j] = darkHouse; self.addChild(darkHouse); 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 NiceHouse && present.intersects(house)) { house.hitCount++; 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); house.destroy(); } break; } } if (present.y < -present.height) { present.destroy(); presents.splice(i, 1); } } 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
@@ -237,9 +237,8 @@
LK.showGameOver();
}
}, 1000);
var houses = [];
- self.shouldSpawnHouse = false;
var buttons = [];
self.spawnButtons = function () {
buttons.forEach(function (button) {
button.destroy();
@@ -284,16 +283,12 @@
}
}, {
label: 'Rocket Sleigh!',
action: function () {
- NaughtyHouse.prototype.speed *= 2;
- NiceHouse.prototype.speed *= 2;
- HappyHouse.prototype.speed *= 2;
- DarkHouse.prototype.speed *= 2;
- self.spawnHouse = function () {
- var nextSpawnTime = (Math.random() * 1000 + 1000) / 2;
- self.shouldSpawnHouse = true;
- };
+ NaughtyHouse.prototype.speed += 2;
+ NiceHouse.prototype.speed += 2;
+ HappyHouse.prototype.speed += 2;
+ DarkHouse.prototype.speed += 2;
}
}];
var chosenPowerups = powerups.sort(function () {
return Math.random() - Math.random();
@@ -356,13 +351,8 @@
var pos = obj.event.getLocalPosition(self);
santa.move(pos);
});
LK.on('tick', function () {
- if (self.shouldSpawnHouse) {
- var nextSpawnTime = Math.random() * 1000 + 1000;
- LK.setTimeout(self.spawnHouse, nextSpawnTime);
- self.shouldSpawnHouse = false;
- }
santa.move();
if (presentFireCounter++ >= presentFireRate) {
var present = new Present();
present.x = santa.x;
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.