User prompt
Arka plana görüntü koyalım
User prompt
Arka plan olsun
User prompt
Fayansa vurdumuzda ses gelmesin
User prompt
Nişan fayansı vurduğunda 10 % büyüyüp esgi haline gelsin
User prompt
Payansa vuruş sesi üç tane olsun
User prompt
Payans sağada ve sola da dönsün
User prompt
Payansın her vurduğumuzda nişan 90 derece dönüb esqi haline dönsün
User prompt
Her payans vurdumuzda nişan 80 derece sağa ve sola dönsün
User prompt
Oyun sonsuz olsun
User prompt
Skor her payans vurmak 10 puan
User prompt
Küpler gidik e hızlansın
User prompt
Nişan payansın üstündü gürünsün
User prompt
Silah kare olsun ve biraz yukarıda olsun
User prompt
Kareler büyük olsun
User prompt
Fayanslar kare olsun
User prompt
Mermi atmayalım sadece nişanı sağa ve sola yaparak kare payansları üzerine getirmeye çalışalım
Code edit (1 edits merged)
Please save this source code
User prompt
Beat Fire: EDM Rhythm Shooter
Initial prompt
2020 Süper Müzik Oyunu. Ritim ile dövüşün ve müzik ziyafetinin tadını çıkarın! Beat Fire - 2021'in Popüler ve Eşsiz Müzik Oyunu! EDM müziği ve silah sesleri ile yeni oyun! Nişan al ve ateş !!! Bir kez başladığınızda, asla durmayacaksınız! Bu harika müzik oyununu kaçıramazsınız! Nasıl oynanır? - Müzik ziyafetinin tadını çıkarın. Fayanslar EDM ritmi ile düşecek. - Oynaması kolay. Taşları hedeflemek ve ateş etmek için basılı tutun ve sürükleyin. - Parmaklarınızın EDM ritmine göre dans etmesine izin verin. Hiçbir fayansı kaçırmayın! Neden Beat Fire'ı seçmelisiniz? - Bağımlılık yaratan EDM şarkıları! En iyi EDM, Pop, DJ ve Hop müziği. - Gun battlefield remixi geliyor! Dövmek! Bang! - El hızınızı test edin. Kalbinizi ve ruhunuzu rahatlatın!
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ // AimBar class (player's horizontal aim) var AimBar = Container.expand(function () { var self = Container.call(this); var aimGfx = self.attachAsset('gun', { anchorX: 0.5, anchorY: 0.5 }); self.gfx = aimGfx; return self; }); // Tile class (falling note) var Tile = Container.expand(function () { var self = Container.call(this); var tileGfx = self.attachAsset('tile', { anchorX: 0.5, anchorY: 0.5 }); self.gfx = tileGfx; self.speed = 0; // Set per tile self.hit = false; self.update = function () { if (self.hit) return; self.y += self.speed; }; // Flash tile when hit self.flashHit = function () { self.hit = true; tween(self.gfx, { tint: 0xffe100 }, { duration: 80, onFinish: function onFinish() { tween(self.gfx, { tint: 0x00eaff }, { duration: 120 }); } }); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x0a0a1a }); /**** * Game Code ****/ // --- Game constants --- // Tiles (falling notes) // Gun (player's shooter) // Bullet // Sound: gunfire // Sound: tile hit // Music: EDM track (looping) var GAME_W = 2048, GAME_H = 2732; var GUN_Y = GAME_H - 320; var TILE_ROWS = 4; // Number of tile lanes var TILE_LANE_W = GAME_W / TILE_ROWS; var TILE_SPAWN_Y = -60; var TILE_TARGET_Y = GAME_H - 520; // Where tiles should be hit var TILE_SPEED = 22; // px per frame (tuned for rhythm) var TILE_INTERVAL = 32; // frames between tiles (tuned for rhythm) var BULLET_SPEED = -60; var BULLET_FIRE_INTERVAL = 6; // frames between bullets when holding var HIT_WINDOW = 90; // px vertical window for hit var GUN_MOVE_LIMIT = 180; // px from screen edge // --- Game state --- var aimBar; var tiles = []; var score = 0; var dragAim = false; var dragOffsetX = 0; var tickCount = 0; var nextTileTick = 0; var tilePattern = []; // Array of {lane, tick} var patternIndex = 0; var gameOver = false; // --- UI --- var scoreTxt = new Text2('0', { size: 120, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // --- Music --- LK.playMusic('edm1'); // --- Helper: Generate a simple rhythm pattern (random for now) --- function generatePattern() { // For MVP: 64 tiles, random lanes, evenly spaced tilePattern = []; var t = 0; for (var i = 0; i < 64; i++) { var lane = Math.floor(Math.random() * TILE_ROWS); tilePattern.push({ lane: lane, tick: t }); t += TILE_INTERVAL; } } // --- Helper: Spawn a tile at a given lane --- function spawnTile(lane) { var tile = new Tile(); tile.x = TILE_LANE_W * (lane + 0.5); tile.y = TILE_SPAWN_Y; tile.speed = TILE_SPEED; tile.lane = lane; tile.hit = false; tiles.push(tile); game.addChild(tile); } // --- Helper: Fire a bullet from gun towards a lane --- function fireBullet() { var barrel = gun.getBarrel(); var bullet = new Bullet(); bullet.x = barrel.x; bullet.y = barrel.y; bullet.speed = BULLET_SPEED; bullets.push(bullet); game.addChild(bullet); LK.getSound('gunfire').play(); } // --- Helper: Check if bullet hits a tile --- function checkBulletTileCollision(bullet, tile) { // Only check if tile not hit if (tile.hit) return false; // Check if bullet and tile are in same lane (x overlap) var dx = Math.abs(bullet.x - tile.x); if (dx > TILE_LANE_W / 2 - 30) return false; // Check if bullet is within hit window (y) var dy = Math.abs(bullet.y - tile.y); if (dy < HIT_WINDOW) return true; return false; } // --- Helper: End game --- function endGame() { if (gameOver) return; gameOver = true; LK.effects.flashScreen(0xff0033, 800); LK.showGameOver(); } // --- Helper: Win game --- function winGame() { if (gameOver) return; gameOver = true; LK.effects.flashScreen(0x00ff99, 800); LK.showYouWin(); } // --- Initialize game objects --- function resetGame() { // Remove all tiles for (var i = 0; i < tiles.length; i++) tiles[i].destroy(); tiles = []; score = 0; scoreTxt.setText('0'); tickCount = 0; nextTileTick = 0; patternIndex = 0; gameOver = false; dragAim = false; // AimBar if (aimBar) aimBar.destroy(); aimBar = new AimBar(); aimBar.x = GAME_W / 2; // Move the gun to be just above the tile target line so it appears above the payans aimBar.y = TILE_TARGET_Y - aimBar.gfx.height / 2 - 30; game.addChild(aimBar); // Pattern generatePattern(); } resetGame(); // --- Input: Drag to move aim bar horizontally --- game.down = function (x, y, obj) { // Only allow drag if touch is on aim bar or below if (y >= aimBar.y - aimBar.gfx.height / 2 - 60) { dragAim = true; dragOffsetX = x - aimBar.x; } }; game.move = function (x, y, obj) { if (dragAim) { // Clamp aim bar movement to screen var nx = x - dragOffsetX; nx = Math.max(GUN_MOVE_LIMIT, Math.min(GAME_W - GUN_MOVE_LIMIT, nx)); aimBar.x = nx; } }; game.up = function (x, y, obj) { dragAim = false; }; // --- Main game loop --- game.update = function () { if (gameOver) return; tickCount++; // --- Spawn tiles according to pattern --- while (patternIndex < tilePattern.length && tilePattern[patternIndex].tick <= tickCount) { spawnTile(tilePattern[patternIndex].lane); patternIndex++; } // --- Move tiles and check for hits --- for (var i = tiles.length - 1; i >= 0; i--) { var tile = tiles[i]; tile.update(); // Missed tile? (passed target line) if (!tile.hit && tile.y > TILE_TARGET_Y + HIT_WINDOW) { endGame(); return; } // Remove tile if off screen if (tile.y > GAME_H + 100) { tile.destroy(); tiles.splice(i, 1); continue; } // Check for hit: if tile is within hit window and aimBar is aligned horizontally if (!tile.hit && Math.abs(tile.y - TILE_TARGET_Y) < HIT_WINDOW) { var dx = Math.abs(tile.x - aimBar.x); if (dx < TILE_LANE_W / 2 - 30) { tile.flashHit(); LK.getSound('tilehit').play(); score += 1; scoreTxt.setText(score); // Remove tile after short delay (function (tileObj) { LK.setTimeout(function () { tileObj.destroy(); var idx = tiles.indexOf(tileObj); if (idx !== -1) tiles.splice(idx, 1); }, 80); })(tile); // Win condition if (score >= tilePattern.length) { winGame(); } } } } }; // --- Reset game on game over/win --- LK.on('gameover', function () { resetGame(); }); LK.on('youwin', function () { resetGame(); });
===================================================================
--- original.js
+++ change.js
@@ -58,15 +58,15 @@
/****
* Game Code
****/
-// Music: EDM track (looping)
-// Sound: tile hit
-// Sound: gunfire
-// Bullet
-// Gun (player's shooter)
-// Tiles (falling notes)
// --- Game constants ---
+// Tiles (falling notes)
+// Gun (player's shooter)
+// Bullet
+// Sound: gunfire
+// Sound: tile hit
+// Music: EDM track (looping)
var GAME_W = 2048,
GAME_H = 2732;
var GUN_Y = GAME_H - 320;
var TILE_ROWS = 4; // Number of tile lanes
@@ -176,10 +176,10 @@
// AimBar
if (aimBar) aimBar.destroy();
aimBar = new AimBar();
aimBar.x = GAME_W / 2;
- // Move the gun a bit higher (e.g. 200px higher than before)
- aimBar.y = GUN_Y - 200;
+ // Move the gun to be just above the tile target line so it appears above the payans
+ aimBar.y = TILE_TARGET_Y - aimBar.gfx.height / 2 - 30;
game.addChild(aimBar);
// Pattern
generatePattern();
}