User prompt
when a present is delivered to the chimney change the color of the chimney
User prompt
add condition to chimney to be delivered or not
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 41
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 41
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 41
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 41
User prompt
when present collides with chimeny mark as delivered
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'Uncaught ReferenceError: scoreTxt is not defined' in this line: 'scoreTxt.anchor.set(.5, 0);' Line Number: 85
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < self.presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < presents.length; i++) {' Line Number: 37
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var i = 0; i < presents.length; i++) {' Line Number: 37
User prompt
when present collides with chimney add a point
User prompt
hazards need to move like the chimeny
User prompt
hazards should move from right to left in the eight tenths of the screen. there should always be 5 hazards on screen
User prompt
invert present direction
===================================================================
--- original.js
+++ change.js
@@ -36,16 +36,14 @@
self.checkCollision = function () {};
});
var Hazard = Container.expand(function () {
var self = Container.call(this);
+ self.x -= self.speed;
+ if (self.x < -self.width) {
+ self.x = 2048;
+ }
var hazardGraphics = self.createAsset('hazard', 'Hazard', .5, .5);
- self.move = function () {
- if (self.x < 2048 - self.width) {
- self.x += 2;
- } else {
- self.x = -self.width;
- }
- };
+ self.move = function () {};
});
var Game = Container.expand(function () {
var self = Container.call(this);
var santa = self.addChild(new Santa());
@@ -53,8 +51,16 @@
santa.y = 0;
self.presents = [];
var chimneys = [];
var hazards = [];
+ var maxHazards = 5;
+ for (var i = 0; i < maxHazards; i++) {
+ var newHazard = new Hazard();
+ newHazard.x = 2048 + i * (2048 / maxHazards);
+ newHazard.y = 2732 * 0.8;
+ hazards.push(newHazard);
+ self.addChild(newHazard);
+ }
var scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"
});
@@ -88,8 +94,18 @@
}
for (var i = 0; i < hazards.length; i++) {
hazards[i].move();
}
+ hazards = hazards.filter(function (hazard) {
+ return hazard.x + hazard.width > 0;
+ });
+ while (hazards.length < maxHazards) {
+ var newHazard = new Hazard();
+ newHazard.x = 2048;
+ newHazard.y = 2732 * 0.8;
+ hazards.push(newHazard);
+ self.addChild(newHazard);
+ }
});
stage.on('move', function (obj) {
var pos = obj.event.getLocalPosition(self);
santa.move(pos);
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.