User prompt
Ekranın sağ ve solundaki boş yerlerede gidebilsinler ve birbirlerine yakın durmasınlar
User prompt
İnsanların yerleri sürekli değişsin
User prompt
İnsanları birbirlerine yakın olmicak ve ekranın ortasına gelmicek şekilde rastgele yerlere yerleştir.
User prompt
İnsan sayısını çoğalt
User prompt
Sarsılma efekti daha belli olsun
User prompt
Her 10 comboda bir insanlar hepsi aynı anda zıplasın ve daha çok sarsılma efekti olsun.
User prompt
İnsanlar zıpladığında ekran çok az sarsılsın
User prompt
Elleride olmasın
User prompt
İnsanların sadece elleri ve vücudu olsun
User prompt
İnsanları baştan tasarla ilk haline getir
User prompt
İnsanlara kafa ve vücut yap
User prompt
İnsanların tasarımını düzelt
User prompt
İnsanların elleri ile vücudu bir olsun
User prompt
Her nota tıklandığın rastgele insanlar zıplasın
User prompt
İnsanlar birbirine uzak olsunlar.
User prompt
İnsanları büyüt.
User prompt
Dışa doğru yerleştir yolun üzerine insan gelmesin
User prompt
İnsanları çapraz şekilde yerleştir.
User prompt
Daha çok koy
User prompt
İnsan sayısını çoğalt
User prompt
İnsanlar sadece sağ ve solda olsunlar
User prompt
İnsanlar bir konser yerine gelmiş gibi aralılık dursunlar
User prompt
İnsanların durma yerini yukarı çıkart
User prompt
İnsanlar oldukları yerde dursunlar
User prompt
İnsanlar her notaya zıplasın
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ // Note class for falling notes var Note = Container.expand(function () { var self = Container.call(this); // Lane index (0-3) self.lane = 0; self.hit = false; self.missed = false; self.speed = 0; // pixels per tick self.time = 0; // time (in ticks) when note should reach the target self.spawned = false; // Attach correct note asset based on lane self.setLane = function (laneIdx) { self.lane = laneIdx; var assetId = 'note' + (laneIdx + 1); var noteAsset = self.attachAsset(assetId, { anchorX: 0.5, anchorY: 0.5, width: NOTE_WIDTH, height: NOTE_HEIGHT }); }; // Called every tick self.update = function () { if (!self.spawned) return; self.y += self.speed; }; // Called when note is hit self.onHit = function () { if (self.hit || self.missed) return; self.hit = true; // Animate note tween(self, { alpha: 0, scaleX: 1.5, scaleY: 1.5 }, { duration: 150, easing: tween.easeOut, onFinish: function onFinish() { self.destroy(); } }); }; // Called when note is missed self.onMiss = function () { if (self.hit || self.missed) return; self.missed = true; LK.getSound('miss').play({ fade: { start: 1, end: 0, duration: 1000 } }); tween(self, { alpha: 0 }, { duration: 200, onFinish: function onFinish() { self.destroy(); } }); }; return self; }); // People class for animated people at lane edges var People = Container.expand(function () { var self = Container.call(this); self.isJumping = false; self.baseY = 0; // Attach a simple ellipse as the person (head) var head = self.attachAsset('centerCircle', { anchorX: 0.5, anchorY: 1, width: 80, height: 80, y: 0 }); // Attach a box as the body var body = self.attachAsset('bullet', { anchorX: 0.5, anchorY: 0, width: 36, height: 90, y: 0 }); body.y = -80; // Save baseY for jump animation self.baseY = self.y; // Animate jump self.jump = function () { if (self.isJumping) return; self.isJumping = true; var jumpHeight = 120; var jumpDuration = 180; var originalY = self.y; tween(self, { y: originalY - jumpHeight }, { duration: jumpDuration, easing: tween.easeOut, onFinish: function onFinish() { tween(self, { y: originalY }, { duration: jumpDuration, easing: tween.easeIn, onFinish: function onFinish() { self.isJumping = false; } }); } }); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x181818 }); /**** * Game Code ****/ // --- Game Constants --- // 4 note lanes, each with a different color for clarity // Notes are destroyed by tapping them directly before they reach the white target area at the bottom var NUM_LANES = 4; var LANE_WIDTH = 200; var LANE_SPACING = 40; var NOTE_WIDTH = 340; // Wider notes var NOTE_HEIGHT = 340; // Taller notes (stretches upward) var TARGET_HEIGHT = 60; // White target area is now just a visual "danger" zone, reduced height for smaller targets var LANE_HEIGHT = 2200; var GAME_WIDTH = 2048; var GAME_HEIGHT = 2732; var LANE_TOTAL_WIDTH = NUM_LANES * LANE_WIDTH + (NUM_LANES - 1) * LANE_SPACING; var LANE_START_X = (GAME_WIDTH - LANE_TOTAL_WIDTH) / 2 + LANE_WIDTH / 2; var TARGET_Y = GAME_HEIGHT - 220; // Target zone Y position // --- Game State --- var notes = []; // All active notes var noteIndex = 0; // Index of next note to spawn var songTicks = 0; // Ticks since song start var score = 0; var combo = 0; var maxCombo = 0; var misses = 0; var maxMisses = 10; var songEnded = false; var songStarted = false; var lastTick = 0; // Note speed multiplier for gradual speed up var noteSpeedMultiplier = 1.0; // --- UI Elements --- var scoreTxt = new Text2('0', { size: 120, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var comboTxt = new Text2('', { size: 70, fill: 0xFFE066 }); comboTxt.anchor.set(0.5, 0); LK.gui.top.addChild(comboTxt); comboTxt.y = 130; var missTxt = new Text2('', { size: 70, fill: 0xFF6666 }); missTxt.anchor.set(0.5, 0); LK.gui.top.addChild(missTxt); missTxt.y = 210; // --- Add Background --- var background = LK.getAsset('background', { anchorX: 0, anchorY: 0, x: 0, y: 0, width: GAME_WIDTH, height: GAME_HEIGHT }); game.addChild(background); // --- Lanes and Targets --- var lanes = []; var targets = []; var peopleLeft = []; var peopleRight = []; for (var i = 0; i < NUM_LANES; i++) { // Lane background var laneX = LANE_START_X + i * (LANE_WIDTH + LANE_SPACING); var lane = LK.getAsset('lane', { anchorX: 0.5, anchorY: 0, x: laneX, y: 0, width: LANE_WIDTH, height: LANE_HEIGHT }); game.addChild(lane); lanes.push(lane); // Visually improved target: larger, more distinct, with a colored border effect var target = LK.getAsset('target', { anchorX: 0.5, anchorY: 0.5, x: laneX, y: TARGET_Y, width: LANE_WIDTH + 40, // Make target slightly wider for better visuals height: TARGET_HEIGHT + 40 // Make target slightly taller for better visuals }); game.addChild(target); // Add a second, inner target for a "bullseye" effect var innerTarget = LK.getAsset('target', { anchorX: 0.5, anchorY: 0.5, x: laneX, y: TARGET_Y, width: LANE_WIDTH - 30, height: TARGET_HEIGHT - 20 }); game.addChild(innerTarget); // Store both for later effects targets.push({ outer: target, inner: innerTarget }); } // Place people at the absolute left and right edges of the screen var personY = TARGET_Y + 60; // Stand at the bottom, just above the target var leftEdgeX = 80; // 80px from the left edge (avoid 0,0 for menu) var rightEdgeX = GAME_WIDTH - 80; // 80px from the right edge // Place one person at the far left for each lane (stacked vertically) peopleLeft = []; for (var i = 0; i < NUM_LANES; i++) { var personLeft = new People(); personLeft.x = leftEdgeX; personLeft.y = personY - 120 * (NUM_LANES - 1) / 2 + 120 * i; game.addChild(personLeft); peopleLeft.push(personLeft); } // Place one person at the far right for each lane (stacked vertically) peopleRight = []; for (var i = 0; i < NUM_LANES; i++) { var personRight = new People(); personRight.x = rightEdgeX; personRight.y = personY - 120 * (NUM_LANES - 1) / 2 + 120 * i; game.addChild(personRight); peopleRight.push(personRight); } // --- Song Data (Random Infinite Notes) --- // Each note: {lane: 0-3, time: tick when note should reach target} // We'll generate notes on the fly, at random lanes and random intervals var bpm = 60; var ticksPerBeat = 60 * 60 / bpm; // 60fps var NOTE_TRAVEL_TICKS = 180; // 3 seconds at 60fps // Infinite random note generator state var nextNoteTick = 60; // When the next note should appear (in songTicks) function getRandomLane() { return Math.floor(Math.random() * NUM_LANES); } function getRandomInterval() { // Random interval between notes: 0.5x to 1.5x of ticksPerBeat return Math.floor(ticksPerBeat * (0.5 + Math.random())); } // --- Helper Functions --- function getLaneX(laneIdx) { return LANE_START_X + laneIdx * (LANE_WIDTH + LANE_SPACING); } // --- Game Logic --- // Start song/music function startSong() { if (songStarted) return; songStarted = true; LK.playMusic('song1'); songTicks = 0; noteIndex = 0; score = 0; combo = 0; maxCombo = 0; misses = 0; songEnded = false; scoreTxt.setText('0'); comboTxt.setText(''); missTxt.setText(''); notes.length = 0; // Reset nextNoteTick and noteSpeedMultiplier to ensure smooth start nextNoteTick = 60; noteSpeedMultiplier = 1.0; } // End song/game function endSong(win) { if (songEnded) return; songEnded = true; LK.stopMusic(); // No win or game over, just stop music and mark as ended } // --- Input Handling --- game.down = function (x, y, obj) { // Only allow input if song is running if (!songStarted || songEnded) return; // Check if tap is on any note (from topmost to bottom) var hit = false; for (var i = notes.length - 1; i >= 0; i--) { var note = notes[i]; if (note.hit || note.missed) continue; // Get note bounds var noteLeft = note.x - NOTE_WIDTH / 2; var noteRight = note.x + NOTE_WIDTH / 2; var noteTop = note.y - NOTE_HEIGHT / 2; var noteBottom = note.y + NOTE_HEIGHT / 2; if (x >= noteLeft && x <= noteRight && y >= noteTop && y <= noteBottom) { // Hit! note.onHit(); hit = true; score += 100; combo += 1; if (combo > maxCombo) maxCombo = combo; scoreTxt.setText(score + ''); comboTxt.setText(combo > 1 ? combo + ' Combo!' : ''); LK.getSound('tap').play(); // Make all people jump when any note is hit! if (typeof peopleLeft !== "undefined" && typeof peopleRight !== "undefined") { for (var j = 0; j < peopleLeft.length; j++) { if (peopleLeft[j]) peopleLeft[j].jump(); } for (var j = 0; j < peopleRight.length; j++) { if (peopleRight[j]) peopleRight[j].jump(); } } // Show floating feedback text based on combo var feedbackText = ''; if (combo >= 30) { feedbackText = 'PERFECT!'; } else if (combo >= 15) { feedbackText = 'GREAT!'; } else if (combo >= 5) { feedbackText = 'GOOD!'; } if (feedbackText) { var fbTxt = new Text2(feedbackText, { size: 120, fill: 0xFFD700, font: "'GillSans-Bold',Impact,'Arial Black',Tahoma" }); fbTxt.anchor.set(0.5, 0.5); fbTxt.x = GAME_WIDTH / 2; fbTxt.y = GAME_HEIGHT / 2 - 200; fbTxt.alpha = 1; game.addChild(fbTxt); tween(fbTxt, { y: fbTxt.y - 120, alpha: 0 }, { duration: 700, easing: tween.easeOut, onFinish: function onFinish() { fbTxt.destroy(); } }); } break; } } if (!hit) { // Missed tap (no note hit) combo = 0; comboTxt.setText(''); // No misses for tap misses, no flash } }; // --- Main Game Loop --- game.update = function () { if (!songStarted || songEnded) return; songTicks += 1; // Gradually increase noteSpeedMultiplier (very slow ramp, e.g. +0.0002 per tick) if (noteSpeedMultiplier < 2.0) { noteSpeedMultiplier += 0.0002; if (noteSpeedMultiplier > 2.0) noteSpeedMultiplier = 2.0; } // Spawn notes as needed (random, infinite) // After 5000 points, do not increase note spawn count; only speed increases var notesToSpawn = 1; // No change to notesToSpawn after 5000 points while (songTicks >= nextNoteTick - NOTE_TRAVEL_TICKS) { for (var spawnIdx = 0; spawnIdx < notesToSpawn; spawnIdx++) { var lane = getRandomLane(); var noteTime = nextNoteTick; var note = new Note(); note.setLane(lane); note.x = getLaneX(lane); note.y = -NOTE_HEIGHT / 2; note.speed = (TARGET_Y + NOTE_HEIGHT / 2) / NOTE_TRAVEL_TICKS * noteSpeedMultiplier; note.time = noteTime; note.spawned = true; notes.push(note); game.addChild(note); } // Schedule next note nextNoteTick += getRandomInterval(); } // Update notes for (var i = notes.length - 1; i >= 0; i--) { var note = notes[i]; note.update(); // If note reached target zone and not hit, mark as missed if (!note.hit && !note.missed && note.y >= TARGET_Y + TARGET_HEIGHT / 2) { note.onMiss(); combo = 0; misses += 1; comboTxt.setText(''); missTxt.setText('Misses: ' + misses); LK.getSound('miss').play({ fade: { start: 1, end: 0, duration: 1000 } }); LK.effects.flashObject(targets[note.lane].outer, 0xff0000, 200); LK.effects.flashObject(targets[note.lane].inner, 0xff6666, 200); if (misses >= maxMisses) { // No game over, just keep going } } // Remove destroyed notes if (note.destroyed) { notes.splice(i, 1); } } // People remain stationary; no movement code needed here // No win condition, keep game running }; // --- Start the game --- startSong();
===================================================================
--- original.js
+++ change.js
@@ -439,22 +439,9 @@
if (note.destroyed) {
notes.splice(i, 1);
}
}
- // Move people upward over time
- for (var i = 0; i < peopleLeft.length; i++) {
- var pLeft = peopleLeft[i];
- var pRight = peopleRight[i];
- // Save lastY for possible future use
- if (pLeft.lastY === undefined) pLeft.lastY = pLeft.y;
- if (pRight.lastY === undefined) pRight.lastY = pRight.y;
- // Move up by 1.2px per frame (adjust as needed for speed)
- pLeft.y -= 1.2;
- pRight.y -= 1.2;
- // Update lastY
- pLeft.lastY = pLeft.y;
- pRight.lastY = pRight.y;
- }
+ // People remain stationary; no movement code needed here
// No win condition, keep game running
};
// --- Start the game ---
startSong();
\ No newline at end of file