User prompt
respawn the faces with random sizes but the max size is 600, let the size of buttons as they are change only the respawning faces sizes randomly!.
User prompt
reorganize the memes assets by numbers 1-20 in the list
User prompt
Change the respawning to double faces for the respawned meme not different memes for example: respawning 2 faces of meme15 at the same time and with space between it.
User prompt
When all faces are visible start respawning double faces
User prompt
don't respawn the faces of the hidden buttons respawn the visible one only, and each 20 point show button and respawn its face.
User prompt
Let only the first 4 memes that are on the left side line1 and hide the others and show them one by one each 20 point .
User prompt
each 50 point increase speed by 1
User prompt
add missSound to the game if mouse button clicked outside of the buttons of faces
User prompt
Don't play miss sound if i click matched face has already respawned!
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'target')' in or related to this line: 'var target = obj.event.target;' Line Number: 306
User prompt
Add missSound when click face didn't respawn yet or click on screen not the buttons
User prompt
Add missSound when click face didn't respawn yet or click on screen not the buttons
User prompt
let the faces disappear smoothly when they explode ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add the memematchsound from 1-20 to each meme
User prompt
add music gamemusic1 to the game
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'width')' in or related to this line: 'var background = game.attachAsset('Background0', {' Line Number: 150
User prompt
fit the background0 to the screen
Code edit (1 edits merged)
Please save this source code
User prompt
add background0 to the game
Code edit (1 edits merged)
Please save this source code
User prompt
so their buttons too 200x200
User prompt
change the size of 20meme to 200x200
User prompt
make it 2 lines of 10 rather than one line of 20
/**** * Classes ****/ // Sound for when a meme reaches the bottom // No plugins needed for this version. // Class for the falling meme faces var FallingMeme = Container.expand(function (memeType, speed) { var self = Container.call(this); self.memeType = memeType; // Store the type (e.g., 'meme1', 'meme5') self.speed = speed; // Attach the corresponding meme image asset var memeGraphics = self.attachAsset(memeType, { anchorX: 0.5, anchorY: 0.5 }); self.assetWidth = memeGraphics.width; // Store dimensions for easier access self.assetHeight = memeGraphics.height; // Update function called by LK engine each frame self.update = function () { self.y += self.speed; }; // Method to check if the meme is off the bottom of the screen self.isOffScreen = function (gameHeight) { // Consider the meme off-screen if its top edge is past the bottom return self.y - self.assetHeight / 2 > gameHeight; }; return self; }); // Class for the buttons at the bottom var MemeButton = Container.expand(function (memeType) { var self = Container.call(this); self.memeType = memeType; // Store the type (e.g., 'meme1', 'meme5') // Attach the corresponding meme image asset var buttonGraphics = self.attachAsset(memeType, { anchorX: 0.5, anchorY: 0.5 // Removed scaling to make buttons 200x200 }); // Store dimensions for layout (now using full asset size) self.assetWidth = buttonGraphics.width; self.assetHeight = buttonGraphics.height; // Event handler for when the button is pressed // This will be automatically called by the LK engine if the button is attached self.down = function (x, y, obj) { // Find the lowest falling meme of the matching type var matchedMeme = null; var lowestY = -1; for (var i = 0; i < fallingMemes.length; i++) { var meme = fallingMemes[i]; if (meme.memeType === self.memeType && meme.y > lowestY) { lowestY = meme.y; matchedMeme = meme; } } // If a match was found if (matchedMeme) { // Remove the matched meme from the array and destroy it var index = fallingMemes.indexOf(matchedMeme); if (index > -1) { fallingMemes.splice(index, 1); } matchedMeme.destroy(); // Destroy the game object // Increase score and update display LK.setScore(LK.getScore() + 1); scoreTxt.setText(LK.getScore()); // Play match sound LK.getSound('matchSound').play(); // Optional: Add a visual feedback like flashing the button LK.effects.flashObject(self, 0x00FF00, 200); // Flash green briefly } else { // Optional: Handle incorrect tap (e.g., small screen flash red, sound) // LK.effects.flashScreen(0xFF0000, 100); // LK.getSound('missSound').play(); // Potentially confusing with game over sound } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x111111 // Dark grey background }); /**** * Game Code ****/ // LightGreen // LightBlue // PeachPuff // Lavender // Khaki // Gray // Silver // Teal // Olive // Navy // Maroon // Green // Purple // Orange // Cyan // Magenta // Yellow // Blue // Lime // Red // Define 20 meme assets with placeholder shapes and colors // Assuming square meme images. Adjust width/height if needed. // Initialize assets used in this game. Engine will automatically create if not present. // Game constants and variables var GAME_WIDTH = 2048; var GAME_HEIGHT = 2732; var MEME_TYPES = ['meme1', 'meme2', 'meme3', 'meme4', 'meme5', 'meme6', 'meme7', 'meme8', 'meme9', 'meme10', 'meme11', 'meme12', 'meme13', 'meme14', 'meme15', 'meme16', 'meme17', 'meme18', 'meme19', 'meme20']; var INITIAL_SPEED = 5; var SPAWN_INTERVAL_TICKS = 90; // How often to spawn a new meme (90 ticks = 1.5 seconds at 60fps) var fallingMemes = []; // Array to hold active FallingMeme instances var scoreTxt; var gameSpeed = INITIAL_SPEED; var spawnCounter = 0; // --- Background --- var background = game.attachAsset('Background0', { anchorX: 0.5, anchorY: 0.5, scaleX: GAME_WIDTH / 100, // Scale to fill the screen width (asset is 100x100) scaleY: GAME_HEIGHT / 100 // Scale to fill the screen height (asset is 100x100) }); background.x = GAME_WIDTH / 2; background.y = GAME_HEIGHT / 2; // --- Score Display --- scoreTxt = new Text2('0', { size: 120, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); // Anchor top-center // Position score text at the top-center using LK.gui LK.gui.top.addChild(scoreTxt); // Offset slightly down to avoid interfering with potential top-bar elements scoreTxt.y = 20; // --- Meme Buttons --- var buttons = []; var buttonPadding = 5; // Reduced padding as buttons are larger var buttonsPerRow = 10; var buttonRows = 2; var buttonAssetWidth = 200; // Set directly as we know the asset size var buttonAssetHeight = 200; // Set directly as we know the asset size // Create buttons first for (var i = 0; i < MEME_TYPES.length; i++) { var memeType = MEME_TYPES[i]; var button = new MemeButton(memeType); buttons.push(button); // No need to get dimensions here anymore, set statically above } // Calculate layout based on button dimensions and padding var totalWidthForRow = buttonAssetWidth * buttonsPerRow + buttonPadding * (buttonsPerRow - 1); var startX = (GAME_WIDTH - totalWidthForRow) / 2; var rowSpacing = buttonAssetHeight + 30; // Vertical space between rows var bottomRowY = GAME_HEIGHT - buttonAssetHeight / 2 - 50; // Position bottom row near the screen bottom var topRowY = bottomRowY - rowSpacing; // Position and add buttons in two rows for (var i = 0; i < buttons.length; i++) { var button = buttons[i]; var rowIndex = Math.floor(i / buttonsPerRow); // 0 for first row, 1 for second var colIndex = i % buttonsPerRow; // 0 to 9 for column in the row var currentX = startX + colIndex * (buttonAssetWidth + buttonPadding); button.x = currentX + button.assetWidth / 2; // Position based on center anchor if (rowIndex === 0) { button.y = topRowY; } else { button.y = bottomRowY; } game.addChild(button); } // --- Game Update Logic --- game.update = function () { spawnCounter++; // Spawn new memes periodically if (spawnCounter >= SPAWN_INTERVAL_TICKS) { spawnCounter = 0; // Select a random meme type var randomIndex = Math.floor(Math.random() * MEME_TYPES.length); var newMemeType = MEME_TYPES[randomIndex]; // Create a new falling meme instance var newMeme = new FallingMeme(newMemeType, gameSpeed); // Position it randomly across the top, avoiding edges slightly var assetWidth = newMeme.assetWidth; // Get width from the instance newMeme.x = Math.random() * (GAME_WIDTH - assetWidth) + assetWidth / 2; newMeme.y = -newMeme.assetHeight / 2; // Start just above the screen // Initialize last state tracking newMeme.lastY = newMeme.y; // Add to game stage and tracking array game.addChild(newMeme); fallingMemes.push(newMeme); // Gradually increase difficulty (optional) // gameSpeed += 0.05; // SPAWN_INTERVAL_TICKS = Math.max(30, SPAWN_INTERVAL_TICKS * 0.995); // Decrease spawn interval slowly } // Update and check existing falling memes for (var i = fallingMemes.length - 1; i >= 0; i--) { var meme = fallingMemes[i]; // Update last position before moving if (meme.lastY === undefined) { meme.lastY = meme.y; } // Initialize if needed // Check if meme reached the bottom (transition detection) // Check if the bottom edge of the meme crosses the button line var bottomEdge = meme.y + meme.assetHeight / 2; var lastBottomEdge = meme.lastY + meme.assetHeight / 2; var boundaryY = bottomRowY - buttonAssetHeight / 2 - 20; // Line slightly above the *lower* row of buttons if (lastBottomEdge <= boundaryY && bottomEdge > boundaryY) { // Meme crossed the line - Game Over LK.getSound('missSound').play(); // Play miss sound LK.showGameOver(); // Trigger game over handled by LK engine // Important: showGameOver stops further execution of this game instance return; // Exit update loop as game is ending } // If it somehow got way past the screen (cleanup, although game over should trigger first) if (meme.isOffScreen(GAME_HEIGHT + 100)) { // This case should ideally not be reached due to game over check above meme.destroy(); fallingMemes.splice(i, 1); } // Update last known states meme.lastY = meme.y; } }; // Note: No need for game.down, game.up, game.move handlers for this specific game mechanic. // Button presses are handled by the MemeButton class's down method.
===================================================================
--- original.js
+++ change.js
Same face in the image but 3D
3D Scary trollface meme. In-Game asset. 3D. High contrast. No shadows
3D jeff the killer Scary face meme. In-Game asset. 3D. High contrast. No shadows
3D Scary face meme "Terrifier3" from the movie, face only In-Game asset. 3D. High contrast. No shadows. face only
3D Scary but funny annabelle doll face meme. In-Game asset. 3D. High contrast. No shadows
3D Scary face meme samara have green face. only face. normal eyes no so opened. smile In-Game asset. High contrast. 3D. No shadows. only face
3D Scary room with many 3D decorations around, 3D scary masks of memes around it. In-Game asset. 3D. High contrast. No shadows. no jesus cross. no star of 6. no start of 5. no devil. HD colors
3D Scary but funny meme face of momo. face only. different faces look In-Game asset. 3d. High contrast. No shadows
Gamemusic1
Music
meme1matchsound1
Sound effect
meme2matchsound1
Sound effect
meme3matchsound1
Sound effect
meme4matchsound1
Sound effect
meme5matchsound1
Sound effect
meme6matchsound1
Sound effect
meme7matchsound1
Sound effect
meme8matchsound1
Sound effect
meme9matchsound1
Sound effect
meme10matchsound1
Sound effect
meme11matchsound1
Sound effect
meme12matchsound1
Sound effect
meme13matchsound1
Sound effect
meme14matchsound1
Sound effect
meme15matchsound1
Sound effect
meme16matchsound1
Sound effect
meme17matchsound1
Sound effect
meme18matchsound1
Sound effect
meme19matchsound1
Sound effect
meme20matchsound1
Sound effect
missSound
Sound effect