User prompt
Reduces the gain even further
User prompt
That the TP recharges more slowly
User prompt
Let only one bullet count towards the TP
User prompt
Let the TP recharge 0.1 per second
User prompt
Let only one bullet count for the TP
User prompt
Let the TP recharge 1 per second
User prompt
Let only one bullet count, no matter the rest
User prompt
That the TP recharges 0.4 seconds slower
User prompt
Make the TP recharge every 0.1 seconds if there is a bullet in its hitbox, but if the player is in seconds of invulnerability, it does not happen and reduces the seconds of invulnerability to 1 seconds.
User prompt
Make the TP recharge more slowly and create a square around the player the size of the TP's hitbox.
User prompt
Make it so that when the player narrowly dodges bullets, he gains TP and can fill it up to 100.
User prompt
Make it so that to spare the enemy you have to act 15 times and the player has 2.5 seconds of invulnerability when hit ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make He2 loop when the battle starts
User prompt
Let the enemy have 5 different attack patterns
User prompt
The enemy has 8000 health, but the player deals 100 to 200 damage and the healing heals 50
User prompt
Make the table where the attacks are bigger.
User prompt
That the enemy has other attack patterns
User prompt
Remove the wave system
User prompt
Let there be no waves
User prompt
That the player can heal himself 8 times
User prompt
Make sure the bullets are a little further apart because it's almost impossible to dodge them and make sure the buttons are a little further apart.
User prompt
Make the buttons bigger, put a Sprite for the enemy and a way to defeat the enemy with violence or In a peaceful manner
Code edit (1 edits merged)
Please save this source code
User prompt
Dodge Quest: Turn-Based Defense
Initial prompt
An RPG game inspired by Undertale, which is a turn-based game where you can dodge your enemies' attacks, which has buttons to move around the attack box to dodge
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Player = Container.expand(function () { var self = Container.call(this); self.moveSpeed = 8; self.isMoving = false; self.targetX = 0; self.targetY = 0; var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.moveTo = function (x, y) { if (x < battleBoxLeft + 30) x = battleBoxLeft + 30; if (x > battleBoxRight - 30) x = battleBoxRight - 30; if (y < battleBoxTop + 30) y = battleBoxTop + 30; if (y > battleBoxBottom - 30) y = battleBoxBottom - 30; self.targetX = x; self.targetY = y; self.isMoving = true; }; self.update = function () { if (self.isMoving) { var dx = self.targetX - self.x; var dy = self.targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < self.moveSpeed) { self.x = self.targetX; self.y = self.targetY; self.isMoving = false; } else { self.x += dx / distance * self.moveSpeed; self.y += dy / distance * self.moveSpeed; } } }; return self; }); var Projectile = Container.expand(function () { var self = Container.call(this); self.velocityX = 0; self.velocityY = 0; self.isActive = true; var projectileGraphics = self.attachAsset('projectile', { anchorX: 0.5, anchorY: 0.5 }); self.setVelocity = function (vx, vy) { self.velocityX = vx; self.velocityY = vy; }; self.update = function () { if (self.isActive) { self.x += self.velocityX; self.y += self.velocityY; // Remove if out of battle box bounds if (self.x < battleBoxLeft - 50 || self.x > battleBoxRight + 50 || self.y < battleBoxTop - 50 || self.y > battleBoxBottom + 50) { self.isActive = false; } } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x111111 }); /**** * Game Code ****/ // Game state variables var gameState = 'attack'; // 'attack' or 'defense' var playerHealth = 100; var maxHealth = 100; var enemyHealth = 8000; var maxEnemyHealth = 8000; var projectiles = []; var defenseTimer = 0; var defenseDuration = 300; // 5 seconds at 60fps var spareCount = 0; var maxSpareCount = 3; var healCount = 0; var maxHealCount = 8; // Battle box boundaries var battleBoxLeft = 1024 - 400; var battleBoxRight = 1024 + 400; var battleBoxTop = 1366 - 300; var battleBoxBottom = 1366 + 300; // Create battle box var battleBox = game.addChild(LK.getAsset('battleBox', { anchorX: 0.5, anchorY: 0.5 })); battleBox.x = 1024; battleBox.y = 1366; // Create player var player = game.addChild(new Player()); player.x = 1024; player.y = 1366; // Create health bar background var healthBarBg = game.addChild(LK.getAsset('healthBarBg', { anchorX: 0.5, anchorY: 0.5 })); healthBarBg.x = 1024; healthBarBg.y = 300; // Create health bar var healthBar = game.addChild(LK.getAsset('healthBar', { anchorX: 0.5, anchorY: 0.5 })); healthBar.x = 1024; healthBar.y = 300; // Create enemy sprite var enemy = game.addChild(LK.getAsset('enemy', { anchorX: 0.5, anchorY: 0.5 })); enemy.x = 1024; enemy.y = 800; // Create attack button var attackButton = game.addChild(LK.getAsset('attackButton', { anchorX: 0.5, anchorY: 0.5 })); attackButton.x = 900; attackButton.y = 1800; // Create spare button var spareButton = game.addChild(LK.getAsset('spareButton', { anchorX: 0.5, anchorY: 0.5 })); spareButton.x = 1148; spareButton.y = 1800; // Create heal button var healButton = game.addChild(LK.getAsset('healButton', { anchorX: 0.5, anchorY: 0.5 })); healButton.x = 1024; healButton.y = 1700; // Create movement buttons var upButton = game.addChild(LK.getAsset('upButton', { anchorX: 0.5, anchorY: 0.5 })); upButton.x = 1024; upButton.y = 1850; var downButton = game.addChild(LK.getAsset('downButton', { anchorX: 0.5, anchorY: 0.5 })); downButton.x = 1024; downButton.y = 2150; var leftButton = game.addChild(LK.getAsset('leftButton', { anchorX: 0.5, anchorY: 0.5 })); leftButton.x = 850; leftButton.y = 2000; var rightButton = game.addChild(LK.getAsset('rightButton', { anchorX: 0.5, anchorY: 0.5 })); rightButton.x = 1198; rightButton.y = 2000; // Create UI text var phaseText = new Text2('ATTACK PHASE', { size: 80, fill: 0xFFFF00 }); phaseText.anchor.set(0.5, 0); phaseText.x = 1024; phaseText.y = 200; game.addChild(phaseText); var healthText = new Text2('HP: 100/100', { size: 50, fill: 0xFFFFFF }); healthText.anchor.set(0.5, 0); healthText.x = 1024; healthText.y = 350; game.addChild(healthText); // Create enemy health bar background var enemyHealthBarBg = game.addChild(LK.getAsset('healthBarBg', { anchorX: 0.5, anchorY: 0.5 })); enemyHealthBarBg.x = 1024; enemyHealthBarBg.y = 650; // Create enemy health bar var enemyHealthBar = game.addChild(LK.getAsset('healthBar', { anchorX: 0.5, anchorY: 0.5 })); enemyHealthBar.x = 1024; enemyHealthBar.y = 650; enemyHealthBar.tint = 0xff0000; var enemyHealthText = new Text2('Enemy HP: 100/100', { size: 50, fill: 0xFFFFFF }); enemyHealthText.anchor.set(0.5, 0); enemyHealthText.x = 1024; enemyHealthText.y = 700; game.addChild(enemyHealthText); var spareText = new Text2('Spare Progress: 0/3', { size: 50, fill: 0x00ff66 }); spareText.anchor.set(0.5, 0); spareText.x = 1024; spareText.y = 750; game.addChild(spareText); var healText = new Text2('Heals: 8/8', { size: 50, fill: 0x00ff00 }); healText.anchor.set(0.5, 0); healText.x = 1024; healText.y = 800; game.addChild(healText); // Button event handlers attackButton.down = function () { if (gameState === 'attack') { var damage = Math.floor(Math.random() * 101) + 100; // Random damage between 100-200 enemyHealth -= damage; updateEnemyHealthBar(); if (enemyHealth <= 0) { LK.showYouWin(); return; } startDefensePhase(); } }; spareButton.down = function () { if (gameState === 'attack') { spareCount++; updateSpareProgress(); if (spareCount >= maxSpareCount) { LK.showYouWin(); return; } startDefensePhase(); } }; healButton.down = function () { if (gameState === 'attack' && healCount < maxHealCount && playerHealth < maxHealth) { healCount++; playerHealth = Math.min(playerHealth + 50, maxHealth); updateHealthBar(); updateHealCount(); LK.getSound('heal').play(); LK.effects.flashObject(player, 0x00ff00, 300); startDefensePhase(); } }; upButton.down = function () { if (gameState === 'defense') { player.moveTo(player.x, player.y - 60); LK.getSound('dodge').play(); } }; downButton.down = function () { if (gameState === 'defense') { player.moveTo(player.x, player.y + 60); LK.getSound('dodge').play(); } }; leftButton.down = function () { if (gameState === 'defense') { player.moveTo(player.x - 60, player.y); LK.getSound('dodge').play(); } }; rightButton.down = function () { if (gameState === 'defense') { player.moveTo(player.x + 60, player.y); LK.getSound('dodge').play(); } }; function startDefensePhase() { gameState = 'defense'; defenseTimer = 0; phaseText.setText('DEFENSE PHASE'); phaseText.tint = 0xff0000; // Hide attack buttons, show movement buttons attackButton.visible = false; spareButton.visible = false; healButton.visible = false; upButton.visible = true; downButton.visible = true; leftButton.visible = true; rightButton.visible = true; } function startAttackPhase() { gameState = 'attack'; phaseText.setText('ATTACK PHASE'); phaseText.tint = 0xffff00; // Clear all projectiles for (var i = projectiles.length - 1; i >= 0; i--) { projectiles[i].destroy(); projectiles.splice(i, 1); } // Show attack buttons, hide movement buttons attackButton.visible = true; spareButton.visible = true; healButton.visible = true; upButton.visible = false; downButton.visible = false; leftButton.visible = false; rightButton.visible = false; } function spawnProjectile(x, y, vx, vy) { var projectile = new Projectile(); projectile.x = x; projectile.y = y; projectile.setVelocity(vx, vy); projectiles.push(projectile); game.addChild(projectile); } function updateProjectilePattern() { if (defenseTimer % 30 === 0) { // Spawn every 0.5 seconds var patternType = Math.floor(Math.random() * 5); if (patternType === 0) { // Horizontal sweep for (var i = 0; i < 3; i++) { spawnProjectile(battleBoxLeft - 30, battleBoxTop + 150 + i * 150, 4, 0); } } else if (patternType === 1) { // Vertical sweep for (var i = 0; i < 4; i++) { spawnProjectile(battleBoxLeft + 150 + i * 150, battleBoxTop - 30, 0, 3); } } else if (patternType === 2) { // Circular pattern from center var centerX = battleBoxLeft + 400; var centerY = battleBoxTop + 300; for (var i = 0; i < 8; i++) { var angle = i * Math.PI * 2 / 8; var vx = Math.cos(angle) * 3; var vy = Math.sin(angle) * 3; spawnProjectile(centerX, centerY, vx, vy); } } else if (patternType === 3) { // Cross pattern var centerX = battleBoxLeft + 400; var centerY = battleBoxTop + 300; spawnProjectile(centerX, centerY, 4, 0); spawnProjectile(centerX, centerY, -4, 0); spawnProjectile(centerX, centerY, 0, 4); spawnProjectile(centerX, centerY, 0, -4); spawnProjectile(centerX, centerY, 3, 3); spawnProjectile(centerX, centerY, -3, -3); spawnProjectile(centerX, centerY, 3, -3); spawnProjectile(centerX, centerY, -3, 3); } else { // Spiral pattern var centerX = battleBoxLeft + 400; var centerY = battleBoxTop + 300; for (var i = 0; i < 6; i++) { var angle = defenseTimer * 0.1 + i * Math.PI / 3; var vx = Math.cos(angle) * 2.5; var vy = Math.sin(angle) * 2.5; spawnProjectile(centerX, centerY, vx, vy); } } } } function updateHealthBar() { var healthPercent = playerHealth / maxHealth; healthBar.scaleX = healthPercent; healthBar.x = 1024 - 200 * (1 - healthPercent); healthText.setText('HP: ' + playerHealth + '/' + maxHealth); } function updateEnemyHealthBar() { var enemyHealthPercent = enemyHealth / maxEnemyHealth; enemyHealthBar.scaleX = enemyHealthPercent; enemyHealthBar.x = 1024 - 200 * (1 - enemyHealthPercent); enemyHealthText.setText('Enemy HP: ' + enemyHealth + '/' + maxEnemyHealth); } function updateSpareProgress() { spareText.setText('Spare Progress: ' + spareCount + '/' + maxSpareCount); } function updateHealCount() { var remaining = maxHealCount - healCount; healText.setText('Heals: ' + remaining + '/' + maxHealCount); if (remaining === 0) { healButton.alpha = 0.5; } } function checkCollisions() { for (var i = projectiles.length - 1; i >= 0; i--) { var projectile = projectiles[i]; if (projectile.isActive && player.intersects(projectile)) { // Player hit playerHealth -= 10; LK.getSound('hit').play(); LK.effects.flashObject(player, 0xff0000, 200); // Remove projectile projectile.destroy(); projectiles.splice(i, 1); updateHealthBar(); if (playerHealth <= 0) { LK.showGameOver(); return; } } } } // Initialize UI state updateHealthBar(); updateEnemyHealthBar(); updateSpareProgress(); updateHealCount(); upButton.visible = false; downButton.visible = false; leftButton.visible = false; rightButton.visible = false; // Start battle music LK.playMusic('He2'); game.update = function () { if (gameState === 'defense') { defenseTimer++; // Update projectile patterns updateProjectilePattern(); // Check for collisions checkCollisions(); // Remove inactive projectiles for (var i = projectiles.length - 1; i >= 0; i--) { if (!projectiles[i].isActive) { projectiles[i].destroy(); projectiles.splice(i, 1); } } // End defense phase if (defenseTimer >= defenseDuration) { startAttackPhase(); } } };
===================================================================
--- original.js
+++ change.js
@@ -427,8 +427,10 @@
upButton.visible = false;
downButton.visible = false;
leftButton.visible = false;
rightButton.visible = false;
+// Start battle music
+LK.playMusic('He2');
game.update = function () {
if (gameState === 'defense') {
defenseTimer++;
// Update projectile patterns
Appearance: An advanced and dramatically redesigned robotic version of Mettaton. It has futuristic armor, energy wings, and a stylized design reminiscent of an anime mecha. He have a heels, 2d pixel art
Red heart pixel art. In-Game asset. 2d. High contrast. No shadows
Black button with an orange outline that says "attack" and has a sword icon, pixel art. In-Game asset. 2d. High contrast. No shadows
Just a square border white no details. In-Game asset. 2d. High contrast. No shadows
Black button with an orange outline that says "Item" and has a Bag icon, pixel art. In-Game asset. 2d. High contrast. No shadows
Black button with an orange outline that says "Spare" and has a X icon, pixel art. In-Game asset. 2d. High contrast. No shadows
Black button with an orange outline that says "Spell" and has a fire icon, pixel art. In-Game asset. 2d. High contrast. No shadows
Energy ball. In-Game asset. 2d. High contrast. No shadows