User prompt
Canavvara dokununca ses ciksin ve oyun oyle bitsin
User prompt
Canavara dokununca canavar sesi gelsin
User prompt
Canavara dokununca ses ciksin
User prompt
Coin toplayinca yesil ekram cikmasin
User prompt
music asseti surekli calsin
User prompt
Coine dokununca ses ciksin
User prompt
Oyun bittiginde best score da yazsin
User prompt
Coinler final scoreunu 5 arttirsin ve final score disinda best score da gosterilsin
User prompt
Add the text to display the number of coins collected
User prompt
Coins texti ekle
User prompt
Coin aldikca 10ar 10ar artarak yazsin ekranda
User prompt
Ekranin altinda coin sayisi yazsin
User prompt
Her turda canavarların gelişi için bekleme suresini azalt
User prompt
platformlar şeffaf renkli olsun ama belli olsun
User prompt
gittikçe coin canavarların hızı az miktarda artsın
User prompt
coin hızı artsın
User prompt
oyuncunun ilk konumu biraz aşağıda olsun
User prompt
oyuncu biraz aşağıda dursun
User prompt
mario biraz aşağıda olsun, coin biraz yukarıda olsun
User prompt
canavarlar biraz aşağıda olsun
User prompt
ekranı altına coin sayacı koy
User prompt
coin aldıkça ekranın altında coin sayacı 10artsın
Code edit (1 edits merged)
Please save this source code
User prompt
coinin hareketi de canavar gibi olsun
Code edit (1 edits merged)
Please save this source code
/**** * Classes ****/ var Coin = Container.expand(function () { var self = Container.call(this); var coinGraphics = self.attachAsset('coin', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.x -= self.speed; if (self.x < -50) { self.destroy(); } }; return self; }); // Define a class for enemies var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.x -= self.speed; if (self.x < -50) { self.destroy(); } }; return self; }); var Platform = Container.expand(function () { var self = Container.call(this); var platformGraphics = self.attachAsset('platform', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.jumpHeight = 40; self.isJumping = false; self.velocityY = 0; self.update = function () { if (self.isJumping) { self.y += self.velocityY; self.velocityY += 0.7; if (self.y >= 2732 / 2) { self.y = 2732 / 2; self.isJumping = false; self.velocityY = 0; } } }; self.jump = function () { if (!self.isJumping) { self.isJumping = true; self.velocityY = -self.jumpHeight; } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ function spawnCoinOnPlatform(platform) { var coin = new Coin(); coin.x = 2048; coin.y = platform.y - 150; game.addChild(coin); coins.push(coin); } function updatePlayer() { player.speed += 2; player.jumpHeight += 10; LK.effects.flashScreen(0x00ff00, 500); } var background = game.addChild(LK.getAsset('background', { anchorX: 0, anchorY: 0 })); background.x = 0; background.y = 0; var platforms = []; for (var i = 1; i < 7; i++) { var platform = new Platform(); platform.x = 2048 / 2; platform.y = 2732 / 7 * i; platforms.push(platform); game.addChild(platform); } var player = game.addChild(new Player()); player.currentPlatform = platforms[5]; player.y = player.currentPlatform.y - player.height; player.x = 250; var enemies = []; var enemySpawnCounter = 0; var enemySpawnInterval = 100; var coins = []; var coinCount = 0; var scoreText = new Text2('0', { size: 100, fill: 0xFFFFFF }); LK.gui.top.addChild(scoreText); scoreText.x = 2048 / 2; scoreText.y = 0; var coinText = new Text2('Coins: 0', { size: 80, fill: 0xFFFF00 }); LK.gui.bottom.addChild(coinText); coinText.x = 2048 / 2; coinText.y = 0; game.update = function () { player.update(); enemySpawnCounter++; if (enemySpawnCounter >= enemySpawnInterval && enemies.length === 0) { var usedPlatforms = []; for (var i = 0; i < 4; i++) { var enemy = new Enemy(); enemy.x = 2048; var randomIndex; do { randomIndex = Math.floor(Math.random() * platforms.length); } while (usedPlatforms.includes(randomIndex)); usedPlatforms.push(randomIndex); var randomPlatform = platforms[randomIndex]; enemy.y = randomPlatform.y - enemy.height + 50; enemies.push(enemy); game.addChild(enemy); } enemySpawnInterval = Math.floor(Math.random() * 300) + 100; enemySpawnCounter = 0; var allIndexes = [0, 1, 2, 3, 4, 5]; var coinPlatforms = allIndexes.filter(function (i) { return !usedPlatforms.includes(i); }); if (coinPlatforms.length > 0) { var coinIndex = coinPlatforms[Math.floor(Math.random() * coinPlatforms.length)]; spawnCoinOnPlatform(platforms[coinIndex]); } } for (var j = enemies.length - 1; j >= 0; j--) { enemies[j].update(); if (player.intersects(enemies[j])) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } else if (player.x > enemies[j].x && !enemies[j].passed) { enemies[j].passed = true; LK.setScore(LK.getScore() + 1); scoreText.setText(LK.getScore()); } if (enemies[j].x < -50) { game.removeChild(enemies[j]); enemies.splice(j, 1); } } for (var k = coins.length - 1; k >= 0; k--) { if (player.intersects(coins[k])) { game.removeChild(coins[k]); coins.splice(k, 1); coinCount++; coinText.setText('Coins: ' + coinCount); if (coinCount >= 10) { updatePlayer(); } } } }; game.down = function (x, y, obj) { var currentPlatformIndex = platforms.indexOf(player.currentPlatform); if (currentPlatformIndex === 5) { player.currentPlatform = platforms[0]; } else { player.currentPlatform = platforms[currentPlatformIndex + 1]; } if (player.currentPlatform) { player.y = player.currentPlatform.y - player.height + 100; } };
===================================================================
--- original.js
+++ change.js
@@ -192,7 +192,7 @@
} else {
player.currentPlatform = platforms[currentPlatformIndex + 1];
}
if (player.currentPlatform) {
- player.y = player.currentPlatform.y - player.height + 50;
+ player.y = player.currentPlatform.y - player.height + 100;
}
};
\ No newline at end of file
korkunç kuş canavarı. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
coin. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
gökyüzü kahramanı. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
sade gökyüzü
düz kırmızı kalp. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows