User prompt
Make it so u have a health bar which will take 2 hits from monkeys to get game over
User prompt
Make a home screen so you can exchange your points for bigger whips
User prompt
Make it so I can hold instead of tap to whip
User prompt
Make monkeys spawn 2x faster
User prompt
Make a whip noise every time I unleash a whip
User prompt
Make the background a jungle
User prompt
Make it every time I click there is a 0.5 second cool down before I can send a whip out again
User prompt
Every time I click make a whip sound
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'intersects')' in or related to this line: 'if (whips[j].intersects(monkeys[k])) {' Line Number: 103
Initial prompt
WHIPP MONKEYS
===================================================================
--- original.js
+++ change.js
@@ -63,8 +63,9 @@
/****
* Game Code
****/
+var whipping = false;
// Add jungle image asset
var jungleBackground = game.attachAsset('jungle', {
anchorX: 0.0,
anchorY: 0.0
@@ -116,23 +117,24 @@
monkey.y = -100;
monkeys.push(monkey);
game.addChild(monkey);
}
+ var currentTime = Date.now();
+ if (whipping && currentTime - lastWhipTime >= 500) {
+ hero.whip();
+ lastWhipTime = currentTime;
+ }
};
// Handle touch events for hero movement and whipping
var lastWhipTime = 0;
game.down = function (x, y, obj) {
hero.x = x;
hero.y = y;
- var currentTime = Date.now();
- if (currentTime - lastWhipTime >= 500) {
- hero.whip();
- lastWhipTime = currentTime;
- }
+ whipping = true;
};
game.move = function (x, y, obj) {
hero.x = x;
hero.y = y;
};
game.up = function (x, y, obj) {
- // No action needed on touch up
+ whipping = false;
};
\ No newline at end of file
Banana. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Jungle. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2 hearts. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Golden trophy. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.