User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of null (reading 'x')' in this line: 'newDagger.x = dragNode.x;' Line Number: 70
User prompt
after dropping a dagger, the next one's horizontal position should start from the same place as the rpevious one that was just dropped
User prompt
regardless of the number of available of daggers I have per level, I should only see just one at a time, sliding horizontally on the screen. After releasign it, only then the next one loads.
User prompt
i cant seem to be able to drop the first dagger
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'y')' in this line: 'if (dragNode && !dragNode.isDropping && daggers[daggers.indexOf(dragNode) - 1].y >= 2732) {' Line Number: 80
User prompt
I should only be able to drop the next dagger after the previous one has hitthe bottom of the screen
User prompt
the first dagger drops just fine, but the next daggers doesnt laod so I can drop it
User prompt
right now the level ends after using the first dagger. the level should only end after I consume all the available daggers.
User prompt
regardless of hte number of starting daggers, the player must always 1 see the active one that's sliding from left to right on the screen. after tha active daggers hits the bottom of the screen. reload the ext daggerinto the sliding place from twhere daggers drop
User prompt
I want the player to start with 5 daggers instead of 1
User prompt
level 1 has to start with 3 targets, and level 2 has to have 4 targets and level 3 must have 5 targets and so on
User prompt
level 1 has to start wth 3 targets
User prompt
level 2 starts with just 1 target when instead it should start with 4 ballons by the logic provided previously
User prompt
level 1 has to start with 3 targets. then after each level increase, also incease th nubmer of targets by 1. so level 1 has 3 targets. level 2 has 4 targets. level 3 has 5 targets and so on
User prompt
something is wrong. level 1 has to start with 3 targets. then after each level increase, also incease th nubmer of targets by 1. so level 1 has 3 targets. level 2 has 4 targets. level 3 has 5 targets and so on
User prompt
make sure there's always a 10 pixels vertical gap between each created target. in level 1 this gap is higher. all targets must ALWAYS have no more and no less than a 10 pixels gap betweem thmeselves, alway being equally distanced between each other
User prompt
make sure there's always a 10 pixels vertical gap between each created balloon.
User prompt
change the starting position of the 1st target to 1500 pixels
User prompt
change the starting position of the 1st target to 1000 pixels
User prompt
change the starting position of the 1st target to 600 pixels
User prompt
change the starting position of the 1st target to 700 pixels
User prompt
change the starting position of the 1st target to 800 pixels
User prompt
why does level 1 start with 2 targets when I specifically asked it to start with 3?
User prompt
show the level in the ui
User prompt
move all the balloons in all the levels 300 pixels lower
var Dagger = Container.expand(function () { var self = Container.call(this); self.visible = false; var daggerGraphics = self.createAsset('dagger', 'Dagger Graphics', .5, .5); self.speed = 22 * 1.1; self.direction = 1; self.move = function () { if (!self.isDropping) { if (self.x > 2048 - self.width / 2) { self.x = 2048 - self.width / 2; self.direction *= -1; } else if (self.x < self.width / 2) { self.x = self.width / 2; self.direction *= -1; } self.x += self.speed * self.direction; } else { self.y += self.speed / 2; } }; self.isDropping = false; self.drop = function () { if (self.isDropping) { self.y += self.speed / 2; } }; }); var Target = Container.expand(function (index) { var self = Container.call(this); var targetGraphics = self.createAsset('target', 'Target Graphics', .5, .5); self.direction = index % 2 === 0 ? -1 : 1; self.speed = 2 * 3 * 1.25 * 0.9; self.move = function () { if (self.x > 2048 - self.width / 2) { self.x = 2048 - self.width / 2; self.direction *= -1; } else if (self.x < self.width / 2) { self.x = self.width / 2; self.direction *= -1; } self.x += self.speed * self.direction; }; LK.on('tick', function () { self.move(); }); }); var Game = Container.expand(function () { var self = Container.call(this); var daggers = []; var currentScore = 0; var targets = []; var currentScore = 0; var scoreTxt = new Text2(currentScore.toString(), { size: 150, fill: "#ffffff" }); scoreTxt.anchor.set(.5, 0); LK.gui.topCenter.addChild(scoreTxt); var targetSpacing = 150; for (var i = 0; i < 14; i++) { var target = self.addChild(new Target(i)); target.x = Math.random() * 2048; target.y = 2732 / 2 - i * targetSpacing + 1200 + 100; targets.push(target); } var dragNode = null; var isGameOver = false; var tickOffset = 0; var newDagger = new Dagger(); if (dragNode) { newDagger.x = dragNode.x; } else { newDagger.x = 2048 / 2; } newDagger.y = 2732 / 4 - 200; daggers.push(newDagger); self.addChild(newDagger); dragNode = newDagger; newDagger.isDropping = false; newDagger.visible = true; stage.on('down', function (obj) { if (dragNode && !dragNode.isDropping) { dragNode.isDropping = true; if (daggers.length < 5) { var newDagger = new Dagger(); newDagger.x = 2048 / 2; newDagger.y = 2732 / 4 - 200; daggers.push(newDagger); self.addChild(newDagger); dragNode = newDagger; newDagger.visible = true; } else { dragNode = null; } } }); LK.on('tick', function () { for (var a = daggers.length - 1; a >= 0; a--) { if (daggers[a]) { daggers[a].move(); daggers[a].drop(); } for (var b = targets.length - 1; b >= 0; b--) { if (daggers[a].intersects(targets[b])) { self.removeChild(targets[b]); targets.splice(b, 1); currentScore += 10; scoreTxt.setText(currentScore.toString()); break; } } if (daggers[a] && daggers[a].y > 2732) { daggers[a].destroy(); daggers.splice(a, 1); isGameOver = true; } } if (isGameOver && daggers.length === 0) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } else {} }); });
===================================================================
--- original.js
+++ change.js
@@ -66,9 +66,13 @@
var dragNode = null;
var isGameOver = false;
var tickOffset = 0;
var newDagger = new Dagger();
- newDagger.x = dragNode.x;
+ if (dragNode) {
+ newDagger.x = dragNode.x;
+ } else {
+ newDagger.x = 2048 / 2;
+ }
newDagger.y = 2732 / 4 - 200;
daggers.push(newDagger);
self.addChild(newDagger);
dragNode = newDagger;
dagger pointing down Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. pixel. 8 bit
pixelated cloudy sky Single Game Texture. In-Game background. 2d. High contrast. No shadows. 8 bit
white round cloud burst. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.8 bit. pixelated
colored text saying (EDGY). Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. pixelated. 8 bit
colored text saying (SHARP). Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. pixelated. 8 bit. retro
colored text saying (DEADLY). sharp dagger edges around the text. pixelated. 8 bit. retro Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
cute red balloon. looking up. feeling scared. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. pixel. 8 bit