User prompt
slow down the spawn speed of the obstacle initially and gradually increase the speed of the spawning on each 50 score. and red flash on the screen wrong hit.
User prompt
okay so clamp the mouse movement to grid.
User prompt
Player lifes are not visible on the screen...
User prompt
player will have three lives which are displayed on the bottom left corner of the screen, and when the player hits the wrong obstacles will reduce one life of the player, on all the lives are finished game over and show the on the screen.
User prompt
Okay now remove the negative score feature..
User prompt
there is some bug in the code : hitting the correct obstacle is not dependent on the hitting the wrong obstacle and vice versa
User prompt
now add a tint check on the hit event, if the tint of the player pawn and hit object is same then increase the score on screen else add negative score screen on the right side of the scree with red color text.
Code edit (1 edits merged)
Please save this source code
User prompt
on every hit with obstacles with player pawn, player pawn will change the color ( between : Red , Green , Blue )
User prompt
Remove the Color check from the game update function.
User prompt
now as obstacle are selecting random color between Red, Green, Blue. Player pawn will also randomly select the color between these three colors on each hit with obstacles.
User prompt
there is some problem with hit event : it is sending multiple hits
User prompt
the obstacle color are showing as i want, now register for an hit event to obstacle from player pawn, on hit it will increase the score screen on the top left corner of the screen by 1.
Code edit (1 edits merged)
Please save this source code
User prompt
but the one color should not come twise per row of grid.
User prompt
fix this : in each row the color of first, second, and third obstacle is same, i want it to shuffle the colors ( Between - Red , Green , Blue ) in each row for obstacle.
User prompt
find the issue and fix the code.
User prompt
each obstacle in a row should have different color.
User prompt
spawn only 3 obstacle per row in grid and each obstacle in row should have different color ( picked from : Red, Blue, Green )
User prompt
spawn only 3 columns
User prompt
undo
User prompt
spawn on 3 obstacles per grid line
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'tint')' in or related to this line: 'if (obstacles[i].obstacleGraphics.tint !== player.playerGraphics.tint) {' Line Number: 104
User prompt
change the same in the code
===================================================================
--- original.js
+++ change.js
@@ -76,9 +76,9 @@
obstacle.x = gridLines[i];
obstacle.y = -50;
// Set the color of the obstacle to be different for each grid line
obstacle.colorIndex = i;
- obstacle.obstacleGraphics.tint = obstacle.colors[obstacle.colorIndex];
+ obstacle.children[0].tint = obstacle.colors[obstacle.colorIndex];
obstacles.push(obstacle);
game.addChild(obstacle);
}
}