User prompt
havada duran platformları eski haline getir
User prompt
aşağıdaki platform kendi aşağısını da kaplayabilir mi
User prompt
normal enemyleri karakterin boyutuna getirir misin birde ikisininde boyutunu büyüt
User prompt
büyük düşman farklı bir asset olarak gelebilir mi
User prompt
birda karakter sağa giderken sağa sola giderken sola baksın
User prompt
birazcık daha
User prompt
karakterimizi biraz büyütebilir misin
User prompt
daireyi biraz küçült ve arkası görünebilsin
User prompt
istediğim şey bu değildi hepsini tek bir dairenin içine al
User prompt
dpad tuşlarını siyah renkli bir dairenin içine al
User prompt
dpad deki üç butonu da ayrı birer asset olarak ayarlar mısın
User prompt
oyunda 100 puana ulaşınca en yukarda duran platformun üzerinde bir asset oluşsun ve karakter bu asseti toplayabilsin bu sırada düşmanlar gelmesinler asset toplandıkta n sonra oyun bitsin
User prompt
düşmanlar bizi takip etmesinler sadece sağdan sola hareket etsinler
User prompt
hala orda takılıyorlar
User prompt
düşmanlar bir yerde duruyorlar orada durmasın devam edip gitsinler ayrıca büyük düşman gittikten sonra bir daha geri gelsin
User prompt
bu büyük düşman üzerinden zıplanmyacak kadar büyük olsun ve daha da hızlı olsun ayrıca üzerine değince de ölmesin
User prompt
bu düşman da soldan gelemesin ayrıca biraz daha hızlandır
User prompt
rastgele zamanlarda bizden büyük ve bizden hızlı büyük bir düşman gelsin
User prompt
zamanı yavaşlatma tuşunun içine 30 sn sayan bir sayaç ekler misin
User prompt
zaman yavaşladığında bizim karakterimiz yavaşlamasın ve bu özellik kullandıktan 30 saniye sonra bir daha kullanılabilsin ama özelliğin etkin olma süresi değişmesin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
biraz daha üstüne koyar mısın
User prompt
bu karakterin bir zamanı yavaşlatma özelliği olsun bunu sağlayan bir de tuş olsun bu tuş assetini de d padin hemen üstüne koy ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
havadaki platformların aralarını biraz açar mısın
User prompt
Platformları yükseltip karakterin zıplama seviyesini oraya çıkabilecek kadar arttır
User prompt
Sağ tarafa aynı platformdan bir tane daha ekle yine yakın olsunlar
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var BigEnemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 1.0, scaleX: 2.0, // Make it twice as big scaleY: 2.0 }); self.velocityX = 0; self.velocityY = 0; self.onGround = false; self.speed = 4; // Faster than regular enemies self.gravity = 0.8; self.direction = 1; self.update = function () { // Apply gravity self.velocityY += self.gravity; // Move toward player if (player.x < self.x) { self.velocityX = -self.speed; self.direction = -1; } else { self.velocityX = self.speed; self.direction = 1; } // Apply velocity var currentTimeMultiplier = slowMotionActive ? 0.3 : 1; self.x += self.velocityX * currentTimeMultiplier; self.y += self.velocityY * currentTimeMultiplier; // Check platform collisions self.onGround = false; for (var i = 0; i < platforms.length; i++) { var plat = platforms[i]; var platLeft = plat.obj.x - plat.width / 2; var platRight = plat.obj.x + plat.width / 2; // Check if enemy is within platform bounds horizontally if (self.x >= platLeft && self.x <= platRight) { // Check collision from above (landing on platform) if (self.y >= plat.y && self.y <= plat.y + 30 && self.velocityY >= 0) { self.y = plat.y; self.velocityY = 0; self.onGround = true; break; } } } // Keep enemy on main platform only if (self.x < 80) { // Adjusted for bigger size self.x = 80; } if (self.x > 1968) { // Adjusted for bigger size self.x = 1968; } }; return self; }); var DPad = Container.expand(function () { var self = Container.call(this); var dpadBase = self.attachAsset('dpadBase', { anchorX: 0.5, anchorY: 0.5 }); var leftButton = self.attachAsset('dpadButton', { anchorX: 0.5, anchorY: 0.5, x: -60, y: 0 }); var rightButton = self.attachAsset('dpadButton', { anchorX: 0.5, anchorY: 0.5, x: 60, y: 0 }); var upButton = self.attachAsset('dpadButton', { anchorX: 0.5, anchorY: 0.5, x: 0, y: -60 }); self.leftPressed = false; self.rightPressed = false; self.upPressed = false; leftButton.down = function () { self.leftPressed = true; leftButton.alpha = 0.5; }; leftButton.up = function () { self.leftPressed = false; leftButton.alpha = 1.0; }; rightButton.down = function () { self.rightPressed = true; rightButton.alpha = 0.5; }; rightButton.up = function () { self.rightPressed = false; rightButton.alpha = 1.0; }; upButton.down = function () { self.upPressed = true; upButton.alpha = 0.5; player.jump(); }; upButton.up = function () { self.upPressed = false; upButton.alpha = 1.0; }; self.update = function () { if (self.leftPressed) { player.moveLeft(); } if (self.rightPressed) { player.moveRight(); } }; return self; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 1.0 }); self.velocityX = 0; self.velocityY = 0; self.onGround = false; self.speed = 2; self.gravity = 0.8; self.direction = 1; self.update = function () { // Apply gravity self.velocityY += self.gravity; // Move toward player if (player.x < self.x) { self.velocityX = -self.speed; self.direction = -1; } else { self.velocityX = self.speed; self.direction = 1; } // Apply velocity var currentTimeMultiplier = slowMotionActive ? 0.3 : 1; self.x += self.velocityX * currentTimeMultiplier; self.y += self.velocityY * currentTimeMultiplier; // Check platform collisions self.onGround = false; for (var i = 0; i < platforms.length; i++) { var plat = platforms[i]; var platLeft = plat.obj.x - plat.width / 2; var platRight = plat.obj.x + plat.width / 2; // Check if enemy is within platform bounds horizontally if (self.x >= platLeft && self.x <= platRight) { // Check collision from above (landing on platform) if (self.y >= plat.y && self.y <= plat.y + 30 && self.velocityY >= 0) { self.y = plat.y; self.velocityY = 0; self.onGround = true; break; } } } // Keep enemy on main platform only if (self.x < 40) { self.x = 40; } if (self.x > 2008) { self.x = 2008; } }; return self; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 1.0 }); self.velocityX = 0; self.velocityY = 0; self.onGround = false; self.speed = 8; self.jumpPower = -25; self.gravity = 0.8; self.update = function () { // Apply gravity self.velocityY += self.gravity; // Apply velocity // Player movement is not affected by slow motion self.x += self.velocityX; self.y += self.velocityY; // Check platform collisions self.onGround = false; for (var i = 0; i < platforms.length; i++) { var plat = platforms[i]; var platLeft = plat.obj.x - plat.width / 2; var platRight = plat.obj.x + plat.width / 2; // Check if player is within platform bounds horizontally if (self.x >= platLeft && self.x <= platRight) { // Check collision from above (landing on platform) if (self.y >= plat.y && self.y <= plat.y + 30 && self.velocityY >= 0) { self.y = plat.y; self.velocityY = 0; self.onGround = true; break; } } } // Keep player on screen if (self.x < 40) { self.x = 40; } if (self.x > 2008) { self.x = 2008; } // Apply friction self.velocityX *= 0.8; }; self.moveLeft = function () { self.velocityX = -self.speed; }; self.moveRight = function () { self.velocityX = self.speed; }; self.jump = function () { if (self.onGround) { self.velocityY = self.jumpPower; self.onGround = false; } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ var platformY = 2500; var enemies = []; var bigEnemies = []; var enemySpawnTimer = 0; var enemySpawnRate = 120; var bigEnemySpawnTimer = 0; var bigEnemySpawnRate = 600; // Spawn every 10 seconds initially var gameSpeed = 1; var platforms = []; var slowMotionActive = false; var slowMotionDuration = 0; var slowMotionCooldown = 0; var slowMotionMaxDuration = 180; // 3 seconds at 60fps var slowMotionMaxCooldown = 1800; // 30 seconds at 60fps // Create main platform var platform = game.addChild(LK.getAsset('platform', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: platformY + 50 })); platforms.push({ obj: platform, y: platformY, width: 2048 }); // Create first floating platform var floatingPlatform1 = game.addChild(LK.getAsset('smallPlatform', { anchorX: 0.5, anchorY: 0.5, x: 500, y: platformY - 300 })); platforms.push({ obj: floatingPlatform1, y: platformY - 330, width: 300 }); // Create second floating platform var floatingPlatform2 = game.addChild(LK.getAsset('smallPlatform', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: platformY - 400 })); platforms.push({ obj: floatingPlatform2, y: platformY - 430, width: 300 }); // Create third floating platform var floatingPlatform3 = game.addChild(LK.getAsset('smallPlatform', { anchorX: 0.5, anchorY: 0.5, x: 1548, y: platformY - 300 })); platforms.push({ obj: floatingPlatform3, y: platformY - 330, width: 300 }); // Create player var player = game.addChild(new Player()); player.x = 1024; player.y = platformY; // Create D-pad var dpad = new DPad(); dpad.x = 150; dpad.y = -150; dpad.scaleX = 1.5; dpad.scaleY = 1.5; LK.gui.bottomLeft.addChild(dpad); // Create slow motion button var slowMotionButton = LK.getAsset('slowMotionButton', { anchorX: 0.5, anchorY: 0.5 }); slowMotionButton.x = 150; slowMotionButton.y = -450; slowMotionButton.scaleX = 1.2; slowMotionButton.scaleY = 1.2; // Create countdown text for slow motion button var slowMotionCountdownText = new Text2('', { size: 30, fill: 0xFFFFFF }); slowMotionCountdownText.anchor.set(0.5, 0.5); slowMotionCountdownText.x = 150; slowMotionCountdownText.y = -450; LK.gui.bottomLeft.addChild(slowMotionCountdownText); slowMotionButton.down = function () { if (!slowMotionActive && slowMotionCooldown <= 0) { slowMotionActive = true; slowMotionDuration = slowMotionMaxDuration; slowMotionButton.alpha = 0.5; } }; slowMotionButton.up = function () { // Button up logic if needed }; LK.gui.bottomLeft.addChild(slowMotionButton); // Create score display var scoreTxt = new Text2('Score: 0', { size: 80, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); function spawnEnemy() { var enemy = new Enemy(); // Only spawn enemies from the right side enemy.x = 2024; enemy.y = platformY; enemy.lastIntersecting = false; enemies.push(enemy); game.addChild(enemy); } function spawnBigEnemy() { var bigEnemy = new BigEnemy(); // Randomly spawn from left or right side if (Math.random() < 0.5) { bigEnemy.x = -80; // From left } else { bigEnemy.x = 2128; // From right } bigEnemy.y = platformY; bigEnemy.lastIntersecting = false; bigEnemies.push(bigEnemy); game.addChild(bigEnemy); } function checkCollisions() { // Check regular enemies for (var i = enemies.length - 1; i >= 0; i--) { var enemy = enemies[i]; if (player.intersects(enemy)) { // Check if player is above enemy (stomping) var playerBottom = player.y; var enemyTop = enemy.y - 60; var playerVelocityY = player.velocityY; if (playerBottom <= enemyTop + 20 && playerVelocityY >= 0) { // Player stomped enemy LK.getSound('stomp').play(); LK.setScore(LK.getScore() + 10); scoreTxt.setText('Score: ' + LK.getScore()); // Make player bounce player.velocityY = -8; // Remove enemy enemy.destroy(); enemies.splice(i, 1); // Increase game speed slightly gameSpeed += 0.01; if (enemySpawnRate > 60) { enemySpawnRate -= 1; } // Flash effect LK.effects.flashObject(enemy, 0xffff00, 200); } else { // Player touched enemy from side - game over LK.getSound('die').play(); LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } } } // Check big enemies for (var i = bigEnemies.length - 1; i >= 0; i--) { var bigEnemy = bigEnemies[i]; if (player.intersects(bigEnemy)) { // Check if player is above big enemy (stomping) var playerBottom = player.y; var bigEnemyTop = bigEnemy.y - 120; // Bigger hitbox due to scale var playerVelocityY = player.velocityY; if (playerBottom <= bigEnemyTop + 40 && playerVelocityY >= 0) { // Player stomped big enemy LK.getSound('stomp').play(); LK.setScore(LK.getScore() + 25); // More points for big enemy scoreTxt.setText('Score: ' + LK.getScore()); // Make player bounce higher player.velocityY = -12; // Remove big enemy bigEnemy.destroy(); bigEnemies.splice(i, 1); // Flash effect LK.effects.flashObject(bigEnemy, 0xffff00, 200); } else { // Player touched big enemy from side - game over LK.getSound('die').play(); LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } } } } game.update = function () { // Handle slow motion state var timeMultiplier = 1; if (slowMotionActive) { timeMultiplier = 0.3; // Slow down time to 30% speed slowMotionDuration--; slowMotionCountdownText.setText(''); if (slowMotionDuration <= 0) { slowMotionActive = false; slowMotionCooldown = slowMotionMaxCooldown; slowMotionButton.alpha = 0.3; } } else if (slowMotionCooldown > 0) { slowMotionCooldown--; var secondsLeft = Math.ceil(slowMotionCooldown / 60); slowMotionCountdownText.setText(secondsLeft.toString()); if (slowMotionCooldown <= 0) { slowMotionButton.alpha = 1.0; slowMotionCountdownText.setText(''); } } else { slowMotionCountdownText.setText(''); } // Update D-pad input if (dpad && dpad.update) { dpad.update(); } // Update enemy spawn timer enemySpawnTimer += timeMultiplier; if (enemySpawnTimer >= enemySpawnRate) { spawnEnemy(); enemySpawnTimer = 0; } // Update big enemy spawn timer bigEnemySpawnTimer += timeMultiplier; if (bigEnemySpawnTimer >= bigEnemySpawnRate) { spawnBigEnemy(); bigEnemySpawnTimer = 0; // Randomize next spawn time (between 8-15 seconds) bigEnemySpawnRate = 480 + Math.random() * 420; } // Check collisions checkCollisions(); // Remove enemies that fall off screen for (var i = enemies.length - 1; i >= 0; i--) { var enemy = enemies[i]; if (enemy.y > 2800) { enemy.destroy(); enemies.splice(i, 1); } } // Remove big enemies that fall off screen for (var i = bigEnemies.length - 1; i >= 0; i--) { var bigEnemy = bigEnemies[i]; if (bigEnemy.y > 2800) { bigEnemy.destroy(); bigEnemies.splice(i, 1); } } // Update enemy speed based on game speed for (var i = 0; i < enemies.length; i++) { enemies[i].speed = 2 * gameSpeed; } // Update big enemy speed based on game speed for (var i = 0; i < bigEnemies.length; i++) { bigEnemies[i].speed = 4 * gameSpeed; } };
===================================================================
--- original.js
+++ change.js
@@ -5,8 +5,67 @@
/****
* Classes
****/
+var BigEnemy = Container.expand(function () {
+ var self = Container.call(this);
+ var enemyGraphics = self.attachAsset('enemy', {
+ anchorX: 0.5,
+ anchorY: 1.0,
+ scaleX: 2.0,
+ // Make it twice as big
+ scaleY: 2.0
+ });
+ self.velocityX = 0;
+ self.velocityY = 0;
+ self.onGround = false;
+ self.speed = 4; // Faster than regular enemies
+ self.gravity = 0.8;
+ self.direction = 1;
+ self.update = function () {
+ // Apply gravity
+ self.velocityY += self.gravity;
+ // Move toward player
+ if (player.x < self.x) {
+ self.velocityX = -self.speed;
+ self.direction = -1;
+ } else {
+ self.velocityX = self.speed;
+ self.direction = 1;
+ }
+ // Apply velocity
+ var currentTimeMultiplier = slowMotionActive ? 0.3 : 1;
+ self.x += self.velocityX * currentTimeMultiplier;
+ self.y += self.velocityY * currentTimeMultiplier;
+ // Check platform collisions
+ self.onGround = false;
+ for (var i = 0; i < platforms.length; i++) {
+ var plat = platforms[i];
+ var platLeft = plat.obj.x - plat.width / 2;
+ var platRight = plat.obj.x + plat.width / 2;
+ // Check if enemy is within platform bounds horizontally
+ if (self.x >= platLeft && self.x <= platRight) {
+ // Check collision from above (landing on platform)
+ if (self.y >= plat.y && self.y <= plat.y + 30 && self.velocityY >= 0) {
+ self.y = plat.y;
+ self.velocityY = 0;
+ self.onGround = true;
+ break;
+ }
+ }
+ }
+ // Keep enemy on main platform only
+ if (self.x < 80) {
+ // Adjusted for bigger size
+ self.x = 80;
+ }
+ if (self.x > 1968) {
+ // Adjusted for bigger size
+ self.x = 1968;
+ }
+ };
+ return self;
+});
var DPad = Container.expand(function () {
var self = Container.call(this);
var dpadBase = self.attachAsset('dpadBase', {
anchorX: 0.5,
@@ -194,10 +253,13 @@
* Game Code
****/
var platformY = 2500;
var enemies = [];
+var bigEnemies = [];
var enemySpawnTimer = 0;
var enemySpawnRate = 120;
+var bigEnemySpawnTimer = 0;
+var bigEnemySpawnRate = 600; // Spawn every 10 seconds initially
var gameSpeed = 1;
var platforms = [];
var slowMotionActive = false;
var slowMotionDuration = 0;
@@ -307,9 +369,23 @@
enemy.lastIntersecting = false;
enemies.push(enemy);
game.addChild(enemy);
}
+function spawnBigEnemy() {
+ var bigEnemy = new BigEnemy();
+ // Randomly spawn from left or right side
+ if (Math.random() < 0.5) {
+ bigEnemy.x = -80; // From left
+ } else {
+ bigEnemy.x = 2128; // From right
+ }
+ bigEnemy.y = platformY;
+ bigEnemy.lastIntersecting = false;
+ bigEnemies.push(bigEnemy);
+ game.addChild(bigEnemy);
+}
function checkCollisions() {
+ // Check regular enemies
for (var i = enemies.length - 1; i >= 0; i--) {
var enemy = enemies[i];
if (player.intersects(enemy)) {
// Check if player is above enemy (stomping)
@@ -340,8 +416,36 @@
LK.showGameOver();
}
}
}
+ // Check big enemies
+ for (var i = bigEnemies.length - 1; i >= 0; i--) {
+ var bigEnemy = bigEnemies[i];
+ if (player.intersects(bigEnemy)) {
+ // Check if player is above big enemy (stomping)
+ var playerBottom = player.y;
+ var bigEnemyTop = bigEnemy.y - 120; // Bigger hitbox due to scale
+ var playerVelocityY = player.velocityY;
+ if (playerBottom <= bigEnemyTop + 40 && playerVelocityY >= 0) {
+ // Player stomped big enemy
+ LK.getSound('stomp').play();
+ LK.setScore(LK.getScore() + 25); // More points for big enemy
+ scoreTxt.setText('Score: ' + LK.getScore());
+ // Make player bounce higher
+ player.velocityY = -12;
+ // Remove big enemy
+ bigEnemy.destroy();
+ bigEnemies.splice(i, 1);
+ // Flash effect
+ LK.effects.flashObject(bigEnemy, 0xffff00, 200);
+ } else {
+ // Player touched big enemy from side - game over
+ LK.getSound('die').play();
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.showGameOver();
+ }
+ }
+ }
}
game.update = function () {
// Handle slow motion state
var timeMultiplier = 1;
@@ -374,8 +478,16 @@
if (enemySpawnTimer >= enemySpawnRate) {
spawnEnemy();
enemySpawnTimer = 0;
}
+ // Update big enemy spawn timer
+ bigEnemySpawnTimer += timeMultiplier;
+ if (bigEnemySpawnTimer >= bigEnemySpawnRate) {
+ spawnBigEnemy();
+ bigEnemySpawnTimer = 0;
+ // Randomize next spawn time (between 8-15 seconds)
+ bigEnemySpawnRate = 480 + Math.random() * 420;
+ }
// Check collisions
checkCollisions();
// Remove enemies that fall off screen
for (var i = enemies.length - 1; i >= 0; i--) {
@@ -384,9 +496,21 @@
enemy.destroy();
enemies.splice(i, 1);
}
}
+ // Remove big enemies that fall off screen
+ for (var i = bigEnemies.length - 1; i >= 0; i--) {
+ var bigEnemy = bigEnemies[i];
+ if (bigEnemy.y > 2800) {
+ bigEnemy.destroy();
+ bigEnemies.splice(i, 1);
+ }
+ }
// Update enemy speed based on game speed
for (var i = 0; i < enemies.length; i++) {
enemies[i].speed = 2 * gameSpeed;
}
+ // Update big enemy speed based on game speed
+ for (var i = 0; i < bigEnemies.length; i++) {
+ bigEnemies[i].speed = 4 * gameSpeed;
+ }
};
\ No newline at end of file
yuvarlak içinde bir kum küresi. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
daire içinde sola bakan bir ok. In-Game asset. 2d. High contrast. No shadows
eski bir saat. In-Game asset. 2d. High contrast. No shadows
metal platform. In-Game asset. 2d. High contrast. No shadows
Çim zemin. In-Game asset. 2d. High contrast. No shadows
Dinozor. In-Game asset. 2d. High contrast. No shadows
Büyük kum saati. In-Game asset. 2d. High contrast. No shadows
Işın. In-Game asset. 2d. High contrast. No shadows
Daire içinde mavi ışın In-Game asset. 2d. High contrast. No shadows