User prompt
Remove the house move method, and don’t call it in tick
User prompt
After you define isGameOver spawn 8 houses
User prompt
After the spawn house method has been defined, spawn 8 houses
User prompt
Spawn 8 houses after you defined the spawn house method
User prompt
Fix Bug: 'TypeError: self.spawnHouse is not a function. (In 'self.spawnHouse()', 'self.spawnHouse' is undefined)' in this line: 'self.spawnHouse();' Line Number: 25
User prompt
Spawn 8 houses on startup
User prompt
Spawn 8 houses on startup
User prompt
Set new house y, to the last house in the house array minus a random value between 1/3 to 2/3 of the game height
User prompt
Add new method to game that spawns a new house
User prompt
Delete the code that spawns new houses
User prompt
Add a method that spawns the new houses
User prompt
Add a new simple container to game. Just use new Container. This container will contain Santa and houses
User prompt
Add a simple house container
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'houses[a].move')' in this line: 'houses[a].move();' Line Number: 35
User prompt
Fix Bug: 'TypeError: santa.update is not a function. (In 'santa.update()', 'santa.update' is undefined)' in this line: 'santa.update();' Line Number: 30
Initial prompt
Planet hopper
var Santa = Container.expand(function () {
var self = Container.call(this);
var santaGraphics = self.createAsset('santa', 'Santa character', .5, .5);
self.speed = 5;
self.jump = function () {};
self.move = function () {};
});
var House = Container.expand(function () {
var self = Container.call(this);
var houseGraphics = self.createAsset('house', 'House object', .5, .5);
self.speed = -5;
self.move = function () {};
});
var Game = Container.expand(function () {
var self = Container.call(this);
LK.stageContainer.setBackgroundColor(0x000000);
var santa = self.addChild(new Santa());
santa.x = 2048 / 2;
santa.y = 2732 / 2;
var houses = [];
var scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"
});
scoreTxt.anchor.set(.5, 0);
LK.gui.topCenter.addChild(scoreTxt);
var isGameOver = false;
var tickOffset = 0;
LK.on('tick', function () {
santa.update();
if (isGameOver) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
for (var a = houses.length; a >= 0; a--) {
houses[a].move();
if (houses[a].x < -50) {
houses[a].destroy();
houses.splice(a, 1);
}
}
if (tickOffset++ % 30 == 0) {
var newHouse = new House();
newHouse.x = 2048;
newHouse.y = 2732 / 2;
houses.push(newHouse);
self.addChild(newHouse);
}
});
santa.on('down', function (obj) {
santa.jump();
});
});
Circular Santa, with gifts on his back. Cartoon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Perfectly round planet looking like a house, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
round house planet, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
round house planet, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
round house planet, cartoon 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.
round house planet, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast.
round house planet, cartoon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Starry Christmas night sky, cartoon, background