User prompt
Una bananannon si può perchè è dentro l'oggetto rosso
User prompt
Una è ancora dentro il mobile e fai in modo che quando manca una banana sola diventa velocissimo ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Alcune banane non si possono prendere perché sono dentro gli oggetti
User prompt
Prima di game over devi fare un jumpscare quindi la scimmia che prende e ti mangia, con il suono, aggiungi altre 4 banane e metti solo 1 vita e quando ti insegue dice "saccy wussy" ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Non devi poter trapassato gli oggetti e aggiungi delle mani viola che ogni tanto spuntano e se tocchi ti fa un jumpscare e rendi più veloce la scimmia ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Rendi la scimmia viola, più veloce aggiungi jumpscare e metti mappa di un parco giochi e 4 banane dietro oggetti ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Monkey's Banana Hunt Horror
Initial prompt
Crea un gioco horror in cui devi scappare da questa scimmia e trovare 8 banane per vincere e avere la scritte "you decente sussy wuccy"
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Banana = Container.expand(function () {
var self = Container.call(this);
var bananaGraphics = self.attachAsset('banana', {
anchorX: 0.5,
anchorY: 0.5
});
self.collected = false;
return self;
});
var Monkey = Container.expand(function () {
var self = Container.call(this);
var monkeyGraphics = self.attachAsset('monkey', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 3.5;
self.targetX = 0;
self.targetY = 0;
self.lastJumpscareTime = 0;
self.update = function () {
// Move towards target position
var dx = self.targetX - self.x;
var dy = self.targetY - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance > 1) {
self.x += dx / distance * self.speed;
self.y += dy / distance * self.speed;
}
// Jumpscare effect when getting close
if (distance < 200 && distance > 150) {
var currentTime = Date.now();
if (currentTime - self.lastJumpscareTime > 3000) {
self.lastJumpscareTime = currentTime;
// Screen flash and size increase
LK.effects.flashScreen(0x800080, 200);
tween(self, {
scaleX: 1.8,
scaleY: 1.8
}, {
duration: 150,
easing: tween.easeOut
});
tween(self, {
scaleX: 1,
scaleY: 1
}, {
duration: 150,
easing: tween.easeIn
});
LK.getSound('jumpscare').play();
}
}
};
return self;
});
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 4;
return self;
});
var PurpleHand = Container.expand(function () {
var self = Container.call(this);
var handGraphics = self.attachAsset('purpleHand', {
anchorX: 0.5,
anchorY: 0.5
});
self.lifeTime = 0;
self.maxLifeTime = 180; // 3 seconds at 60fps
self.appeared = false;
self.update = function () {
self.lifeTime++;
if (self.lifeTime > self.maxLifeTime) {
self.destroy();
var index = purpleHands.indexOf(self);
if (index > -1) {
purpleHands.splice(index, 1);
}
}
// Fade in effect
if (self.lifeTime < 30) {
self.alpha = self.lifeTime / 30;
} else if (self.lifeTime > self.maxLifeTime - 30) {
self.alpha = (self.maxLifeTime - self.lifeTime) / 30;
}
};
self.down = function (x, y, obj) {
// Jumpscare when touched
LK.effects.flashScreen(0x800080, 500);
tween(self, {
scaleX: 2.5,
scaleY: 2.5
}, {
duration: 200,
easing: tween.easeOut
});
LK.getSound('jumpscare').play();
self.destroy();
var index = purpleHands.indexOf(self);
if (index > -1) {
purpleHands.splice(index, 1);
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x1a1a2e
});
/****
* Game Code
****/
// Game variables
var player;
var monkey;
var bananas = [];
var bananasCollected = 0;
var dragNode = null;
var gameStartTime;
var monkeySpeedIncrease = 0.02;
var purpleHands = [];
var handSpawnTimer = 0;
var playerLives = 1;
var monkeySpeechTimer = 0;
// UI elements
var scoreText = new Text2('Bananas: 0/12', {
size: 80,
fill: 0xFFFF00
});
scoreText.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreText);
// Initialize player
player = game.addChild(new Player());
player.x = 1024;
player.y = 1366;
// Initialize monkey
monkey = game.addChild(new Monkey());
monkey.x = 200;
monkey.y = 200;
monkey.targetX = player.x;
monkey.targetY = player.y;
// Create playground objects
var playgroundObjects = [];
function createPlayground() {
// Create slide
var slide = LK.getAsset('slide', {
anchorX: 0.5,
anchorY: 0.5
});
slide.x = 400;
slide.y = 500;
game.addChild(slide);
playgroundObjects.push(slide);
// Create swing
var swing = LK.getAsset('swing', {
anchorX: 0.5,
anchorY: 0.5
});
swing.x = 1600;
swing.y = 800;
game.addChild(swing);
playgroundObjects.push(swing);
// Create seesaw
var seesaw = LK.getAsset('seesaw', {
anchorX: 0.5,
anchorY: 0.5
});
seesaw.x = 800;
seesaw.y = 1800;
game.addChild(seesaw);
playgroundObjects.push(seesaw);
// Create roundabout
var roundabout = LK.getAsset('roundabout', {
anchorX: 0.5,
anchorY: 0.5
});
roundabout.x = 1400;
roundabout.y = 2000;
game.addChild(roundabout);
playgroundObjects.push(roundabout);
}
// Create bananas - 4 behind objects, 4 in open areas
function createBananas() {
// First 4 bananas hidden behind playground objects
var hiddenPositions = [{
x: 320,
y: 480
},
// Behind slide
{
x: 1520,
y: 780
},
// Behind swing
{
x: 720,
y: 1780
},
// Behind seesaw
{
x: 1320,
y: 1980
} // Behind roundabout
];
for (var i = 0; i < 4; i++) {
var banana = new Banana();
banana.x = hiddenPositions[i].x;
banana.y = hiddenPositions[i].y;
bananas.push(banana);
game.addChild(banana);
}
// Remaining 8 bananas in open areas
for (var i = 0; i < 8; i++) {
var banana = new Banana();
var placed = false;
var attempts = 0;
while (!placed && attempts < 50) {
banana.x = Math.random() * (2048 - 100) + 50;
banana.y = Math.random() * (2732 - 100) + 50;
// Make sure bananas don't spawn too close to player, monkey, or playground objects
var distToPlayer = Math.sqrt(Math.pow(banana.x - player.x, 2) + Math.pow(banana.y - player.y, 2));
var distToMonkey = Math.sqrt(Math.pow(banana.x - monkey.x, 2) + Math.pow(banana.y - monkey.y, 2));
var tooCloseToObject = false;
for (var j = 0; j < playgroundObjects.length; j++) {
var distToObject = Math.sqrt(Math.pow(banana.x - playgroundObjects[j].x, 2) + Math.pow(banana.y - playgroundObjects[j].y, 2));
if (distToObject < 200) {
tooCloseToObject = true;
break;
}
}
if (distToPlayer > 150 && distToMonkey > 150 && !tooCloseToObject) {
placed = true;
}
attempts++;
}
bananas.push(banana);
game.addChild(banana);
}
}
createPlayground();
createBananas();
gameStartTime = Date.now();
// Touch controls
function handleMove(x, y, obj) {
if (dragNode) {
var newX = Math.max(30, Math.min(2018, x));
var newY = Math.max(30, Math.min(2702, y));
var tempX = dragNode.x;
var tempY = dragNode.y;
// Try to move to new position
dragNode.x = newX;
dragNode.y = newY;
// Check collision with playground objects
var collision = false;
for (var j = 0; j < playgroundObjects.length; j++) {
if (dragNode.intersects(playgroundObjects[j])) {
collision = true;
break;
}
}
// If collision detected, revert to original position
if (collision) {
dragNode.x = tempX;
dragNode.y = tempY;
}
}
}
game.move = handleMove;
game.down = function (x, y, obj) {
dragNode = player;
handleMove(x, y, obj);
};
game.up = function (x, y, obj) {
dragNode = null;
};
// Game update loop
game.update = function () {
// Update monkey target to player position
monkey.targetX = player.x;
monkey.targetY = player.y;
// Increase monkey speed over time - much faster now
var timeElapsed = (Date.now() - gameStartTime) / 1000;
monkey.speed = 5.5 + timeElapsed * 0.08;
// Monkey says "saccy wussy" while chasing
monkeySpeechTimer++;
if (monkeySpeechTimer > 180) {
// Every 3 seconds
monkeySpeechTimer = 0;
var distanceToPlayer = Math.sqrt(Math.pow(monkey.x - player.x, 2) + Math.pow(monkey.y - player.y, 2));
if (distanceToPlayer < 400) {
// When close to player
LK.getSound('saccyWussy').play();
}
}
// Spawn purple hands randomly
handSpawnTimer++;
if (handSpawnTimer > 120 && Math.random() < 0.03) {
// Every 2 seconds with 3% chance per frame
handSpawnTimer = 0;
var purpleHand = new PurpleHand();
// Spawn at random position not too close to player
var attempts = 0;
do {
purpleHand.x = Math.random() * (2048 - 200) + 100;
purpleHand.y = Math.random() * (2732 - 200) + 100;
attempts++;
} while (attempts < 20 && Math.sqrt(Math.pow(purpleHand.x - player.x, 2) + Math.pow(purpleHand.y - player.y, 2)) < 300);
purpleHands.push(purpleHand);
game.addChild(purpleHand);
}
// Check collision with monkey
if (player.intersects(monkey) && playerLives > 0) {
playerLives--;
if (playerLives <= 0) {
// Jumpscare before game over
LK.effects.flashScreen(0x800080, 500);
LK.getSound('monkeyCatch').play();
// Monkey grows and "eats" player
tween(monkey, {
scaleX: 3,
scaleY: 3
}, {
duration: 800,
easing: tween.easeOut,
onFinish: function onFinish() {
LK.effects.flashScreen(0xff0000, 1000);
LK.getSound('gameOver').play();
LK.setTimeout(function () {
LK.showGameOver();
}, 500);
}
});
return;
}
}
// Check banana collection
for (var i = bananas.length - 1; i >= 0; i--) {
var banana = bananas[i];
if (!banana.collected && player.intersects(banana)) {
banana.collected = true;
bananasCollected++;
// Visual feedback
tween(banana, {
alpha: 0,
scaleX: 1.5,
scaleY: 1.5
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
banana.destroy();
}
});
bananas.splice(i, 1);
LK.getSound('collect').play();
// Update score display
scoreText.setText('Bananas: ' + bananasCollected + '/12');
// Check win condition
if (bananasCollected >= 12) {
// Show victory message
var victoryText = new Text2('you decente sussy wuccy', {
size: 120,
fill: 0x00FF00
});
victoryText.anchor.set(0.5, 0.5);
victoryText.x = 1024;
victoryText.y = 1366;
game.addChild(victoryText);
// Flash screen green and show win
LK.effects.flashScreen(0x00ff00, 1500);
LK.setTimeout(function () {
LK.showYouWin();
}, 1500);
return;
}
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -134,10 +134,12 @@
var gameStartTime;
var monkeySpeedIncrease = 0.02;
var purpleHands = [];
var handSpawnTimer = 0;
+var playerLives = 1;
+var monkeySpeechTimer = 0;
// UI elements
-var scoreText = new Text2('Bananas: 0/8', {
+var scoreText = new Text2('Bananas: 0/12', {
size: 80,
fill: 0xFFFF00
});
scoreText.anchor.set(0.5, 0);
@@ -221,10 +223,10 @@
banana.y = hiddenPositions[i].y;
bananas.push(banana);
game.addChild(banana);
}
- // Remaining 4 bananas in open areas
- for (var i = 0; i < 4; i++) {
+ // Remaining 8 bananas in open areas
+ for (var i = 0; i < 8; i++) {
var banana = new Banana();
var placed = false;
var attempts = 0;
while (!placed && attempts < 50) {
@@ -293,8 +295,19 @@
monkey.targetY = player.y;
// Increase monkey speed over time - much faster now
var timeElapsed = (Date.now() - gameStartTime) / 1000;
monkey.speed = 5.5 + timeElapsed * 0.08;
+ // Monkey says "saccy wussy" while chasing
+ monkeySpeechTimer++;
+ if (monkeySpeechTimer > 180) {
+ // Every 3 seconds
+ monkeySpeechTimer = 0;
+ var distanceToPlayer = Math.sqrt(Math.pow(monkey.x - player.x, 2) + Math.pow(monkey.y - player.y, 2));
+ if (distanceToPlayer < 400) {
+ // When close to player
+ LK.getSound('saccyWussy').play();
+ }
+ }
// Spawn purple hands randomly
handSpawnTimer++;
if (handSpawnTimer > 120 && Math.random() < 0.03) {
// Every 2 seconds with 3% chance per frame
@@ -310,13 +323,31 @@
purpleHands.push(purpleHand);
game.addChild(purpleHand);
}
// Check collision with monkey
- if (player.intersects(monkey)) {
- LK.effects.flashScreen(0xff0000, 1000);
- LK.getSound('gameOver').play();
- LK.showGameOver();
- return;
+ if (player.intersects(monkey) && playerLives > 0) {
+ playerLives--;
+ if (playerLives <= 0) {
+ // Jumpscare before game over
+ LK.effects.flashScreen(0x800080, 500);
+ LK.getSound('monkeyCatch').play();
+ // Monkey grows and "eats" player
+ tween(monkey, {
+ scaleX: 3,
+ scaleY: 3
+ }, {
+ duration: 800,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.getSound('gameOver').play();
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 500);
+ }
+ });
+ return;
+ }
}
// Check banana collection
for (var i = bananas.length - 1; i >= 0; i--) {
var banana = bananas[i];
@@ -337,11 +368,11 @@
});
bananas.splice(i, 1);
LK.getSound('collect').play();
// Update score display
- scoreText.setText('Bananas: ' + bananasCollected + '/8');
+ scoreText.setText('Bananas: ' + bananasCollected + '/12');
// Check win condition
- if (bananasCollected >= 8) {
+ if (bananasCollected >= 12) {
// Show victory message
var victoryText = new Text2('you decente sussy wuccy', {
size: 120,
fill: 0x00FF00