User prompt
enemy should spawn further away from the boundary
User prompt
Make Santa bounce a little bit later by adjusting the boundary check
User prompt
Make Santa bounce a little bit earlier by adjusting the boundary check
User prompt
when santa outside of boundary, reset santa in the initial position
User prompt
Flip Santa asset vertically when left clicking
User prompt
Flip Santa asset horizontally when left clicking
User prompt
Flip Santa asset vertically when changing direction
User prompt
Flip Santa visual vertically when left clicking
User prompt
when projectile collides with specialobject, destroy projectile
User prompt
make santa bounce a little bit earlier
User prompt
projectile shoot in an arc
User prompt
projectile shoot in a vertical arc
User prompt
make the projectile shoot in an arc
User prompt
Flip Santa visual vertically when changing direction
User prompt
Flip Santa horizontally when changing direction
User prompt
flip santa horizontally instead of vertically
User prompt
when santa changes direction, flip santa vertically
User prompt
on left click including the already available stuff, make sure santa flips vertically
User prompt
on left click flip santa vertically
User prompt
on left click flip santa horizontally 180 degrees
User prompt
on left click, flip santa
User prompt
the screen effect is gray
User prompt
all text is now orange
User prompt
all text is now black
User prompt
specialobject creates itself if the score is equal or higher than 13
var SpecialObject = Container.expand(function () {
var self = Container.call(this);
var specialObjectGraphics = self.createAsset('specialObject', 'Special Object', .5, .5);
specialObjectGraphics.scale.x *= 4;
self.speed = 0.5;
self.move = function () {
self.y += self.speed;
};
});
var GraySquare = Container.expand(function () {
var self = Container.call(this);
var graySquareGraphics = self.createAsset('graySquare', 'Gray Square', .5, .5);
graySquareGraphics.width = 150;
graySquareGraphics.height = 150;
graySquareGraphics.tint = 0x808080;
});
var GreenPowerup = Container.expand(function () {
var self = Container.call(this);
var powerupGraphics = self.createAsset('greenPowerup', 'Green Powerup', .5, .5);
self.amplitude = 10;
self.frequency = 0.05;
self.baseY = self.y;
self.move = function () {
self.y = self.baseY + self.amplitude * Math.sin(LK.ticks * self.frequency);
};
});
var BloodSplatter = Container.expand(function () {
var self = Container.call(this);
var scale = (0.5 + Math.random() * 0.5) * 2.5;
var splatterGraphics = self.createAsset('bloodSplatter', 'Blood splatter effect', .5, .5);
splatterGraphics.scale.set(scale, scale);
self.lifeSpan = 500;
self.on('tick', function () {
self.lifeSpan -= 16.6667;
if (self.lifeSpan <= 0) {
LK.setTimeout(function () {
self.destroy();
}, 3000);
}
});
});
var Santa = Container.expand(function () {
var self = Container.call(this);
var santaGraphics = self.createAsset('santa', 'Santa character', .5, .5);
santaGraphics.rotation = -Math.PI / 2;
self.direction = 1;
self.speed = 15;
self.move = function () {
if (self.x >= 2048 - this.width / 2 || self.x <= this.width / 2) {
self.direction *= -1;
}
self.x += self.speed * self.direction;
};
self.fire = function () {
this.direction *= -1;
};
});
var Bullet = Container.expand(function () {
var self = Container.call(this);
var scale = 0.5 + Math.random() * 0.5;
var bulletGraphics = self.createAsset('bullet', 'Bullet Graphics', .5, .5);
bulletGraphics.scale.set(scale, scale);
self.speed = 20;
self.move = function () {
self.y -= self.speed;
};
});
var YellowEnemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.createAsset('yellowEnemy', 'Yellow Enemy character', .5, .5);
self.speed = 3;
self.move = function () {
self.y += self.speed;
if (self.y > 2732) {
self.destroy();
}
};
});
var BlueEnemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.createAsset('blueEnemy', 'Blue Enemy character', .5, .5);
self.speed = 5;
self.move = function () {
self.y += self.speed;
if (self.y > 2732) {
self.destroy();
}
};
});
var RedEnemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.createAsset('redEnemy', 'Red Enemy character', .5, .5);
self.speed = 8;
self.move = function () {
self.y += self.speed;
if (self.y > 2732) {
self.destroy();
}
};
});
var Game = Container.expand(function () {
var self = Container.call(this);
var background = self.createAsset('background', 'Game background', 0, 0);
background.width = 2048;
background.height = 2732;
self.addChildAt(background, 0);
var santa = self.addChild(new Santa());
var greenPowerup;
var greenPowerupSpawnTimer;
var score = 0;
var specialObject;
var specialObjectSpawned = false;
var scoreTxt = new Text2(score.toString(), {
size: 100,
fill: "#ffffff"
});
scoreTxt.y += 94;
scoreTxt.anchor.set(.5, 0);
LK.gui.topCenter.addChild(scoreTxt);
var remainingBulletsTxt = new Text2('Bullets: 4', {
size: 70,
fill: "#ffffff"
});
remainingBulletsTxt.y = scoreTxt.height + 114;
remainingBulletsTxt.anchor.set(0.5, 0);
LK.gui.topCenter.addChild(remainingBulletsTxt);
var bullets = [];
var enemies = [];
santa.x = 2048 / 2;
santa.y = 2732 - santa.height;
var spawnEnemy = function () {
var enemyType = Math.random();
var enemy;
if (enemyType < 0.33) {
enemy = new YellowEnemy();
} else if (enemyType < 0.66) {
enemy = new BlueEnemy();
} else {
enemy = new RedEnemy();
}
enemy.x = Math.random() * 2048;
enemy.y = 0;
enemies.push(enemy);
if (specialObject && specialObject.parent === self) {
self.addChildAt(enemy, self.getChildIndex(specialObject));
} else {
if (specialObject && specialObject.parent === self) {
self.addChildAt(enemy, self.getChildIndex(specialObject) - 1);
} else {
self.addChild(enemy);
}
}
};
var fireBullet = function () {
if (bullets.length < 4) {
santa.fire();
var bullet = new Bullet();
bullet.x = santa.x;
bullet.y = santa.y - santa.height / 2 - bullet.height / 2;
var graySquare = new GraySquare();
graySquare.x = bullet.x;
graySquare.y = bullet.y + 50;
self.addChild(graySquare);
LK.setTimeout(function () {
graySquare.destroy();
}, 500);
bullets.push(bullet);
self.addChild(bullet);
bullet.move();
remainingBulletsTxt.setText('Bullets: ' + (4 - bullets.length).toString());
}
};
stage.on('down', function (obj) {
fireBullet();
});
LK.on('tick', function () {
santa.move();
bullets.forEach(function (bullet, bulletIndex) {
bullet.move();
if (bullet.y < -bullet.height) {
bullet.destroy();
bullets.splice(bulletIndex, 1);
remainingBulletsTxt.setText('Bullets: ' + (4 - bullets.length).toString());
return;
}
enemies.forEach(function (enemy, enemyIndex) {
if (bullet.intersects(enemy)) {
bullet.destroy();
var splatter = new BloodSplatter();
splatter.x = enemy.x;
splatter.y = enemy.y;
self.addChild(splatter);
enemy.destroy();
enemies.forEach(function (e) {
e.speed *= 1.1;
});
score += 1;
if (score >= 13 && !specialObjectSpawned) {
specialObject = new SpecialObject();
specialObject.x = 2048 / 2;
specialObject.y = -1300;
self.addChild(specialObject);
specialObjectSpawned = true;
}
scoreTxt.setText(score.toString());
santa.speed += 1;
bullets.splice(bulletIndex, 1);
enemies.splice(enemyIndex, 1);
remainingBulletsTxt.setText('Bullets: ' + (4 - bullets.length).toString());
} else if (greenPowerup && bullet.intersects(greenPowerup)) {
bullets.splice(bulletIndex, 1);
bullet.destroy();
enemies.forEach(function (e) {
var splatter = new BloodSplatter();
splatter.x = e.x;
splatter.y = e.y;
self.addChild(splatter);
e.destroy();
score += 1;
});
enemies.length = 0;
greenPowerup.destroy();
LK.effects.flashScreen(0xFFA500, 1000);
greenPowerup = undefined;
scoreTxt.setText(score.toString());
remainingBulletsTxt.setText('Bullets: ' + (4 - bullets.length).toString());
}
});
});
if (specialObject) {
specialObject.move();
if (santa.intersects(specialObject)) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
isGameOver = true;
}
}
enemies.forEach(function (enemy) {
enemy.move();
if (santa.intersects(enemy)) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
isGameOver = true;
}
});
});
var enemySpawnTimer = LK.setInterval(spawnEnemy, 1000);
greenPowerupSpawnTimer = LK.setInterval(function () {
if (greenPowerup && !greenPowerup.isDestroyed) {
return;
}
greenPowerup = new GreenPowerup();
var centerX = 2048 / 2;
var centerY = 2732 / 2;
var randomOffsetX = (Math.random() - 0.5) * 1200;
var randomOffsetY = (Math.random() - 0.5) * 1200;
greenPowerup.x = centerX + randomOffsetX - greenPowerup.width / 2;
greenPowerup.y = centerY + randomOffsetY - greenPowerup.height / 2;
greenPowerup.move = function () {
this.angle += 0.05;
this.x = this.center.x + this.radius * Math.cos(this.angle);
this.y = this.center.y + this.radius * Math.sin(this.angle);
};
self.addChild(greenPowerup);
}, 10000);
});
a top view of a 16 bit sprite santa with a bazooka Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
16 bit sprite of a christmas ornament Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
16 bit sprite of a red eyed christmas elf Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
16 bit sprite of a blood splatter Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
16 bit sprite of a red eye reindeer Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
16 bit sprite of a red eye mother christmas Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
16 bit top view background of a christmas field set in hell Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
16 bit smoke Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
16 bit wall of skulls with red eyes Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
"Death Is Inevitable" Text Bubble Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
16 bit CHRISTMAS bomb power up icon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.