User prompt
delete input username area on code
User prompt
Create an ASCII-style infinite arcade game with the following flow and features: 🌟 START SCREEN: - First, show a centered screen with a square input box where the user can enter their username (max 10 characters). - The box should be outlined like: +----------+ | username | +----------+ - Below it, a [ START ] button should appear after text is entered. - Save the username and display it in the game and profile. 🕹 IN-GAME FEATURES: - The player controls a stick figure at the bottom using left/right arrows. - Show health as stars (★) directly above the character. - The player starts with 3★ health, max 5★. - Enemies fall randomly from top. Some examples: - "LOL", "UwU", "=====", "!!!", ":((", "RIP" - Decorative falling objects also appear but do nothing: - "<3", "⚔", "~*", "✿", "彡☆", etc. - Show current score at the top. 🛡 SHIELD RULES: - Only drop [SHIELD] once when score hits multiples of 100 (100, 200, 300...). - Do NOT drop [SHIELD] continuously or randomly. - Picking up a [SHIELD] adds +1★ (up to 5★). - Hitting an enemy removes -1★. - Game ends when health reaches 0. 💾 PROFILE SYSTEM: - Add a [PROFILE] screen that shows unlocked score milestones with checkboxes: - [✓] Score 10 - [✓] Score 25 - ... - [ ] Score 1000 - Display current username at the top of the profile screen. - Show [ BACK ] to return to game. 🎁 COSMETICS: - Add a small square border around the player (like a tag/skin frame) in-game. - This border should change every 500 score (e.g., default → stars → flames → cyber). - These are cosmetic only, don't affect gameplay. 🧠 NOTES: - Use only ASCII art. - No sound or plugins. - Ensure shields do not flood the screen and only drop per milestone.
User prompt
Create an infinite ASCII-style arcade game where: - The player controls a stick figure at the bottom of the screen using on-screen left/right controls. - Random objects fall from the top of the screen. These include: - Enemies like: "LOL", "UwU", "=====", "!!!" - Visual decorations: "<3", "⚔", "~*", "★彡", "✿", "☠", etc. (harmless) - Only the enemy words can hurt the player. 🛡 Shields: - The player starts with 3 health, displayed as stars (★) above the character. - Every time the score reaches a multiple of 100 (e.g., 100, 200, 300), spawn **one** [SHIELD] item only once. - After that, do not spawn any more shields until the next 100-point threshold is reached. - When the player touches a [SHIELD], restore +1 health (up to a max of 5 stars). - Shields should not flood the screen. They should only drop at those specific moments. ❤️ Health: - Getting hit by an enemy reduces 1 star. - Getting a shield adds 1 star (max 5). - Health is shown as ★★ directly above the player. 🌟 Other: - Score is shown at the top. - Falling speed of enemies increases gradually. - Use only ASCII visuals. No sound, no plugins. - Decorative ASCII objects can be added for visual flair, but only enemies affect the player. IMPORTANT: Shields should not spawn continuously or randomly — only once per 100-point milestone.
User prompt
Create an infinite ASCII-style arcade game where: - The player controls a stick figure at the bottom of the screen using on-screen left/right controls. - Random objects fall from the top of the screen. These include: - Enemies like: "LOL", "UwU", "=====", "!!!" - Visual decorations: "<3", "⚔", "~*", "★彡", "✿", "☠", and other harmless aesthetic items that are just for style - Only the enemy words can hurt the player. The player has 3 health at the start, and health is displayed as stars (★) directly **above the character** (e.g., `★★★`). - If the player touches an enemy, lose 1 health (remove one star). - Every 100 score, drop one "[SHIELD]" item from the top. If the player collects it, restore +1 health (up to 5 stars). - Shields do not fall randomly, only exactly once per 100 points. Make the falling speed of objects increase over time to make the game harder. Show the current score at the top of the screen. Make the visual style fun and chaotic with random harmless ASCII art mixed in, but only the defined enemy words can reduce health. Use only ASCII characters, no plugins, no sound, and ensure everything loops smoothly.
User prompt
Create an infinite ASCII-style game where: - The player controls a stick figure character at the bottom of the screen using on-screen left and right buttons. - Enemies fall from the top with random ASCII words like "LOL", "UwU", "=====", and similar. - If an enemy touches the player, the player loses 1 health. - Occasionally, "[SHIELD]" objects fall from the top. If the player collects a shield, they gain +1 health (up to a maximum of 5). Health is represented by stars (★) displayed **above the player character**. For example: - 3 health = `★★★` - 1 health = `★` When collecting a shield, add 1 star (up to 5). When hit by an enemy, remove 1 star. Display the player's score at the top of the screen. Make the falling speed of enemies slowly increase over time to add difficulty. Use only ASCII characters for visuals. No sound or plugin imports needed.
User prompt
Please fix the bug: 'powerups is not defined' in or related to this line: 'if (powerups) {' Line Number: 420
User prompt
Please fix the bug: 'leftBtn is not defined' in or related to this line: 'if (leftBtn) {' Line Number: 410
User prompt
Please fix the bug: 'healthText is not defined' in or related to this line: 'if (healthText) {' Line Number: 405
User prompt
Create an infinite ASCII arcade-style game where the player controls a stick figure at the bottom of the screen using left and right arrow buttons or on-screen controls. Enemies fall from the top of the screen using ASCII characters like "LOL", "UwU", "=====", and "!!!". If an enemy touches the player, the player loses 1 health. The player starts with 3 health. Sometimes, special items like "[SHIELD]" fall down. If the player collects a shield, they gain +1 health (up to a maximum of 5). The game gets harder over time by increasing the speed of falling objects. Display the player's score and current health at the top of the screen. Score increases over time and when dodging enemies. Keep the visuals minimalist using only ASCII characters. No sound or plugin support is needed. Make sure everything works smoothly in a loop without crashing or stopping. Optional: - Every 100 points, show a cosmetic reward like a new visual tag above the player's head.
User prompt
Add another blocks for funny on the game
Code edit (1 edits merged)
Please save this source code
User prompt
add 1. Power-ups: “Add random power-ups that appear during the game. When collected, they give temporary effects like speed boost, slow motion, or obstacle removal.” 2. Combo system: “Implement a combo system where consecutive successful obstacle avoidances increase a combo multiplier that boosts the score.” 3. Variety of obstacles: “Add different types of obstacles with varied speeds and movement patterns, such as fast, slow, and chasing obstacles.” 4. Sound effects: “Include simple sound effects for actions like scoring, hitting obstacles, and power-up collection. Keep it minimal.” 5. High score leaderboard: “Add a leaderboard that saves and displays the top scores achieved by the player.” 6. Difficulty scaling: “Make the game start easy and gradually increase difficulty based on the player’s score or time played.” 7. Visual effects: “Add minimal visual effects that change as the game speed increases, like background color shifts or screen shake.” 8. Hidden bonuses: “Include random hidden bonuses that appear occasionally, giving extra points or special effects when collected.” ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
The game speed increases every 100 points (at 200, 300, 400, etc.) and new features unlock as the score milestones are reached. Keep it minimal and clean.
Code edit (1 edits merged)
Please save this source code
User prompt
ASCII Endless Mouse
Initial prompt
Make a simple endless ASCII mouse-controlled game with a start menu showing two buttons: START and PROFILE. PROFILE stores and shows player’s score milestones without emojis. Profile data persists between sessions. Keep it minimal and clean.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1", { milestones: [] }); /**** * Classes ****/ // On-screen left/right controls for mobile var AsciiButton = Container.expand(function () { var self = Container.call(this); self.txt = self.addChild(new Text2("", { size: 120, fill: 0xFFFFFF, font: "monospace" })); self.txt.anchor.set(0.5, 0.5); self.setLabel = function (label) { self.txt.setText(label); }; return self; }); // ASCII Obstacle var AsciiObstacle = Container.expand(function () { var self = Container.call(this); // Randomly choose an ASCII obstacle shape, now with more funny blocks! var shapes = ["#####", "=====", "-----", "|||||", "oOoOo", // funny bouncy "UwU", // cute face "0v0v0", // zigzag "><(((º>", // fish "LOL", // meme ":-)", // smiley "ZZZZZ", // sleepy "MOO", // cow "BEEP", // robot "!!!", // exclamation "T_T", // sad face "12345", // numbers "abcde" // letters ]; var ascii = shapes[Math.floor(Math.random() * shapes.length)]; var obsText = self.addChild(new Text2(ascii, { size: 90, fill: 0xFF5555, font: "monospace" })); obsText.anchor.set(0.5, 0.5); // For collision, define a bounding box self.getBounds = function () { return { x: self.x - 225, y: self.y - 45, width: 450, height: 90 }; }; // Move down at a variable speed (default 12, can be overridden) self.speed = 12; self.update = function () { if (typeof self.lastY === "undefined") { self.lastY = self.y; } self.y += self.speed; self.lastY = self.y; }; return self; }); // ASCII Player Character var AsciiPlayer = Container.expand(function () { var self = Container.call(this); // ASCII art for the player (simple stick figure) var asciiArt = [" O ", " /|\\ ", " / \\ "].join("\n"); var playerText = self.addChild(new Text2(asciiArt, { size: 90, fill: 0xFFFFFF, font: "monospace" })); playerText.anchor.set(0.5, 0.5); // Cosmetic tag above head (for rewards) self.tagText = self.addChild(new Text2("", { size: 60, fill: 0x00FF99, font: "monospace" })); self.tagText.anchor.set(0.5, 1); self.tagText.x = 0; self.tagText.y = -160; // For collision, define a bounding box self.getBounds = function () { return { x: self.x - 90, y: self.y - 135, width: 180, height: 270 }; }; return self; }); // Power-up: Shield var ShieldPowerup = Container.expand(function () { var self = Container.call(this); var shieldText = self.addChild(new Text2("[SHIELD]", { size: 80, fill: 0x00FFFF, font: "monospace" })); shieldText.anchor.set(0.5, 0.5); self.speed = 10; self.getBounds = function () { return { x: self.x - 120, y: self.y - 40, width: 240, height: 80 }; }; self.update = function () { if (typeof self.lastY === "undefined") self.lastY = self.y; self.y += self.speed; self.lastY = self.y; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x181818 }); /**** * Game Code ****/ // Storage for persistent profile/milestones // Tween for possible future use (not used in MVP, but included for extensibility) // Game states var STATE_MENU = 0; var STATE_PLAY = 1; var STATE_PROFILE = 2; var gameState = STATE_MENU; // Main elements var player; var obstacles = []; var powerups = []; // Make powerups globally defined so it is accessible everywhere var score = 0; var bestScore = storage.bestScore || 0; var milestones = storage.milestones || []; var milestoneThresholds = [10, 25, 50, 100, 200, 500, 1000]; // GUI elements var scoreText, bestText, menuTitle, startBtn, profileBtn, profilePanel, profileTitle, profileMilestones, backBtn; var healthText; // Make healthText globally defined so it is accessible everywhere var leftBtn; // Make leftBtn globally defined so it is accessible everywhere var rightBtn; // Make rightBtn globally defined so it is accessible everywhere // Utility: collision detection (AABB) function intersects(a, b) { var ab = a.getBounds(); var bb = b.getBounds(); return ab.x < bb.x + bb.width && ab.x + ab.width > bb.x && ab.y < bb.y + bb.height && ab.y + ab.height > bb.y; } // --- MENU UI --- function showMenu() { gameState = STATE_MENU; clearGame(); clearProfile(); // Title menuTitle = new Text2("ASCII RUNNER", { size: 140, fill: 0xFFFFFF, font: "monospace" }); menuTitle.anchor.set(0.5, 0); menuTitle.x = 2048 / 2; menuTitle.y = 300; game.addChild(menuTitle); // Start Button startBtn = new Text2("[ START ]", { size: 110, fill: 0x00FF99, font: "monospace" }); startBtn.anchor.set(0.5, 0.5); startBtn.x = 2048 / 2; startBtn.y = 1000; game.addChild(startBtn); // Profile Button profileBtn = new Text2("[ PROFILE ]", { size: 90, fill: 0xCCCCCC, font: "monospace" }); profileBtn.anchor.set(0.5, 0.5); profileBtn.x = 2048 / 2; profileBtn.y = 1200; game.addChild(profileBtn); // Best Score bestText = new Text2("Best: " + bestScore, { size: 80, fill: 0xAAAAAA, font: "monospace" }); bestText.anchor.set(0.5, 0.5); bestText.x = 2048 / 2; bestText.y = 1400; game.addChild(bestText); // Button handlers startBtn.down = function () { startGame(); }; profileBtn.down = function () { showProfile(); }; } // --- PROFILE UI --- function showProfile() { gameState = STATE_PROFILE; clearMenu(); clearGame(); profilePanel = new Container(); // Title profileTitle = new Text2("PROFILE", { size: 120, fill: 0xFFFFFF, font: "monospace" }); profileTitle.anchor.set(0.5, 0); profileTitle.x = 2048 / 2; profileTitle.y = 300; profilePanel.addChild(profileTitle); // Milestones var milestoneLines = []; for (var i = 0; i < milestoneThresholds.length; i++) { var th = milestoneThresholds[i]; var unlocked = milestones.indexOf(th) !== -1; milestoneLines.push((unlocked ? "[✓] " : "[ ] ") + "Score " + th); } profileMilestones = new Text2(milestoneLines.join("\n"), { size: 90, fill: 0xFFFF99, font: "monospace" }); profileMilestones.anchor.set(0.5, 0); profileMilestones.x = 2048 / 2; profileMilestones.y = 500; profilePanel.addChild(profileMilestones); // Back Button backBtn = new Text2("[ BACK ]", { size: 90, fill: 0x00FF99, font: "monospace" }); backBtn.anchor.set(0.5, 0.5); backBtn.x = 2048 / 2; backBtn.y = 1800; profilePanel.addChild(backBtn); backBtn.down = function () { showMenu(); }; game.addChild(profilePanel); } // --- GAMEPLAY UI --- function startGame() { gameState = STATE_PLAY; clearMenu(); clearProfile(); clearGame(); score = 0; obstacles = []; powerups = []; health = 3; maxHealth = 5; combo = 0; lastCosmetic = -1; cosmeticTags = ["", "★", "ASCII PRO", "RUNNER", "ELITE", "ASCII KING", "GODMODE"]; game._lastShieldScore = -1; // Reset shield drop tracker // Player player = new AsciiPlayer(); player.x = 2048 / 2; player.y = 2200; game.addChild(player); // Score Text scoreText = new Text2("Score: 0", { size: 100, fill: 0xFFFFFF, font: "monospace" }); scoreText.anchor.set(0.5, 0); LK.gui.top.addChild(scoreText); // Health Stars above player var stars = ""; for (var h = 0; h < health; h++) stars += "★"; healthText = new Text2(stars, { size: 100, fill: 0xFFDD44, // gold/yellow for stars font: "monospace" }); healthText.anchor.set(0.5, 1); healthText.x = 0; healthText.y = -180; player.addChild(healthText); // Cosmetic tag player.tagText.setText(""); // On-screen left/right controls leftBtn = new AsciiButton(); leftBtn.setLabel("<"); leftBtn.x = 200; leftBtn.y = 2600; leftBtn.txt.fill = 0x00FF99; leftBtn.down = function () { if (gameState !== STATE_PLAY) return; player.x = Math.max(90, player.x - 180); }; game.addChild(leftBtn); rightBtn = new AsciiButton(); rightBtn.setLabel(">"); rightBtn.x = 2048 - 200; rightBtn.y = 2600; rightBtn.txt.fill = 0x00FF99; rightBtn.down = function () { if (gameState !== STATE_PLAY) return; player.x = Math.min(2048 - 90, player.x + 180); }; game.addChild(rightBtn); // Move handler: player follows finger/mouse horizontally game.move = function (x, y, obj) { if (gameState !== STATE_PLAY) { return; } // Clamp player within screen var px = Math.max(90, Math.min(2048 - 90, x)); player.x = px; }; // Down handler: also move instantly game.down = function (x, y, obj) { if (gameState !== STATE_PLAY) { return; } var px = Math.max(90, Math.min(2048 - 90, x)); player.x = px; }; // Up handler: not used, but required for drag logic game.up = function (x, y, obj) {}; // Start with a clear obstacle list for (var i = 0; i < obstacles.length; i++) { obstacles[i].destroy(); } obstacles = []; for (var i = 0; i < powerups.length; i++) { powerups[i].destroy(); } powerups = []; } // --- GAME CLEAR HELPERS --- function clearMenu() { if (menuTitle) { menuTitle.destroy(); menuTitle = null; } if (startBtn) { startBtn.destroy(); startBtn = null; } if (profileBtn) { profileBtn.destroy(); profileBtn = null; } if (bestText) { bestText.destroy(); bestText = null; } } function clearProfile() { if (profilePanel) { profilePanel.destroy(); profilePanel = null; } } function clearGame() { if (player) { player.destroy(); player = null; } for (var i = 0; i < obstacles.length; i++) { obstacles[i].destroy(); } obstacles = []; if (scoreText) { scoreText.destroy(); scoreText = null; } if (healthText) { healthText.destroy(); healthText = null; } if (leftBtn) { leftBtn.destroy(); leftBtn = null; } if (rightBtn) { rightBtn.destroy(); rightBtn = null; } if (powerups) { for (var i = 0; i < powerups.length; i++) { powerups[i].destroy(); } powerups = []; } game.move = null; game.down = null; game.up = null; } // --- GAME LOOP --- game.update = function () { if (gameState !== STATE_PLAY) { return; } // Dynamic difficulty: speed and spawn rate increase every 100 points var baseSpeed = 12; var baseSpawn = 40; var speedup = Math.floor(score / 100); var currentSpeed = baseSpeed + speedup * 2; var currentSpawn = Math.max(12, baseSpawn - speedup * 5); // Cosmetic tag reward every 100 points var cosmeticIdx = Math.min(Math.floor(score / 100), cosmeticTags.length - 1); if (cosmeticIdx !== lastCosmetic) { player.tagText.setText(cosmeticTags[cosmeticIdx]); lastCosmetic = cosmeticIdx; } // Unlock new features at milestones (minimal: e.g. new obstacle shapes, color, etc.) var extraShapes = []; if (score >= 200) { extraShapes.push("/////"); } if (score >= 300) { extraShapes.push("\\\\\\\\\\"); } if (score >= 400) { extraShapes.push("#####", "====="); } if (score >= 500) { extraShapes.push("~~~~~"); } if (score >= 1000) { extraShapes.push("*****"); } // --- ASCII ENEMY/DECORATION LOGIC --- // Enemy words that can hurt the player var ENEMY_WORDS = ["LOL", "UwU", "=====", "!!!"]; // Harmless decorations (fun/chaotic) var DECOR_WORDS = ["<3", "⚔", "~*", "★彡", "✿", "☠", "owo", "zzz", "☆", "彡", "♡", "∞", "☀", "☁", "☂", "☃", "☄", "☾", "☽", "☼", "☻", "☺", "♪", "♫", "♬", "♩", "♭", "♯", "♮", "✧", "✪", "✩", "✰", "✶", "✹", "✺", "✻", "✼", "✽", "✾", "✿", "❀", "❁", "❂", "❃", "❄", "❅", "❆", "❇", "❈", "❉", "❊", "❋", "☘", "☾", "☽", "☄", "☀", "☁", "☂", "☃", "☼", "☽", "彡★", "彡☆", "彡✿", "彡♡"]; // All possible shapes for obstacles (enemies + decos) var ALL_ASCII_SHAPES = ["#####", "=====", "-----", "|||||", "oOoOo", "UwU", "0v0v0", "><(((º>", "LOL", ":-)", "ZZZZZ", "MOO", "BEEP", "!!!", "T_T", "12345", "abcde"].concat(extraShapes).concat(ENEMY_WORDS).concat(DECOR_WORDS); // Decide if this spawn is an enemy or a decoration if (LK.ticks % currentSpawn === 0) { var isEnemy = Math.random() < 0.5; // 50% chance for enemy, 50% for deco var ascii; if (isEnemy) { ascii = ENEMY_WORDS[Math.floor(Math.random() * ENEMY_WORDS.length)]; } else { ascii = DECOR_WORDS[Math.floor(Math.random() * DECOR_WORDS.length)]; } var obs = new AsciiObstacle(); // Set the ASCII text if (obs.children[0] && obs.children[0].setText) { obs.children[0].setText(ascii); } obs.x = 200 + Math.floor(Math.random() * (2048 - 400)); obs.y = -60; obs.speed = currentSpeed; // Mark if this is an enemy for collision logic obs.isEnemy = isEnemy; obstacles.push(obs); game.addChild(obs); } // --- SHIELD DROP LOGIC --- // Drop shield exactly at every 100 points (not random, not more than once per 100) if (score > 0 && score % 100 === 0 && game._lastShieldScore !== score) { // Only drop once per 100 points var shield = new ShieldPowerup(); shield.x = 200 + Math.floor(Math.random() * (2048 - 400)); shield.y = -60; shield.speed = Math.max(8, currentSpeed - 2); powerups.push(shield); game.addChild(shield); game._lastShieldScore = score; } // Update obstacles for (var i = obstacles.length - 1; i >= 0; i--) { var obs = obstacles[i]; obs.update(); // Only process collision if this is an enemy if (obs.isEnemy && intersects(player, obs)) { // Flash screen LK.effects.flashScreen(0xff2222, 800); health -= 1; combo = 0; if (healthText) { var stars = ""; for (var h = 0; h < health; h++) stars += "★"; healthText.setText(stars); } // Remove obstacle obs.destroy(); obstacles.splice(i, 1); // Game over if health depleted if (health <= 0) { // Update best score if (score > bestScore) { bestScore = score; storage.bestScore = bestScore; } // Update milestones for (var m = 0; m < milestoneThresholds.length; m++) { var th = milestoneThresholds[m]; if (score >= th && milestones.indexOf(th) === -1) { milestones.push(th); } } storage.milestones = milestones; // Show game over (handled by LK) LK.showGameOver(); return; } continue; } // Remove if off screen if (obs.y > 2732 + 100) { obs.destroy(); obstacles.splice(i, 1); } } // Update powerups for (var i = powerups.length - 1; i >= 0; i--) { var p = powerups[i]; p.update(); if (intersects(player, p)) { // Collect shield: +1 health (max 5) if (health < maxHealth) { health += 1; var stars = ""; for (var h = 0; h < health; h++) stars += "★"; healthText.setText(stars); } // Flash blue LK.effects.flashScreen(0x00ffff, 400); p.destroy(); powerups.splice(i, 1); continue; } if (p.y > 2732 + 100) { p.destroy(); powerups.splice(i, 1); } } // Score increases with time if (LK.ticks % 6 === 0) { score++; scoreText.setText("Score: " + score); combo++; } }; // --- GAME OVER HANDLER (reset to menu) --- LK.on('gameover', function () { showMenu(); }); // --- INITIALIZE --- showMenu();
===================================================================
--- original.js
+++ change.js
@@ -146,11 +146,11 @@
/****
* Game Code
****/
-// Game states
-// Tween for possible future use (not used in MVP, but included for extensibility)
// Storage for persistent profile/milestones
+// Tween for possible future use (not used in MVP, but included for extensibility)
+// Game states
var STATE_MENU = 0;
var STATE_PLAY = 1;
var STATE_PROFILE = 2;
var gameState = STATE_MENU;
@@ -286,8 +286,9 @@
maxHealth = 5;
combo = 0;
lastCosmetic = -1;
cosmeticTags = ["", "★", "ASCII PRO", "RUNNER", "ELITE", "ASCII KING", "GODMODE"];
+ game._lastShieldScore = -1; // Reset shield drop tracker
// Player
player = new AsciiPlayer();
player.x = 2048 / 2;
player.y = 2200;
@@ -489,9 +490,9 @@
game.addChild(obs);
}
// --- SHIELD DROP LOGIC ---
// Drop shield exactly at every 100 points (not random, not more than once per 100)
- if (score > 0 && score % 100 === 0 && !game._lastShieldScore || game._lastShieldScore !== score) {
+ if (score > 0 && score % 100 === 0 && game._lastShieldScore !== score) {
// Only drop once per 100 points
var shield = new ShieldPowerup();
shield.x = 200 + Math.floor(Math.random() * (2048 - 400));
shield.y = -60;