User prompt
Haz que tu también puedas robar, que el bate tenga usos infinitos y que solo te de dinero si tienes Brainrots en tu base.
User prompt
Añade a Brr Brr Patapim, a Tung tung tung Sahur, a Expressora Signora y a Ballerino Lololo. Y que los NPC también cojan bates
User prompt
Haz que te ponga cuánto le queda al BLOCK, y pon como que el bate es un objeto, el objeto cuando lo tocas con el ratón lo cojes y cuando haces click en la pantalla pegues con el bate que tiene su propio asset ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
añade un bate para pegar a la gente mientras te roban, si les pegan mientras te roban el Brainrot vuelve a tu base. Haz que el BLOCK solo dure 70 segundos y que tengas que tocar tu base para encenderlo ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Haz que si tocas una base empieces a robar un Brainrot, osea que se te ponga en la mano.
User prompt
pero ponlos más grandes a los Brinarots
User prompt
hal que los jugadores estén un poco mas estirados verticalmente y también con los NPC
User prompt
pero has que las flechas tengas sus propios assets
User prompt
haz que pueda bloquear mi base por 70 segundos para que no me roben y que también lo hagan los NPC. Cuando pase eso arriba pone BLOCK ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
haz que el fondo sea más oscuro como la calle también más oscura
User prompt
Pero haz que tengas dinero y que los Brainrots valgan dinero, y que puedas conseguir dinero cuando tengas Brainrots en la base. Que puedas robar Brainrots tocando la base de alguien, eso no vale dinero. Haz que el juego sea infinito y no termine cuando tengas 20 Brainrots ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
haz que el fondo sea verde y que si tocas con el ratón la tienda cojas un brainrot
User prompt
ahora haz que los botones de moverse no sean la imagen de la tienda y que en la y tienda no ponga SHOP
User prompt
ahora haz que si tocas el botón donde pone Shop consigas un Brainrot alazar
User prompt
ahora haz que el jugador se mueva con los AWDS
User prompt
ahora haz que los botones de moverse no sean la imagen de la base
User prompt
haz que el jugador no se pueda mover absolutamente NADA
User prompt
pero haz que cuando no apretes a ningún botón, el personaje se quede COMPLETAMENTE quieto, y que cada Brainrot tenga un Asset diferente
User prompt
pero es imposible que el personaje se mueva, tienes que hacer que con el ratón sea imposible de mover, solo que las teclas que te mencione antes
Initial prompt
borra todo lo que hiciste y simplemente haz una calle en el medio y tu base en la esquina, tu tienes dinero, ese dinero lo gastas en comprar Brainrots como Tralalero Tralala, Capuchino Assasino, Ballerina Capuchina, Lirli Larila, Bombardino Crocodrilo, Makakini Bananini, Chimpanzini Banaini, Orangutini Anassini, Bananita Dolfinita, etc. En el juego hay NPC que también van a comprar Brainrots y llevarlos a su base. Pero tu les puedes robar los Brainrots y ellos a ti. Cuando compras un Brainrot, el Brainrot va caminando hacia tu base. Y cuando lo robas el Brainrot se pone en tus brazos como que lo estas cojiendo y tienes que ir corriendo a dejarlo en tu base.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Base = Container.expand(function () { var self = Container.call(this); var baseGraphics = self.attachAsset('base', { anchorX: 0.5, anchorY: 0.5 }); self.brainrotCount = 0; var countText = new Text2('0', { size: 60, fill: '#ffffff' }); countText.anchor.set(0.5, 0.5); self.addChild(countText); self.update = function () { // Count brainrots in base var count = 0; for (var i = 0; i < brainrots.length; i++) { if (brainrots[i].owner === player && self.intersects(brainrots[i]) && !brainrots[i].isCarried) { count++; } } self.brainrotCount = count; countText.setText(count.toString()); }; return self; }); var BatPickup = Container.expand(function () { var self = Container.call(this); var batGraphics = self.attachAsset('bat_pickup', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Floating animation batGraphics.y = Math.sin(LK.ticks * 0.1) * 3; }; return self; }); var Brainrot = Container.expand(function () { var self = Container.call(this); self.brainrotGraphics = null; self.name = ''; self.owner = null; self.target = null; self.isCarried = false; self.speed = 2; var nameText = new Text2('', { size: 30, fill: '#ffffff' }); nameText.anchor.set(0.5, 1); nameText.y = -40; self.addChild(nameText); self.setName = function (name) { self.name = name; nameText.setText(name); // Set asset based on name var assetMap = { 'Tralalero Tralala': 'brainrot_tralalero', 'Capuchino Assasino': 'brainrot_capuchino', 'Ballerina Capuchina': 'brainrot_ballerina', 'Lirli Larila': 'brainrot_lirli', 'Bombardino Crocodrilo': 'brainrot_bombardino', 'Makakini Bananini': 'brainrot_makakini', 'Chimpanzini Banaini': 'brainrot_chimpanzini', 'Orangutini Anassini': 'brainrot_orangutini', 'Bananita Dolfinita': 'brainrot_bananita' }; var assetName = assetMap[name] || 'brainrot_tralalero'; if (self.brainrotGraphics) { self.removeChild(self.brainrotGraphics); } self.brainrotGraphics = self.attachAsset(assetName, { anchorX: 0.5, anchorY: 0.5 }); // Move nameText to front self.removeChild(nameText); self.addChild(nameText); }; self.update = function () { if (!self.isCarried && self.target) { var dx = self.target.x - self.x; var dy = self.target.y - self.y; var dist = Math.sqrt(dx * dx + dy * dy); if (dist > 10) { self.x += dx / dist * self.speed; self.y += dy / dist * self.speed; } } // Floating animation if (self.brainrotGraphics) { self.brainrotGraphics.y = Math.sin(LK.ticks * 0.05) * 5; } }; return self; }); var NPC = Container.expand(function () { var self = Container.call(this); var npcGraphics = self.attachAsset('npc', { anchorX: 0.5, anchorY: 0.5 }); self.money = 50; self.carriedBrainrot = null; self.target = null; self.speed = 3; self.state = 'idle'; // idle, buying, returning, stealing self.stateTimer = 0; self.home = null; self.update = function () { self.stateTimer--; if (self.state === 'idle' && self.stateTimer <= 0) { // Get NPC index var npcIndex = npcs.indexOf(self); // Decide next action - including blocking var random = Math.random(); if (random < 0.3 && self.money >= brainrotPrice) { self.state = 'buying'; self.target = shop; } else if (random < 0.4 && npcBlockTimes[npcIndex] <= 0) { // Block base npcBlockTimes[npcIndex] = baseBlockDuration; self.state = 'idle'; self.stateTimer = 60; } else { self.state = 'stealing'; // Find a brainrot to steal var potentialTargets = []; for (var i = 0; i < brainrots.length; i++) { if (brainrots[i].owner && brainrots[i].owner !== self && !brainrots[i].isCarried) { potentialTargets.push(brainrots[i]); } } if (potentialTargets.length > 0) { self.target = potentialTargets[Math.floor(Math.random() * potentialTargets.length)]; } else { self.state = 'idle'; self.stateTimer = 60; } } } // Move towards target if (self.target) { var dx = self.target.x - self.x; var dy = self.target.y - self.y; var dist = Math.sqrt(dx * dx + dy * dy); if (dist > 10) { self.x += dx / dist * self.speed; self.y += dy / dist * self.speed; } // Check if reached target if (dist < 50) { if (self.state === 'buying' && self.target === shop) { // Buy a brainrot if (self.money >= brainrotPrice) { self.money -= brainrotPrice; var newBrainrot = createBrainrot(self.x, self.y); newBrainrot.owner = self; newBrainrot.target = self.home; self.carriedBrainrot = newBrainrot; newBrainrot.isCarried = true; self.state = 'returning'; self.target = self.home; } } else if (self.state === 'stealing' && self.target.parent) { // Check if target base is blocked var canSteal = true; if (self.target.owner === player && playerBlockTime > 0) { canSteal = false; } else { for (var j = 0; j < npcs.length; j++) { if (self.target.owner === npcs[j] && npcBlockTimes[j] > 0) { canSteal = false; break; } } } // Steal the brainrot only if base is not blocked if (canSteal) { self.carriedBrainrot = self.target; self.carriedBrainrot.isCarried = true; self.carriedBrainrot.owner = self; self.state = 'returning'; self.target = self.home; LK.getSound('steal').play(); } else { // Base is blocked, go back to idle self.state = 'idle'; self.stateTimer = 60; self.target = null; } } else if (self.state === 'returning' && self.target === self.home) { // Deposit brainrot if (self.carriedBrainrot) { self.carriedBrainrot.isCarried = false; self.carriedBrainrot.target = self.home; self.carriedBrainrot = null; LK.getSound('deposit').play(); } self.state = 'idle'; self.stateTimer = 120; self.target = null; } } } // Update carried brainrot position if (self.carriedBrainrot) { self.carriedBrainrot.x = self.x; self.carriedBrainrot.y = self.y - 50; } }; return self; }); var NPCBase = Container.expand(function () { var self = Container.call(this); var baseGraphics = self.attachAsset('npcbase', { anchorX: 0.5, anchorY: 0.5 }); self.owner = null; self.brainrotCount = 0; var countText = new Text2('0', { size: 60, fill: '#ffffff' }); countText.anchor.set(0.5, 0.5); self.addChild(countText); self.update = function () { // Count brainrots in base var count = 0; for (var i = 0; i < brainrots.length; i++) { if (brainrots[i].owner === self.owner && self.intersects(brainrots[i]) && !brainrots[i].isCarried) { count++; } } self.brainrotCount = count; countText.setText(count.toString()); }; return self; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.money = playerMoney; self.carriedBrainrot = null; self.speed = 6; self.velocity = { x: 0, y: 0 }; self.update = function () { // Process WASD movement self.velocity.x = 0; self.velocity.y = 0; if (keys.w) self.velocity.y = -self.speed; if (keys.s) self.velocity.y = self.speed; if (keys.a) self.velocity.x = -self.speed; if (keys.d) self.velocity.x = self.speed; // Apply velocity to position self.x += self.velocity.x; self.y += self.velocity.y; // Keep player within screen bounds self.x = Math.max(40, Math.min(2008, self.x)); self.y = Math.max(40, Math.min(2692, self.y)); // Update carried brainrot position if (self.carriedBrainrot) { self.carriedBrainrot.x = self.x; self.carriedBrainrot.y = self.y - 50; } // Update bat position if equipped if (playerHoldingBat && playerBatGraphics) { playerBatGraphics.x = 30; playerBatGraphics.y = -20; } }; return self; }); var Shop = Container.expand(function () { var self = Container.call(this); var shopGraphics = self.attachAsset('shop', { anchorX: 0.5, anchorY: 0.5 }); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x003300 }); /**** * Game Code ****/ // Game variables // Different colored brainrots for each type var player; var playerBase; var npcs = []; var npcBases = []; var brainrots = []; var shop; var street; // Brainrot names and prices var brainrotNames = ['Tralalero Tralala', 'Capuchino Assasino', 'Ballerina Capuchina', 'Lirli Larila', 'Bombardino Crocodrilo', 'Makakini Bananini', 'Chimpanzini Banaini', 'Orangutini Anassini', 'Bananita Dolfinita']; var brainrotPrice = 50; var moneyPerBrainrot = 5; // Bat system var batPickups = []; var playerHoldingBat = false; var playerBatGraphics = null; // Base blocking system var baseBlockDuration = 70 * 60; // 70 seconds at 60 FPS var playerBlockTime = 0; var npcBlockTimes = [0, 0, 0]; // One for each NPC // UI Elements var playerMoney = storage.money || 100; var moneyText = new Text2('Money: $' + playerMoney, { size: 60, fill: '#00ff00' }); moneyText.anchor.set(0, 0); moneyText.x = 150; LK.gui.topLeft.addChild(moneyText); var brainrotCountText = new Text2('Brainrots: 0', { size: 60, fill: '#ffffff' }); brainrotCountText.anchor.set(0.5, 0); LK.gui.top.addChild(brainrotCountText); var blockStatusText = new Text2('', { size: 80, fill: '#ff0000' }); blockStatusText.anchor.set(0.5, 0); blockStatusText.y = 100; LK.gui.top.addChild(blockStatusText); var blockTimerText = new Text2('', { size: 60, fill: '#ffff00' }); blockTimerText.anchor.set(0.5, 0); blockTimerText.y = 200; LK.gui.top.addChild(blockTimerText); // Create street in the middle street = game.addChild(LK.getAsset('street', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366 })); // Create player base in corner playerBase = game.addChild(new Base()); playerBase.x = 200; playerBase.y = 2532; // Create shop shop = game.addChild(new Shop()); shop.x = 1024; shop.y = 1366; // Initialize player player = game.addChild(new Player()); player.x = playerBase.x; player.y = playerBase.y; // Create NPCs and their bases for (var i = 0; i < 3; i++) { var npc = game.addChild(new NPC()); var npcBase = game.addChild(new NPCBase()); // Position NPC bases in other corners if (i === 0) { npcBase.x = 1848; npcBase.y = 2532; } else if (i === 1) { npcBase.x = 200; npcBase.y = 200; } else { npcBase.x = 1848; npcBase.y = 200; } npc.x = npcBase.x; npc.y = npcBase.y; npc.home = npcBase; npcBase.owner = npc; npcs.push(npc); npcBases.push(npcBase); } // Helper function to create a brainrot function createBrainrot(x, y) { var brainrot = game.addChild(new Brainrot()); brainrot.x = x; brainrot.y = y; brainrot.setName(brainrotNames[Math.floor(Math.random() * brainrotNames.length)]); brainrots.push(brainrot); return brainrot; } // Create bat pickups for (var i = 0; i < 3; i++) { var batPickup = game.addChild(new BatPickup()); batPickup.x = 500 + i * 300; batPickup.y = 800; batPickups.push(batPickup); } // Keyboard controls - WASD movement var keys = { w: false, a: false, s: false, d: false }; // Note: Since we can't use keyboard events in LK, we'll use a different approach // Player movement will be controlled by touch/click on screen edges game.down = function (x, y, obj) { // Check if clicking on shop to get a random brainrot var shopDist = Math.sqrt(Math.pow(shop.x - x, 2) + Math.pow(shop.y - y, 2)); if (shopDist < 75) { if (player.money >= brainrotPrice) { // Buy brainrot player.money -= brainrotPrice; storage.money = player.money; moneyText.setText('Money: $' + player.money); var newBrainrot = createBrainrot(shop.x, shop.y); newBrainrot.owner = player; newBrainrot.target = playerBase; LK.getSound('purchase').play(); } } // Check if clicking on bat pickups for (var i = batPickups.length - 1; i >= 0; i--) { var batPickup = batPickups[i]; var batDist = Math.sqrt(Math.pow(batPickup.x - x, 2) + Math.pow(batPickup.y - y, 2)); if (batDist < 50 && !playerHoldingBat) { // Pick up bat playerHoldingBat = true; playerBatGraphics = player.addChild(LK.getAsset('bat', { anchorX: 0.5, anchorY: 0.5 })); playerBatGraphics.x = 30; playerBatGraphics.y = -20; batPickup.destroy(); batPickups.splice(i, 1); LK.getSound('purchase').play(); break; } } // Check if clicking to attack with bat if (playerHoldingBat) { // Attack with bat at click position for (var i = 0; i < npcs.length; i++) { var npc = npcs[i]; var distToClick = Math.sqrt(Math.pow(npc.x - x, 2) + Math.pow(npc.y - y, 2)); var distToPlayer = Math.sqrt(Math.pow(player.x - npc.x, 2) + Math.pow(player.y - npc.y, 2)); if (distToClick < 100 && distToPlayer < 150 && npc.carriedBrainrot) { // Return stolen brainrot to player base npc.carriedBrainrot.owner = player; npc.carriedBrainrot.target = playerBase; npc.carriedBrainrot.isCarried = false; npc.carriedBrainrot = null; npc.state = 'idle'; npc.stateTimer = 180; npc.target = null; LK.getSound('hit').play(); // Flash effect on NPC tween(npc, { tint: 0xff0000 }, { duration: 200, onFinish: function onFinish() { tween(npc, { tint: 0xffffff }, { duration: 200 }); } }); break; } } } // Check if clicking on player base to block it (only when touching it) var baseDist = Math.sqrt(Math.pow(playerBase.x - x, 2) + Math.pow(playerBase.y - y, 2)); var playerToBaseDist = Math.sqrt(Math.pow(player.x - playerBase.x, 2) + Math.pow(player.y - playerBase.y, 2)); if (baseDist < 100 && playerToBaseDist < 150 && playerBlockTime <= 0) { playerBlockTime = baseBlockDuration; } // Check if clicking on NPC bases to steal brainrots for (var i = 0; i < npcBases.length; i++) { var npcBase = npcBases[i]; var npcBaseDist = Math.sqrt(Math.pow(npcBase.x - x, 2) + Math.pow(npcBase.y - y, 2)); if (npcBaseDist < 100 && !player.carriedBrainrot) { // Check if player is close enough to the base var playerDist = Math.sqrt(Math.pow(player.x - npcBase.x, 2) + Math.pow(player.y - npcBase.y, 2)); if (playerDist < 150) { // Check if base is blocked if (npcBlockTimes[i] <= 0) { // Find a brainrot in this base to steal for (var j = 0; j < brainrots.length; j++) { var brainrot = brainrots[j]; if (!brainrot.isCarried && brainrot.owner === npcs[i] && npcBase.intersects(brainrot)) { player.carriedBrainrot = brainrot; brainrot.isCarried = true; brainrot.owner = player; LK.getSound('steal').play(); break; } } } } break; } } // Check if clicking on brainrot to steal for (var i = 0; i < brainrots.length; i++) { var brainrot = brainrots[i]; if (!brainrot.isCarried && brainrot.owner !== player && Math.abs(brainrot.x - x) < 50 && Math.abs(brainrot.y - y) < 50) { // Check if player is close enough var dist = Math.sqrt(Math.pow(player.x - brainrot.x, 2) + Math.pow(player.y - brainrot.y, 2)); if (dist < 100) { // Check if target base is blocked var canSteal = true; for (var j = 0; j < npcs.length; j++) { if (brainrot.owner === npcs[j] && npcBlockTimes[j] > 0) { canSteal = false; break; } } if (canSteal) { player.carriedBrainrot = brainrot; brainrot.isCarried = true; brainrot.owner = player; LK.getSound('steal').play(); } break; } } } }; game.up = function (x, y, obj) { // Check if releasing brainrot at base if (player.carriedBrainrot && player.intersects(playerBase)) { player.carriedBrainrot.isCarried = false; player.carriedBrainrot.target = playerBase; player.carriedBrainrot = null; LK.getSound('deposit').play(); } }; // Main game update game.update = function () { // Update block timers if (playerBlockTime > 0) { playerBlockTime--; } for (var i = 0; i < npcBlockTimes.length; i++) { if (npcBlockTimes[i] > 0) { npcBlockTimes[i]--; } } // Update block status display var isAnyBaseBlocked = playerBlockTime > 0; var maxBlockTime = 0; if (playerBlockTime > 0) { maxBlockTime = Math.max(maxBlockTime, playerBlockTime); } for (var i = 0; i < npcBlockTimes.length; i++) { if (npcBlockTimes[i] > 0) { isAnyBaseBlocked = true; maxBlockTime = Math.max(maxBlockTime, npcBlockTimes[i]); } } if (isAnyBaseBlocked) { blockStatusText.setText('BLOCK'); var timeLeft = Math.ceil(maxBlockTime / 60); blockTimerText.setText('Time: ' + timeLeft + 's'); } else { blockStatusText.setText(''); blockTimerText.setText(''); } // Player movement disabled - no keyboard input processing // Update brainrot count var totalBrainrots = 0; for (var i = 0; i < brainrots.length; i++) { if (brainrots[i].owner === player && playerBase.intersects(brainrots[i]) && !brainrots[i].isCarried) { totalBrainrots++; } } brainrotCountText.setText('Brainrots: ' + totalBrainrots); LK.setScore(totalBrainrots); // NPCs can steal from player (but not when player base is blocked) for (var i = 0; i < npcs.length; i++) { var npc = npcs[i]; if (!npc.carriedBrainrot && npc.state === 'stealing' && playerBlockTime <= 0) { // Check if NPC can steal player's carried brainrot if (player.carriedBrainrot && npc.intersects(player)) { npc.carriedBrainrot = player.carriedBrainrot; player.carriedBrainrot.owner = npc; player.carriedBrainrot = null; npc.state = 'returning'; npc.target = npc.home; LK.getSound('steal').play(); } } } // Generate money from brainrots in base if (LK.ticks % 60 === 0) { // Every second, generate money based on brainrots in base player.money += totalBrainrots * moneyPerBrainrot; storage.money = player.money; moneyText.setText('Money: $' + player.money); // NPCs also get money for (var i = 0; i < npcs.length; i++) { npcs[i].money += npcBases[i].brainrotCount * moneyPerBrainrot; } } }; // Create virtual WASD controls var controlContainer = new Container(); controlContainer.x = 200; controlContainer.y = 2000; game.addChild(controlContainer); // Create control buttons var buttonSize = 120; var buttonColor = 0x555555; var buttonActiveColor = 0x888888; // W button var wButton = controlContainer.addChild(LK.getAsset('arrow_up', { width: buttonSize, height: buttonSize, tint: buttonColor, anchorX: 0.5, anchorY: 0.5, x: 0, y: -buttonSize })); var wText = new Text2('W', { size: 60, fill: '#ffffff' }); wText.anchor.set(0.5, 0.5); wButton.addChild(wText); // A button var aButton = controlContainer.addChild(LK.getAsset('arrow_left', { width: buttonSize, height: buttonSize, tint: buttonColor, anchorX: 0.5, anchorY: 0.5, x: -buttonSize, y: 0 })); var aText = new Text2('A', { size: 60, fill: '#ffffff' }); aText.anchor.set(0.5, 0.5); aButton.addChild(aText); // S button var sButton = controlContainer.addChild(LK.getAsset('arrow_down', { width: buttonSize, height: buttonSize, tint: buttonColor, anchorX: 0.5, anchorY: 0.5, x: 0, y: buttonSize })); var sText = new Text2('S', { size: 60, fill: '#ffffff' }); sText.anchor.set(0.5, 0.5); sButton.addChild(sText); // D button var dButton = controlContainer.addChild(LK.getAsset('arrow_right', { width: buttonSize, height: buttonSize, tint: buttonColor, anchorX: 0.5, anchorY: 0.5, x: buttonSize, y: 0 })); var dText = new Text2('D', { size: 60, fill: '#ffffff' }); dText.anchor.set(0.5, 0.5); dButton.addChild(dText); // Button press handlers wButton.down = function () { keys.w = true; wButton.tint = buttonActiveColor; }; wButton.up = function () { keys.w = false; wButton.tint = buttonColor; }; aButton.down = function () { keys.a = true; aButton.tint = buttonActiveColor; }; aButton.up = function () { keys.a = false; aButton.tint = buttonColor; }; sButton.down = function () { keys.s = true; sButton.tint = buttonActiveColor; }; sButton.up = function () { keys.s = false; sButton.tint = buttonColor; }; dButton.down = function () { keys.d = true; dButton.tint = buttonActiveColor; }; dButton.up = function () { keys.d = false; dButton.tint = buttonColor; }; // Play background music LK.playMusic('bgmusic'); ;
===================================================================
--- original.js
+++ change.js
@@ -32,8 +32,20 @@
countText.setText(count.toString());
};
return self;
});
+var BatPickup = Container.expand(function () {
+ var self = Container.call(this);
+ var batGraphics = self.attachAsset('bat_pickup', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.update = function () {
+ // Floating animation
+ batGraphics.y = Math.sin(LK.ticks * 0.1) * 3;
+ };
+ return self;
+});
var Brainrot = Container.expand(function () {
var self = Container.call(this);
self.brainrotGraphics = null;
self.name = '';
@@ -248,10 +260,8 @@
self.velocity = {
x: 0,
y: 0
};
- self.hasBat = false;
- self.batGraphics = null;
self.update = function () {
// Process WASD movement
self.velocity.x = 0;
self.velocity.y = 0;
@@ -270,11 +280,11 @@
self.carriedBrainrot.x = self.x;
self.carriedBrainrot.y = self.y - 50;
}
// Update bat position if equipped
- if (self.hasBat && self.batGraphics) {
- self.batGraphics.x = 30;
- self.batGraphics.y = -20;
+ if (playerHoldingBat && playerBatGraphics) {
+ playerBatGraphics.x = 30;
+ playerBatGraphics.y = -20;
}
};
return self;
});
@@ -309,8 +319,12 @@
// Brainrot names and prices
var brainrotNames = ['Tralalero Tralala', 'Capuchino Assasino', 'Ballerina Capuchina', 'Lirli Larila', 'Bombardino Crocodrilo', 'Makakini Bananini', 'Chimpanzini Banaini', 'Orangutini Anassini', 'Bananita Dolfinita'];
var brainrotPrice = 50;
var moneyPerBrainrot = 5;
+// Bat system
+var batPickups = [];
+var playerHoldingBat = false;
+var playerBatGraphics = null;
// Base blocking system
var baseBlockDuration = 70 * 60; // 70 seconds at 60 FPS
var playerBlockTime = 0;
var npcBlockTimes = [0, 0, 0]; // One for each NPC
@@ -335,8 +349,15 @@
});
blockStatusText.anchor.set(0.5, 0);
blockStatusText.y = 100;
LK.gui.top.addChild(blockStatusText);
+var blockTimerText = new Text2('', {
+ size: 60,
+ fill: '#ffff00'
+});
+blockTimerText.anchor.set(0.5, 0);
+blockTimerText.y = 200;
+LK.gui.top.addChild(blockTimerText);
// Create street in the middle
street = game.addChild(LK.getAsset('street', {
anchorX: 0.5,
anchorY: 0.5,
@@ -385,8 +406,15 @@
brainrot.setName(brainrotNames[Math.floor(Math.random() * brainrotNames.length)]);
brainrots.push(brainrot);
return brainrot;
}
+// Create bat pickups
+for (var i = 0; i < 3; i++) {
+ var batPickup = game.addChild(new BatPickup());
+ batPickup.x = 500 + i * 300;
+ batPickup.y = 800;
+ batPickups.push(batPickup);
+}
// Keyboard controls - WASD movement
var keys = {
w: false,
a: false,
@@ -395,33 +423,75 @@
};
// Note: Since we can't use keyboard events in LK, we'll use a different approach
// Player movement will be controlled by touch/click on screen edges
game.down = function (x, y, obj) {
- // Check if clicking on shop to get a random brainrot or buy bat
+ // Check if clicking on shop to get a random brainrot
var shopDist = Math.sqrt(Math.pow(shop.x - x, 2) + Math.pow(shop.y - y, 2));
if (shopDist < 75) {
- if (player.money >= brainrotPrice && !player.hasBat) {
+ if (player.money >= brainrotPrice) {
// Buy brainrot
player.money -= brainrotPrice;
storage.money = player.money;
moneyText.setText('Money: $' + player.money);
var newBrainrot = createBrainrot(shop.x, shop.y);
newBrainrot.owner = player;
newBrainrot.target = playerBase;
LK.getSound('purchase').play();
- } else if (player.money >= 100 && !player.hasBat) {
- // Buy bat
- player.money -= 100;
- storage.money = player.money;
- moneyText.setText('Money: $' + player.money);
- player.hasBat = true;
- player.batGraphics = player.addChild(LK.getAsset('bat', {
+ }
+ }
+ // Check if clicking on bat pickups
+ for (var i = batPickups.length - 1; i >= 0; i--) {
+ var batPickup = batPickups[i];
+ var batDist = Math.sqrt(Math.pow(batPickup.x - x, 2) + Math.pow(batPickup.y - y, 2));
+ if (batDist < 50 && !playerHoldingBat) {
+ // Pick up bat
+ playerHoldingBat = true;
+ playerBatGraphics = player.addChild(LK.getAsset('bat', {
anchorX: 0.5,
anchorY: 0.5
}));
+ playerBatGraphics.x = 30;
+ playerBatGraphics.y = -20;
+ batPickup.destroy();
+ batPickups.splice(i, 1);
LK.getSound('purchase').play();
+ break;
}
}
+ // Check if clicking to attack with bat
+ if (playerHoldingBat) {
+ // Attack with bat at click position
+ for (var i = 0; i < npcs.length; i++) {
+ var npc = npcs[i];
+ var distToClick = Math.sqrt(Math.pow(npc.x - x, 2) + Math.pow(npc.y - y, 2));
+ var distToPlayer = Math.sqrt(Math.pow(player.x - npc.x, 2) + Math.pow(player.y - npc.y, 2));
+ if (distToClick < 100 && distToPlayer < 150 && npc.carriedBrainrot) {
+ // Return stolen brainrot to player base
+ npc.carriedBrainrot.owner = player;
+ npc.carriedBrainrot.target = playerBase;
+ npc.carriedBrainrot.isCarried = false;
+ npc.carriedBrainrot = null;
+ npc.state = 'idle';
+ npc.stateTimer = 180;
+ npc.target = null;
+ LK.getSound('hit').play();
+ // Flash effect on NPC
+ tween(npc, {
+ tint: 0xff0000
+ }, {
+ duration: 200,
+ onFinish: function onFinish() {
+ tween(npc, {
+ tint: 0xffffff
+ }, {
+ duration: 200
+ });
+ }
+ });
+ break;
+ }
+ }
+ }
// Check if clicking on player base to block it (only when touching it)
var baseDist = Math.sqrt(Math.pow(playerBase.x - x, 2) + Math.pow(playerBase.y - y, 2));
var playerToBaseDist = Math.sqrt(Math.pow(player.x - playerBase.x, 2) + Math.pow(player.y - playerBase.y, 2));
if (baseDist < 100 && playerToBaseDist < 150 && playerBlockTime <= 0) {
@@ -477,40 +547,8 @@
break;
}
}
}
- // Check if player is hitting NPCs with bat
- if (player.hasBat) {
- for (var i = 0; i < npcs.length; i++) {
- var npc = npcs[i];
- var distToNPC = Math.sqrt(Math.pow(player.x - npc.x, 2) + Math.pow(player.y - npc.y, 2));
- if (distToNPC < 120 && npc.carriedBrainrot) {
- // Return stolen brainrot to player base
- npc.carriedBrainrot.owner = player;
- npc.carriedBrainrot.target = playerBase;
- npc.carriedBrainrot.isCarried = false;
- npc.carriedBrainrot = null;
- npc.state = 'idle';
- npc.stateTimer = 180;
- npc.target = null;
- LK.getSound('hit').play();
- // Flash effect on NPC
- tween(npc, {
- tint: 0xff0000
- }, {
- duration: 200,
- onFinish: function onFinish() {
- tween(npc, {
- tint: 0xffffff
- }, {
- duration: 200
- });
- }
- });
- break;
- }
- }
- }
};
game.up = function (x, y, obj) {
// Check if releasing brainrot at base
if (player.carriedBrainrot && player.intersects(playerBase)) {
@@ -532,18 +570,25 @@
}
}
// Update block status display
var isAnyBaseBlocked = playerBlockTime > 0;
+ var maxBlockTime = 0;
+ if (playerBlockTime > 0) {
+ maxBlockTime = Math.max(maxBlockTime, playerBlockTime);
+ }
for (var i = 0; i < npcBlockTimes.length; i++) {
if (npcBlockTimes[i] > 0) {
isAnyBaseBlocked = true;
- break;
+ maxBlockTime = Math.max(maxBlockTime, npcBlockTimes[i]);
}
}
if (isAnyBaseBlocked) {
blockStatusText.setText('BLOCK');
+ var timeLeft = Math.ceil(maxBlockTime / 60);
+ blockTimerText.setText('Time: ' + timeLeft + 's');
} else {
blockStatusText.setText('');
+ blockTimerText.setText('');
}
// Player movement disabled - no keyboard input processing
// Update brainrot count
var totalBrainrots = 0;
@@ -567,43 +612,8 @@
npc.target = npc.home;
LK.getSound('steal').play();
}
}
- // Check if player can hit NPCs with bat while they're carrying stolen brainrots
- if (player.hasBat && npc.carriedBrainrot && npc.carriedBrainrot.owner === npc) {
- var distToNPC = Math.sqrt(Math.pow(player.x - npc.x, 2) + Math.pow(player.y - npc.y, 2));
- if (distToNPC < 120) {
- // Check if the brainrot was originally the player's
- var wasPlayersBrainrot = false;
- for (var j = 0; j < brainrots.length; j++) {
- if (brainrots[j] === npc.carriedBrainrot) {
- // Return brainrot to player base
- npc.carriedBrainrot.owner = player;
- npc.carriedBrainrot.target = playerBase;
- npc.carriedBrainrot.isCarried = false;
- npc.carriedBrainrot = null;
- npc.state = 'idle';
- npc.stateTimer = 180; // Longer stun time
- npc.target = null;
- LK.getSound('hit').play();
- // Flash effect on NPC
- tween(npc, {
- tint: 0xff0000
- }, {
- duration: 200,
- onFinish: function onFinish() {
- tween(npc, {
- tint: 0xffffff
- }, {
- duration: 200
- });
- }
- });
- break;
- }
- }
- }
- }
}
// Generate money from brainrots in base
if (LK.ticks % 60 === 0) {
// Every second, generate money based on brainrots in base
Una base estilo Roblox, base donde guardas cosas. High contrast
Estilo 3d roblox
hazlo realista
hazlo realista
Haz a un macaco con cuerpo de plátano medio abierto, Ultra Realista, sin brazos ni piernas.. In-Game asset. 2d. High contrast. No shadows. Ultra Realista
Haz que tenga piernas
Haz un bate realista. In-Game asset. 2d. High contrast. No shadows. Ultra Realista
Hazlo Realista
Hazlo realista
La imagen es una ilustración digital de un personaje animado que parece ser un trozo de madera o un objeto de madera con características humanoides y una expresión amigable pero algo peculiar. Aquí una descripción detallada: Cuerpo Principal (Tronco): El cuerpo principal del personaje es un cilindro de madera de color marrón claro, con una textura que sugiere vetas de madera. La parte superior es redondeada, formando la "cabeza". Ultra Realista Rostro: La "cabeza" tiene un rostro con rasgos humanos: Ojos: Dos ojos grandes y redondos, con iris marrones y pupilas negras que miran ligeramente hacia el lado izquierdo del personaje. Tienen un brillo que les da un aspecto vívido. Cejas: Cejas finas y elevadas, que contribuyen a la expresión de sorpresa o curiosidad. Nariz: Una nariz pequeña y estilizada que sobre. In-Game asset. 2d. High contrast. No shadows. Ultra Realista. Ultra Realista
Hazlo Realista