User prompt
can barının resmi outline siyah içi transparent olsun
User prompt
oyunun sol üst köşesine 3 can barı ekle, karakterimiz her defasında kaktüse çarparsa -1 can barı gider. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
karakterimizin yer çekimini azalt
User prompt
karakterimizin yer çekimini 1 yap
User prompt
oyunda her 2 dakikada bir oyunun arka planı gece veya gündüz olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
oyunda her 1000 distance ulaşınca oyunun arkaplanı gece veya gündüz olsun
User prompt
karakterimizin yer çekimini 0.6'dan 0.8 yap
User prompt
oyunda her 1000 distance ulaşınca bloklar 0.5x hızlansın
User prompt
oyunda yol kat ettikçe blokların hızı 1x hızlı olsun.
User prompt
bloklar ground'un üstünde random hızda spawnlansın
User prompt
bloklar y eksenin en aşağısında random hızda spawnlansın
User prompt
bloklar random spawnlansın
User prompt
karakterimizin yer çekimini 1.5x artır
User prompt
karakterimizin yer çekimini azalt
User prompt
bloklar y eksenin aşağısından spawn olsunlarki blokların üstünden zıplayabilelim
Code edit (1 edits merged)
Please save this source code
User prompt
Block Jumper
Initial prompt
make a basic mario character,and blocks are spawned according to the y axis so that we can jump over the blocks.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Block = Container.expand(function () { var self = Container.call(this); var blockGraphics = self.attachAsset('block', { anchorX: 0.5, anchorY: 1.0 }); self.speed = -8; self.update = function () { self.x += self.speed; }; return self; }); var Character = Container.expand(function () { var self = Container.call(this); var characterGraphics = self.attachAsset('character', { anchorX: 0.5, anchorY: 1.0 }); self.velocityY = 0; self.gravity = 1; self.jumpPower = -16; self.isGrounded = false; self.groundY = 2652; // Ground level self.jump = function () { if (self.isGrounded) { self.velocityY = self.jumpPower; self.isGrounded = false; LK.getSound('jump').play(); } }; self.update = function () { // Apply gravity self.velocityY += self.gravity; self.y += self.velocityY; // Ground collision if (self.y >= self.groundY) { self.y = self.groundY; self.velocityY = 0; self.isGrounded = true; } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ // Game variables var character; var blocks = []; var gameSpeed = 8; var blockSpawnTimer = 0; var blockSpawnInterval = 90; // frames between spawns var distance = 0; var lastGroundCheck = true; var lastDistanceMilestone = 0; var dayNightTimer = 0; var isDayTime = true; // Create ground var ground = game.addChild(LK.getAsset('ground', { anchorX: 0, anchorY: 1.0, x: 0, y: 2732 })); // Create character character = game.addChild(new Character()); character.x = 300; character.y = character.groundY; // Create score display var scoreText = new Text2('Distance: 0', { size: 60, fill: 0xFFFFFF }); scoreText.anchor.set(0.5, 0); LK.gui.top.addChild(scoreText); // Touch controls game.down = function (x, y, obj) { character.jump(); }; // Game update loop game.update = function () { // Update distance distance += gameSpeed; LK.setScore(Math.floor(distance / 10)); scoreText.setText('Distance: ' + Math.floor(distance / 10)); // Spawn blocks blockSpawnTimer++; // Random spawn interval for varied timing var randomSpawnInterval = blockSpawnInterval + Math.floor(Math.random() * 40) - 20; // ±20 frames variation if (blockSpawnTimer >= randomSpawnInterval) { blockSpawnTimer = 0; // Create new block on top of ground var newBlock = new Block(); newBlock.x = 2200; // Spawn off-screen right // Spawn blocks on top of the ground surface newBlock.y = 2652; // Ground surface level (2732 - 80) // Set speed based on current distance milestone var currentMilestone = Math.floor(distance / 1000); var speedMultiplier = 1 + currentMilestone * 0.5; newBlock.speed = -8 * speedMultiplier; blocks.push(newBlock); game.addChild(newBlock); } // Update blocks for (var i = blocks.length - 1; i >= 0; i--) { var block = blocks[i]; // Track previous position for collision detection if (block.lastIntersecting === undefined) { block.lastIntersecting = false; } // Remove blocks that have moved off-screen if (block.x < -200) { block.destroy(); blocks.splice(i, 1); continue; } // Check collision with character var currentIntersecting = character.intersects(block); if (!block.lastIntersecting && currentIntersecting) { // Collision detected LK.getSound('collision').play(); LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } block.lastIntersecting = currentIntersecting; } // Check if character fell off screen var currentGroundCheck = character.y <= character.groundY + 10; if (lastGroundCheck && !currentGroundCheck && character.y > 2800) { // Character fell off screen LK.showGameOver(); return; } lastGroundCheck = currentGroundCheck; // Speed up blocks every 1000 distance var currentDistanceMilestone = Math.floor(distance / 1000); if (currentDistanceMilestone > (lastDistanceMilestone || 0)) { // Calculate new speed multiplier (0.5x faster each 1000 distance) var speedMultiplier = 1 + currentDistanceMilestone * 0.5; var newBlockSpeed = -8 * speedMultiplier; // Update speed for all existing blocks for (var k = 0; k < blocks.length; k++) { blocks[k].speed = newBlockSpeed; } // Update the milestone tracker lastDistanceMilestone = currentDistanceMilestone; } // Day/Night cycle - every 2 minutes (7200 ticks at 60fps) dayNightTimer++; if (dayNightTimer >= 7200) { dayNightTimer = 0; isDayTime = !isDayTime; var targetColor = isDayTime ? 0x87CEEB : 0x191970; // Day blue vs Night dark blue tween(game, { backgroundColor: targetColor }, { duration: 2000, easing: tween.easeInOut }); } // Increase difficulty over time if (LK.ticks % 600 === 0) { // Every 10 seconds if (blockSpawnInterval > 45) { blockSpawnInterval -= 5; } if (gameSpeed < 12) { gameSpeed += 0.5; } } };
===================================================================
--- original.js
+++ change.js
@@ -24,9 +24,9 @@
anchorX: 0.5,
anchorY: 1.0
});
self.velocityY = 0;
- self.gravity = 0.8;
+ self.gravity = 1;
self.jumpPower = -16;
self.isGrounded = false;
self.groundY = 2652; // Ground level
self.jump = function () {
make a mario lucky bloks. In-Game asset. 2d. High contrast. No shadows
make a mario bros. In-Game asset. 2d. High contrast. No shadows
make a mario 8-bit ant. In-Game asset. 2d. High contrast. No shadows
make a mario ground. In-Game asset. 2d. High contrast. No shadows
red heart 8-bit mario. In-Game asset. 2d. High contrast. No shadows