User prompt
fix the performance issue related to this.
User prompt
instead of spawning ballons when arrow hits the other ballons, spawn them at some interval
User prompt
there is some issue with the ballon spawning logic when wave changes, there should be only 2 ballons at a time when i am in wave 2, but it is spawning a lot.
User prompt
and also do not increase the movement speed of the ballons as the wave increases.
User prompt
change the wave logic to like, spawn the wave number of ballons at the same time.
User prompt
make arrow invincible
User prompt
player can shoot mulitple ballons with single arrow.
User prompt
fix the wave not changing issue, i want change the wave on every 50 points.
User prompt
solve the issue
User prompt
to collect the powerup player need to shoot arrow on the powerup
User prompt
on arrow can shoot multiple ballons.
User prompt
wave logic should be like this, if it is wave 2 then there will max two ballons can be spawn at the same time, if it is wave 3 there will be max 3 ballons can be spawned at the same time and so on.. and make the reduce the peak speed of the ballon movement.
User prompt
do not increase the movement speed of the ballons, when wave changes.
User prompt
reduce the max speed of ballons to go from bottom to up.
User prompt
on each ballon hit, give only 2 score.
User prompt
Also randomly spawn a power up, called Ballon bust which will destroy all the ballons spawned on the screen, when stickman collect the powerup.
User prompt
increase the rate of ballon spawn after each 50 points and, show the wave text for 2 sec at the middle of the screen.
User prompt
After all the ballon skips are finished, game over and show the final score.
User prompt
Stickman have 5 ballon skips, show as ballon on the top left of the screen, and whenever the stickman is not able to shoot the ballon and it reached the top then reduce the ballon skip by one.
User prompt
Now the targets are three types of ballons ( red , gree, and blue ) , they will randomly spawn from the bottom of the screen and with random speed they move from bottom to top.
User prompt
reduce the gravity little more.
User prompt
increase the shooting power of bow
User prompt
reduce the gravity little bit.
User prompt
Gravity is not working on the arrow after shoot. fix the issue.
User prompt
after click, stickman should be continue to rotate in the direction of the mouse pointer, untill released.
/****
* Classes
****/
//<Assets used in the game will automatically appear here>
// Arrow class
var Arrow = Container.expand(function () {
var self = Container.call(this);
var arrowGraphics = self.attachAsset('arrow', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 10;
self.update = function () {
// Apply physics
self.y += Math.sin(self.rotation) * self.speed;
self.x += Math.cos(self.rotation) * self.speed;
};
});
// Stickman class
var Stickman = Container.expand(function () {
var self = Container.call(this);
var stickmanGraphics = self.attachAsset('stickman', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Stickman can have some movement logic if needed
};
});
// Target class
var Target = Container.expand(function () {
var self = Container.call(this);
var targetGraphics = self.attachAsset('target', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Targets can have some movement logic if needed
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB // Sky blue background
});
/****
* Game Code
****/
var arrows = [];
var stickman = new Stickman();
stickman.x = 2048 / 2;
stickman.y = 2732 / 2;
game.addChild(stickman);
var targets = [];
var score = 0;
var scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Create initial target
function createTarget() {
var target = new Target();
target.x = Math.random() * 2048;
target.y = Math.random() * 1000 + 500;
targets.push(target);
game.addChild(target);
}
// Update score
function updateScore() {
scoreTxt.setText(score);
}
// Handle shooting arrows
game.down = function (x, y, obj) {
// Do nothing on mouse down
};
var isMouseDown = false;
game.down = function (x, y, obj) {
isMouseDown = true;
};
game.up = function (x, y, obj) {
if (isMouseDown) {
var arrow = new Arrow();
arrow.x = stickman.x;
arrow.y = stickman.y;
arrow.rotation = Math.atan2(stickman.y - y, stickman.x - x);
// Rotate the stickman in the direction of the drag
stickman.rotation = arrow.rotation;
// Calculate the distance between the stickman and the point where the drag was released
var distance = Math.sqrt(Math.pow(stickman.x - x, 2) + Math.pow(stickman.y - y, 2));
// Use this distance to set the speed of the arrow
arrow.speed = distance / 100;
arrows.push(arrow);
game.addChild(arrow);
isMouseDown = false;
}
};
game.move = function (x, y, obj) {
if (isMouseDown) {
// Rotate the stickman towards the mouse pointer
stickman.rotation = Math.atan2(stickman.y - y, stickman.x - x);
}
};
// Game update loop
game.update = function () {
for (var i = arrows.length - 1; i >= 0; i--) {
arrows[i].update();
if (arrows[i].y < -50) {
arrows[i].destroy();
arrows.splice(i, 1);
}
}
for (var j = targets.length - 1; j >= 0; j--) {
targets[j].update();
for (var k = arrows.length - 1; k >= 0; k--) {
if (arrows[k].intersects(targets[j])) {
score += 10;
updateScore();
targets[j].destroy();
targets.splice(j, 1);
arrows[k].destroy();
arrows.splice(k, 1);
createTarget();
break;
}
}
}
if (targets.length === 0) {
createTarget();
}
};
// Initialize first target
createTarget();
Ballon Skiped. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Needle Shooting Stickman. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A clear blue sky with fluffy white clouds drifting lazily across.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.