User prompt
I don't want the coins to be in the probabilty code, it should spawn coins 100% and add probabilty between the sheild and lives that are rarely spawned, not dependendt on the coins.
User prompt
Make coins to 80% and just make a condition for the lives and shield defferent from the coins ( these should spawned randomly and rarely )
User prompt
spawn coin only on the location where no obstacles are spwned.
User prompt
Add a check inside the spawning logic of obstacles the if any time the obstacle is intersect with the coin collectables, it will destroy itself.
User prompt
Coins are not visible
User prompt
Now i want to change the coin spawning logic little bit, i want to spawn the coin cluster on the path, when the obstacle group is not spawn on that path.
User prompt
if the coin is overlaping with the obstacle then remove the coin.
User prompt
Currently the coins are overlaping with the obstacles sometimes, fix the bug
User prompt
Increase the cluster size of the coins to 5, 7, 12
User prompt
Increase the spawn frequency of the coins
User prompt
Currently the coins are moving slow from left to right but the obstacles are moving fast, move the coin at the same speed
User prompt
When spawning coins, mirror the obstacle spawning logic, ensuring they appear on the path opposite to where obstacles are placed. This means: Vertical Spacing: Maintain the same vertical spacing rules used for obstacles. If an obstacle is above the top path, the corresponding coin should be placed on the bottom path, and vice-versa. Random Horizontal Placement: Similar to obstacles, introduce random horizontal spacing between coins within a defined range. However, make sure coins are not spawned too close to where obstacles are present on the opposite path to avoid immediate collection or collisions. Grouping: Consider spawning coins in small groups or clusters on the opposite path to provide an opportunity for the player to collect multiple coins in quick succession. By implementing this mirroring logic, you'll ensure that coins and obstacles are never placed on the same path simultaneously, creating a more balanced and strategic gameplay experience.
User prompt
Spawn the coins same as the obstacle but in the opposite direction of the obstacles.
User prompt
Fix the bugs of coins
User prompt
Coins are having some issue, they are spawning but despawning instantly after spawning.
User prompt
Okay now i want th coins, to be spawned in the groups( same as obstacles are spawning ) of ( 3 , 5 , 7 ); but should not overlap with each other and with the obstacles. and the speed of coins should be same as the speed of the path.
User prompt
Whenever i collet the sheild show the sheild icon on the left centre and make it show the 10s timer for the sheild and when timer ends it will remove the sheild and reset the tint of the ninja to default.
User prompt
Ewhen i am collecting other colletibles, the sheild is getting down, make the sheild strictly stay for 10s after collection, no matter what i collect after the sheild.
User prompt
when i am collecting other colletibles, the sheild is getting down, make the sheild strictly stay for 10s after collection, no matter what i collect after the sheild.
User prompt
Remove the shield effect, instead when the ninja collects the sheild make the tint of ninja to blue and make him invincible for 10s, also whenever the ninja is in the sheild mode and it hits the obstacles then distroy the obstacles ( also show the distruction effect )
User prompt
Currently when i collet the sheild the ninja is not getting the invincibility, and also when i collect the sheild and change the path the sheild effect is not moving with the ninja, make it currect and fix the issue.
User prompt
When i collect the shield it should show the Sheild effect at the location of the ninja for 10s and make the ninja invincible for 10s, after 10 sec remove the sheild effect from the ninja.
User prompt
When i collect the lives on the path it should update the display lives by one, and should show one more life on the lives display.
User prompt
Now the live is not reducing on the hitting the obstacle ( also not updating on the display )
User prompt
Fix the bugs : - I want the collectable lives and display lives class different from each other, - Collectibles should spawn in the same way, same direction, same rotation, the obstacles are spawned - Also find other bugs and fix them in the code.
===================================================================
--- original.js
+++ change.js
@@ -338,9 +338,21 @@
newCollectible = new Shield();
shields.push(newCollectible);
}
var randomPath = Math.random() > 0.5 ? 1 : 2;
- newCollectible.x = 2048 + Math.random() * 500; // Introduce random horizontal spacing
+ var obstacleFreeX = 2048 + Math.random() * 500; // Introduce random horizontal spacing
+ var isOverlapping = false;
+ do {
+ isOverlapping = false;
+ for (var i = 0; i < game.children.length; i++) {
+ if (game.children[i] instanceof Obstacle && Math.abs(game.children[i].x - obstacleFreeX) < 150) {
+ obstacleFreeX = 2048 + Math.random() * 500;
+ isOverlapping = true;
+ break;
+ }
+ }
+ } while (isOverlapping);
+ newCollectible.x = obstacleFreeX;
if (randomPath === 1) {
newCollectible.y = 2732 * 2 / 3 - 80; // Place coin on the opposite path
newCollectible.rotation = 0; // No rotation
} else {
@@ -349,9 +361,21 @@
}
var coinGroupSize = [5, 7, 12][Math.floor(Math.random() * 3)]; // Group size of 5, 7, or 12
for (var i = 0; i < coinGroupSize; i++) {
var groupedCoin = new Coin();
- groupedCoin.x = newCollectible.x + i * 150; // Horizontal spacing between coins in a group
+ var groupedCoinX = newCollectible.x + i * 150; // Horizontal spacing between coins in a group
+ var isGroupOverlapping = false;
+ do {
+ isGroupOverlapping = false;
+ for (var j = 0; j < game.children.length; j++) {
+ if (game.children[j] instanceof Obstacle && Math.abs(game.children[j].x - groupedCoinX) < 150) {
+ groupedCoinX = newCollectible.x + i * 150;
+ isGroupOverlapping = true;
+ break;
+ }
+ }
+ } while (isGroupOverlapping);
+ groupedCoin.x = groupedCoinX;
groupedCoin.y = newCollectible.y;
groupedCoin.rotation = newCollectible.rotation;
coins.push(groupedCoin);
game.addChild(groupedCoin);
Ninja Star. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A minimalist icon depicting a ninja head silhouette in black. The silhouette should be simple and recognizable, with a headband or mask detail. The background should be transparent or a contrasting color (e.g., red or white).. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Coin. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Shield. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Transparent sheild bubble. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Create a series of curved, tapered lines that originate from the ninja's body and extend outward in the direction of movement. The lines should vary in length and thickness, with a sense of energy and dynamism.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
backgroundMusic
Sound effect
coinCollect
Sound effect
jumpSound
Sound effect
footstepSound1
Sound effect
footstepSound2
Sound effect
footstepSound3
Sound effect
shooterSpawn
Sound effect
destructorSpawn
Sound effect
attackerSpawn
Sound effect
shooterAttack
Sound effect
destructorAttack
Sound effect
attackerAttack
Sound effect
enemyHit
Sound effect
shieldCollect
Sound effect
shieldCollectSound
Sound effect
ninjaGrunt
Sound effect
destructorAttackSound
Sound effect