User prompt
add a presents counter, santa can only carry 10 presents at a time
User prompt
when santa collides with a hazard, decrese only one life, and destroy the hazard
User prompt
decrese only one life when santa collides with hazard
User prompt
decrese one life when santa collides with hazard
User prompt
when santa collides with a hazard, hazard should dissapear
User prompt
stars should appear on the top eight tenths of the screen
User prompt
add even more stars
User prompt
add more stars
User prompt
add stars that move from right to left and simulate a sense of speed
User prompt
if santa collides with hazard loose only 1 life. when reach 0 lives is game over
User prompt
if santa collides with hazard loose one life
User prompt
add lives counter on the top left
User prompt
if santa collides with hazard then its game ovver
User prompt
if present collides with hazard the present is destroyed
User prompt
hazards should always spawn from the right of the screen
User prompt
player can only move on the top eight tenths of the screen
User prompt
hazards should appear on the top eight tenths of the screen
User prompt
hazards should spawn one pixel above the chimney
User prompt
add hazards flying from right to left. they should start moving right above the chimneys line
User prompt
once a present is delivered to a chimney, that chimney can not receive another present and it should change its color
User prompt
add only one point to score when present is delivered
User prompt
add only 1 point when a present is delivered
User prompt
remove needs present from chimney
User prompt
update score when present is delivered
User prompt
do not update score on click
===================================================================
--- original.js
+++ change.js
@@ -11,18 +11,23 @@
});
var Santa = Container.expand(function () {
var self = Container.call(this);
var santaGraphics = self.createAsset('santa', 'Santa character', .5, .5);
+ self.presentsCarried = 0;
+ self.maxPresents = 10;
self.move = function (pos) {
self.x += (pos.x - self.x) * 0.1;
self.y += (pos.y - self.y) * 0.1;
};
self.throwPresent = function () {
- var present = new Present();
- present.x = this.x;
- present.y = this.y;
- this.parent.addChild(present);
- this.parent.presents.push(present);
+ if (self.presentsCarried < self.maxPresents) {
+ var present = new Present();
+ present.x = this.x;
+ present.y = this.y;
+ this.parent.addChild(present);
+ this.parent.presents.push(present);
+ self.presentsCarried++;
+ }
};
});
var Present = Container.expand(function () {
var self = Container.call(this);
@@ -118,8 +123,9 @@
chimney.tint = chimney.presentDeliveredTint;
var newScore = LK.getScore() + 1;
LK.setScore(newScore);
scoreTxt.setText(newScore.toString());
+ santa.presentsCarried--;
}
});
});
chimneys = chimneys.filter(function (chimney) {
8-bit cloud with lightning. in game asset. white cloude. yellow lighning. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
8 bit x mas pressent. in game asset. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
8-bit. cartoon. santa on sledge. smiling. in game asset. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.