User prompt
oyun sonunda canavar olmasın heart da olmasın
User prompt
300 altın toplandığında bölümün sonunda büyük bir uzaylıya karşı savaş yapalım uzaylıya ateş atalım uzaylının canı üstte sağda gözüksün uzaylı da bana ateş yollasın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
oyun bittiği zaman karakter ilerleyemesin ve hareket edilemesin oyun tekrar başladığında ise sıfırdan coın sıfırlansın
User prompt
oyun bittiği zaman arka planda oyun devam etmesin oyun yeniden başlasn ve coınler sıfırlansın
User prompt
oyun bitiş ekranından sonra oyunu başlattımızda karakterden 2 tane oluyor onu düzelt tek karakter yap
User prompt
oyunda 5 canınız vardır yazısısını büyük yap ve rengi kırmızı olsun yazının altına da şunu yaz ; ( You have 5 lives ) aynı şekilde oda büyük ve kırmızı olsun
User prompt
oyun başlama ekranındaki play yazısının altına şunu yaz ; (Oyunda 5 canınız vardır)
User prompt
oyun başlama ekranındaki resmi sil
User prompt
oyun başlama ekranındaki resim ekranı kaplasın
User prompt
oyun kaybetiş ekranına gelindiğinde müzik çalsın ve tekrar deneye basıldığında oyuna dönsün ama oyunda şarkı çalmasın
User prompt
oyun başlama müziği sadece başlama menüsünde çalsın oyun başladığı zaman kapatılsın
User prompt
OYUNA BAŞLAMA MÜZİĞİ EKLE
User prompt
VE OYUN BAŞLAMA EKRANINA RESİM EKLE RESİM YUKARIYA SABİT VE ORTADA DURMUŞ BİR ŞEKİLDE OLSUN
User prompt
TEKRAR DENEMEK İSTER MİSİN ? YAZISININ YERİNE TRY AGAIN YAZ AMA YAZI KALIN OLSUN VE SİYAH OLSUN
User prompt
oyun bitiş ekranın daki resmi yukarıya koy
User prompt
oyun bitiş arka planına resim ekle
User prompt
ve oyun sonundaki o şeffaf siyah yuvarlak şeyi kaldır
User prompt
TEKRAR DENEMEK İSTER MİSİN ? yazısının rengi beyaz olsun ve tıklandığında oyun yeniden başlansın ve yazıyı biraz büyüt
User prompt
TOPLANAN COIN YAZISI AŞAĞI YUKARI DOĞRU HAREKET ETSİN 5 SANİYE BOYUNCA( o yazı aşağıda olsun) VE ALTTAKİ SİYAH YAZININ YERİNE DE TEKRAR DENEMEK İSTER MİSİN ? yazsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
TOPLANAN COIN YAZISININ RENGİ SARI OLSUN VE TAHTANIN ESVİYESİNDE OLSUN
User prompt
coın collected yazısını biraz daha aşağıya koy ve oraya TOPLANAN COIN yaz
User prompt
ve bütün canlar bitip kaybettiğimiz zaman oyun sonunda toplanılan coın sayısını belirtsin ve birde oyun kaybetiş ekranında bir resim olsun ve tekrar denemek ister misin ? :) yazsın yazının rengi siyah olsun ve biraz italic ve birazda kalın olsun
User prompt
güzel ama yukarı giden kuş tahtanın seviyesinde olsun diğeri güzel ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
yukarı ve aşağı derken sola doğru yani karaktere doğru yukarıdan gelen kuş ve aşağıdan gelen kuş ( geldikleri yön orta , gidecekleri yön düz bir şekilde sola doğru hiçbir yere sapmıyacaklar ) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
kuşlar sadece ortada gitsin ben kuşların bazılarının aşağı düz ve bazılarınında yukarı düz bir şekilde gitmesini istiyorum ↪💡 Consider importing and using the following plugins: @upit/tween.v1
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Bird = Container.expand(function () {
var self = Container.call(this);
var birdGraphics = self.attachAsset('bird', {
anchorX: 0.5,
anchorY: 0.5
});
self.hasHit = false;
self.verticalDirection = 0; // Always fly straight horizontally
self.update = function () {
// Move towards character (left) faster than game speed
self.x -= gameSpeed + 6;
// Birds fly straight horizontally - no vertical movement
if (!self.hasHit && self.intersects(mario)) {
self.hasHit = true;
takeDamage();
}
};
return self;
});
var Bomb = Container.expand(function () {
var self = Container.call(this);
var bombGraphics = self.attachAsset('bomb', {
anchorX: 0.5,
anchorY: 1.0
});
self.hasHit = false;
self.update = function () {
self.x -= gameSpeed;
if (!self.hasHit && self.intersects(mario)) {
self.hasHit = true;
takeDamage();
}
};
return self;
});
var Coin = Container.expand(function () {
var self = Container.call(this);
var coinGraphics = self.attachAsset('coin', {
anchorX: 0.5,
anchorY: 0.5
});
self.collected = false;
self.update = function () {
self.x -= gameSpeed;
if (!self.collected && self.intersects(mario)) {
self.collected = true;
LK.setScore(LK.getScore() + 10);
scoreTxt.setText(LK.getScore());
LK.getSound('coin').play();
self.alpha = 0;
// Check if we collected exactly 200 coins (or multiples of 200)
if (LK.getScore() % 200 === 0 && LK.getScore() > 0) {
spawnDoor();
}
}
};
return self;
});
var Door = Container.expand(function () {
var self = Container.call(this);
var doorGraphics = self.attachAsset('door', {
anchorX: 0.5,
anchorY: 1.0
});
self.hasEntered = false;
self.update = function () {
self.x -= gameSpeed;
if (!self.hasEntered && self.intersects(mario)) {
self.hasEntered = true;
nextLevel();
}
};
return self;
});
var GameOverScreen = Container.expand(function () {
var self = Container.call(this);
self.visible = false;
// Add background image
var backgroundImg = self.attachAsset('gameOverBackground', {
anchorX: 0.5,
anchorY: 0.5
});
backgroundImg.x = 1024;
backgroundImg.y = 800;
// Game over image
var gameOverImg = self.attachAsset('gameOverImage', {
anchorX: 0.5,
anchorY: 0.5
});
gameOverImg.x = 1024;
gameOverImg.y = 800;
// Coins collected text
self.coinsText = new Text2('', {
size: 80,
fill: 0xFFD700
});
self.coinsText.anchor.set(0.5, 0.5);
self.coinsText.x = 1024;
self.coinsText.y = 1500; // Position lower on screen
self.addChild(self.coinsText);
// Retry text with white, italic, bold styling
self.retryText = new Text2('TEKRAR DENEMEK İSTER MİSİN ?', {
size: 80,
fill: 0xFFFFFF,
fontStyle: 'italic bold'
});
self.retryText.anchor.set(0.5, 0.5);
self.retryText.x = 1024;
self.retryText.y = 1700;
self.addChild(self.retryText);
self.retryText.down = function (x, y, obj) {
// Restart game when retry text is clicked
self.hide();
restartGame();
};
self.show = function (coinCount) {
self.coinsText.setText('TOPLANAN COIN ' + coinCount);
self.visible = true;
// Start upward movement animation for 5 seconds
var startY = self.coinsText.y;
var targetY = startY - 100; // Move up 100 pixels
tween(self.coinsText, {
y: targetY
}, {
duration: 2500,
easing: tween.easeInOut
});
tween(self.coinsText, {
y: startY
}, {
duration: 2500,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Animation complete after 5 seconds total
}
});
};
self.hide = function () {
self.visible = false;
};
self.down = function (x, y, obj) {
// Restart game when clicked
self.hide();
restartGame();
};
return self;
});
var Ground = Container.expand(function () {
var self = Container.call(this);
var groundGraphics = self.attachAsset('ground', {
anchorX: 0,
anchorY: 0
});
self.update = function () {
self.x -= gameSpeed;
};
return self;
});
var Mario = Container.expand(function () {
var self = Container.call(this);
var marioGraphics = self.attachAsset('mario', {
anchorX: 0.5,
anchorY: 1.0
});
self.velocityY = 0;
self.gravity = 0.8;
self.jumpPower = -30;
self.isOnGround = false;
self.isJumping = false;
self.jump = function () {
if (self.isOnGround && !self.isJumping) {
self.velocityY = self.jumpPower;
self.isOnGround = false;
self.isJumping = true;
LK.getSound('jump').play();
}
};
self.update = function () {
self.velocityY += self.gravity;
self.y += self.velocityY;
// Check platform collisions
var onPlatform = false;
for (var i = 0; i < platforms.length; i++) {
var platform = platforms[i];
// Better platform collision - check if Mario is above platform and falling down
var marioBottom = self.y;
var platformTop = platform.y - 10;
var platformLeft = platform.x - 300; // Half of platform width (600/2)
var platformRight = platform.x + 300; // Half of platform width (600/2)
if (self.velocityY >= 0 && marioBottom >= platformTop - 20 && marioBottom <= platformTop + 20 && self.x >= platformLeft && self.x <= platformRight) {
self.y = platformTop;
self.velocityY = 0;
self.isOnGround = true;
self.isJumping = false;
onPlatform = true;
break;
}
}
// Check ground collision
if (!onPlatform && self.y >= groundY) {
self.y = groundY;
self.velocityY = 0;
self.isOnGround = true;
self.isJumping = false;
}
};
return self;
});
var Platform = Container.expand(function () {
var self = Container.call(this);
var platformGraphics = self.attachAsset('platform', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
self.x -= gameSpeed;
};
return self;
});
var Thorn = Container.expand(function () {
var self = Container.call(this);
var thornGraphics = self.attachAsset('thorn', {
anchorX: 0.5,
anchorY: 1.0
});
self.hasHit = false;
self.update = function () {
self.x -= gameSpeed;
if (!self.hasHit && self.intersects(mario)) {
self.hasHit = true;
takeDamage();
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87ceeb
});
/****
* Game Code
****/
var mario;
var groundTiles = [];
var coins = [];
var bombs = [];
var thorns = [];
var platforms = [];
var hearts = [];
var doors = [];
var birds = [];
var gameSpeed = 10;
var groundY = 2400;
var maxHealth = 5;
var currentHealth = maxHealth;
var spawnTimer = 0;
var gameStarted = false;
var currentLevel = storage.currentLevel || 1;
var doorSpawned = false;
var gameOverScreen;
var levelTxt = new Text2('Level ' + currentLevel, {
size: 60,
fill: 0xFFFFFF
});
levelTxt.anchor.set(0, 0);
LK.gui.topLeft.addChild(levelTxt);
levelTxt.x = 120; // Avoid the platform menu icon
levelTxt.y = 20;
var scoreTxt = new Text2('0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var startButton = new Text2('PLAY', {
size: 120,
fill: 0xFFFFFF
});
startButton.anchor.set(0.5, 0.5);
LK.gui.center.addChild(startButton);
// Add background image to start screen immediately
var background = game.addChild(LK.getAsset('background', {
anchorX: 0,
anchorY: 0
}));
background.x = 0;
background.y = 0;
function initializeGame() {
game.setBackgroundColor(0x87ceeb);
mario = game.addChild(new Mario());
mario.x = 300;
mario.y = groundY;
for (var i = 0; i < 15; i++) {
var ground = game.addChild(new Ground());
ground.x = i * 200;
ground.y = groundY;
groundTiles.push(ground);
}
createHearts();
if (!gameOverScreen) {
gameOverScreen = game.addChild(new GameOverScreen());
}
gameStarted = true;
startButton.visible = false;
gameSpeed = 10 + (currentLevel - 1) * 3; // Adjust speed based on level
levelTxt.setText('Level ' + currentLevel);
game.setBackgroundColor(0x87ceeb);
}
function createHearts() {
for (var i = 0; i < maxHealth; i++) {
var heart = LK.getAsset('heart', {
anchorX: 0.5,
anchorY: 0.5
});
heart.x = LK.gui.topRight.x - 60 - i * 45;
heart.y = 60;
hearts.push(heart);
LK.gui.topRight.addChild(heart);
}
}
function updateHearts() {
for (var i = 0; i < hearts.length; i++) {
hearts[i].alpha = i < currentHealth ? 1.0 : 0.3;
}
}
function takeDamage() {
if (currentHealth > 0) {
currentHealth--;
updateHearts();
LK.getSound('hurt').play();
LK.effects.flashScreen(0xff0000, 300);
if (currentHealth <= 0) {
// Show custom game over screen with coin count
gameOverScreen.show(LK.getScore());
}
}
}
function nextLevel() {
currentLevel++;
storage.currentLevel = currentLevel;
levelTxt.setText('Level ' + currentLevel);
// Show level announcement
showLevelAnnouncement();
// Increase speed each level
gameSpeed = 10 + (currentLevel - 1) * 3;
// Clear obstacles but keep coins and score
for (var i = 0; i < doors.length; i++) {
doors[i].destroy();
}
doors = [];
doorSpawned = false;
for (var i = 0; i < bombs.length; i++) {
bombs[i].destroy();
}
bombs = [];
for (var i = 0; i < thorns.length; i++) {
thorns[i].destroy();
}
thorns = [];
for (var i = 0; i < platforms.length; i++) {
platforms[i].destroy();
}
platforms = [];
for (var i = 0; i < birds.length; i++) {
birds[i].destroy();
}
birds = [];
// Reset Mario position but keep coins
mario.x = 300;
mario.y = groundY;
mario.velocityY = 0;
mario.isOnGround = true;
mario.isJumping = false;
}
function restartGame() {
// Reset all game variables
currentHealth = maxHealth;
currentLevel = 1;
storage.currentLevel = currentLevel;
doorSpawned = false;
spawnTimer = 0;
gameSpeed = 10;
// Clear all objects
for (var i = 0; i < coins.length; i++) {
coins[i].destroy();
}
coins = [];
for (var i = 0; i < bombs.length; i++) {
bombs[i].destroy();
}
bombs = [];
for (var i = 0; i < thorns.length; i++) {
thorns[i].destroy();
}
thorns = [];
for (var i = 0; i < platforms.length; i++) {
platforms[i].destroy();
}
platforms = [];
for (var i = 0; i < doors.length; i++) {
doors[i].destroy();
}
doors = [];
for (var i = 0; i < birds.length; i++) {
birds[i].destroy();
}
birds = [];
// Reset Mario
mario.x = 300;
mario.y = groundY;
mario.velocityY = 0;
mario.isOnGround = true;
mario.isJumping = false;
// Reset score and UI
LK.setScore(0);
scoreTxt.setText('0');
levelTxt.setText('Level ' + currentLevel);
updateHearts();
}
function spawnDoor() {
if (!doorSpawned) {
var door = game.addChild(new Door());
door.x = 2400; // Spawn further away to give player time
door.y = groundY;
doors.push(door);
doorSpawned = true;
}
}
function spawnObstacle() {
// Don't spawn obstacles if door is active
if (doorSpawned) {
return;
}
var rand = Math.random();
var spawnX = 2200;
if (rand < 0.25) {
var coin = game.addChild(new Coin());
coin.x = spawnX;
coin.y = groundY - 100 - Math.random() * 150;
coins.push(coin);
} else if (rand < 0.45) {
var bomb = game.addChild(new Bomb());
bomb.x = spawnX + Math.random() * 100 + 50; // Add spacing variation
bomb.y = groundY;
bombs.push(bomb);
} else if (rand < 0.65) {
var thorn = game.addChild(new Thorn());
thorn.x = spawnX + Math.random() * 100 + 50; // Add spacing variation
thorn.y = groundY;
thorns.push(thorn);
} else if (rand < 0.85) {
// Spawn platform with coins on top
var platform = game.addChild(new Platform());
platform.x = spawnX + Math.random() * 200 + 100; // Random horizontal position
platform.y = groundY - 200 - Math.random() * 300; // Random height
platforms.push(platform);
// Add 4-6 coins on the platform (spread across the long plank)
var numCoins = 4 + Math.floor(Math.random() * 3);
for (var i = 0; i < numCoins; i++) {
var coin = game.addChild(new Coin());
coin.x = platform.x - 280 + i * 140; // Spread coins across the 600px wide plank
coin.y = platform.y - 60;
coins.push(coin);
}
} else {
// Spawn flying bird
var bird = game.addChild(new Bird());
bird.x = spawnX + Math.random() * 100 + 50;
// Spawn birds either from top or bottom of screen
if (Math.random() < 0.5) {
// Spawn from top at platform level
bird.y = groundY - 200;
bird.verticalDirection = 0; // Fly straight horizontally
} else {
// Spawn from bottom
bird.y = groundY - 100;
bird.verticalDirection = 0; // Fly straight horizontally
}
birds.push(bird);
}
}
function cleanupObjects() {
for (var i = coins.length - 1; i >= 0; i--) {
if (coins[i].x < -100) {
coins[i].destroy();
coins.splice(i, 1);
}
}
for (var i = bombs.length - 1; i >= 0; i--) {
if (bombs[i].x < -100) {
bombs[i].destroy();
bombs.splice(i, 1);
}
}
for (var i = thorns.length - 1; i >= 0; i--) {
if (thorns[i].x < -100) {
thorns[i].destroy();
thorns.splice(i, 1);
}
}
for (var i = platforms.length - 1; i >= 0; i--) {
if (platforms[i].x < -500) {
platforms[i].destroy();
platforms.splice(i, 1);
}
}
for (var i = doors.length - 1; i >= 0; i--) {
if (doors[i].x < -100) {
doors[i].destroy();
doors.splice(i, 1);
}
}
for (var i = birds.length - 1; i >= 0; i--) {
if (birds[i].x < -100) {
birds[i].destroy();
birds.splice(i, 1);
}
}
for (var i = groundTiles.length - 1; i >= 0; i--) {
if (groundTiles[i].x < -400) {
var ground = game.addChild(new Ground());
ground.x = groundTiles[groundTiles.length - 1].x + 200;
ground.y = groundY;
groundTiles.push(ground);
groundTiles[i].destroy();
groundTiles.splice(i, 1);
}
}
}
game.down = function (x, y, obj) {
if (!gameStarted) {
initializeGame();
} else {
mario.jump();
}
};
startButton.down = function (x, y, obj) {
initializeGame();
};
var levelAnnouncementTxt = null;
var levelAnnouncementTimer = 0;
function showLevelAnnouncement() {
if (levelAnnouncementTxt) {
LK.gui.center.removeChild(levelAnnouncementTxt);
}
levelAnnouncementTxt = new Text2(currentLevel + '. LEVEL', {
size: 120,
fill: 0xFFD700
});
levelAnnouncementTxt.anchor.set(0.5, 0.5);
LK.gui.center.addChild(levelAnnouncementTxt);
levelAnnouncementTimer = 120; // Show for 2 seconds at 60fps
}
game.update = function () {
if (!gameStarted) {
return;
}
// Handle level announcement display
if (levelAnnouncementTimer > 0) {
levelAnnouncementTimer--;
if (levelAnnouncementTimer <= 0 && levelAnnouncementTxt) {
LK.gui.center.removeChild(levelAnnouncementTxt);
levelAnnouncementTxt = null;
}
return; // Don't spawn obstacles while showing level announcement
}
spawnTimer++;
if (spawnTimer >= 60) {
// Reduced from 90 to 60 for faster spawning
spawnObstacle();
spawnTimer = 0;
}
cleanupObjects();
gameSpeed += 0.005;
}; ===================================================================
--- original.js
+++ change.js
@@ -89,9 +89,9 @@
anchorX: 0.5,
anchorY: 0.5
});
backgroundImg.x = 1024;
- backgroundImg.y = 1366;
+ backgroundImg.y = 800;
// Game over image
var gameOverImg = self.attachAsset('gameOverImage', {
anchorX: 0.5,
anchorY: 0.5
ince bir çimenli zemin. In-Game asset. 2d. High contrast. No shadows
bomb. In-Game asset. 2d. High contrast. No shadows
altın para. In-Game asset. 2d. High contrast. No shadows
dikenler. In-Game asset. 2d. High contrast. No shadows
bulutlu bir hava. In-Game asset. 2d. High contrast. No shadows
portal. In-Game asset. 2d. High contrast. No shadows
sinirli bir uçan kuş. In-Game asset. 2d. High contrast. No shadows
red heart. In-Game asset. 2d. High contrast. No shadows