User prompt
Ekran alanı dısında kalan bölümleri kes
User prompt
Oyun ekranı dısında kalan görüntüleri animasyonları silerek optimize et
User prompt
Notalara neon ışık ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Parçacık dagılma efekti arttır ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Parçacık efektini arttır ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Nota patlama parçacık efekti büyüt ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Notalar için oluşturulan yeşil ısık efectini kaldır
User prompt
Nota parçacık efektini ve gitar teli sallantı efektini arttır ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Nota vuruldugunda parçaçık efekti aktif olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Notalar hedef bölgede ise alt 3 nesneden sag orta sol notalara parçacık efekti aktif olur ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Notalar hedef bölgesi içinde patlatışırsa notalara parça dagılma efekti ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Notalar birbiriyle temas etmesin mesafe koru
User prompt
Gitar teli sallanma efekti sonrası şerit çizgileri saga sola hareket ediyor
User prompt
Notalar üst üste cıkamaz
User prompt
Sallantı efecti gitar teli efekti olarak degiştir ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Altfaki 3 nesneye dokundugımda baglı oldugu nota şeridine sallantı efekti baglansın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Nota şerit sallantı efektini alttaki 3 nesne ile optimize et ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Nota şerit sallantı efektini kaldır
User prompt
Nota Seritlerinteki sarsıntı efectini 3 nesne ele aktif et ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
3 nota aynı anda hedef bölgeye giremez
User prompt
Nota hızını azalt
User prompt
Notalar hedef bölgeye girdigi anda 3 nesneyle patlamayı optimize et ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Bu eklenen üç nesne sag sol ve ortadaki notalar hedef bölgeye girdiginde dokundugumda nota patlıcak ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Aralarındaki mesafeyi aç
User prompt
30x yap ↪💡 Consider importing and using the following plugins: @upit/tween.v1
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Note = Container.expand(function (trackIndex, isPowerNote) { var self = Container.call(this); self.trackIndex = trackIndex; self.isPowerNote = isPowerNote || false; self.speed = 8; self.hasBeenTapped = false; self.lastY = 0; var noteGraphics = self.attachAsset(self.isPowerNote ? 'powerNote' : 'note', { anchorX: 0.5, anchorY: 0.5 }); if (self.isPowerNote) { noteGraphics.tint = 0xFFD93D; self.scale.set(1.2); } self.update = function () { self.lastY = self.y; self.y += self.speed; }; self.checkTiming = function () { var targetY = unifiedTargetZone.y; var distance = Math.abs(self.y - targetY); if (distance <= 30) { return 'perfect'; } else if (distance <= 60) { return 'good'; } return 'miss'; }; return self; }); var TargetZone = Container.expand(function (trackIndex) { var self = Container.call(this); self.trackIndex = trackIndex; var zoneGraphics = self.attachAsset('targetZone', { anchorX: 0.5, anchorY: 0.5 }); zoneGraphics.alpha = 0.9; self.flash = function () { zoneGraphics.alpha = 1.0; tween(zoneGraphics, { alpha: 0.9 }, { duration: 200 }); }; return self; }); var Track = Container.expand(function (trackIndex) { var self = Container.call(this); self.trackIndex = trackIndex; var trackGraphics = self.attachAsset('track', { anchorX: 0.5, anchorY: 0 }); trackGraphics.alpha = 0.1; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a2e }); /**** * Game Code ****/ // Game variables var notes = []; var tracks = []; var targetZones = []; var numTracks = 3; var trackWidth = 300; var gameWidth = 2048; var score = 0; var combo = 0; var maxCombo = 0; var missedNotes = 0; var maxMissedNotes = 5; var noteSpawnTimer = 0; var noteSpawnInterval = 45; var gameSpeed = 1; var difficultyTimer = 0; // UI elements var scoreTxt = new Text2('Score: 0', { size: 60, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var comboTxt = new Text2('Combo: 0', { size: 50, fill: 0xFFD93D }); comboTxt.anchor.set(0, 0); comboTxt.x = 150; comboTxt.y = 150; LK.gui.top.addChild(comboTxt); var missedTxt = new Text2('Missed: 0/5', { size: 40, fill: 0xFF6B6B }); missedTxt.anchor.set(1, 0); LK.gui.topRight.addChild(missedTxt); // Add background image var background = LK.getAsset('background', { anchorX: 0, anchorY: 0 }); background.x = 0; background.y = 0; background.tint = 0x000000; game.addChild(background); // Initialize tracks and unified target zone var startX = (gameWidth - numTracks * trackWidth) / 2 + trackWidth / 2; for (var i = 0; i < numTracks; i++) { var track = new Track(i); track.x = startX + i * trackWidth; track.y = 0; tracks.push(track); game.addChild(track); } // Create single unified target zone covering all tracks var unifiedTargetZone = new TargetZone(0); unifiedTargetZone.x = gameWidth / 2; // Center of screen unifiedTargetZone.y = 1600; // Scale the target zone to cover all tracks unifiedTargetZone.scale.x = numTracks * trackWidth / 350; // Scale to cover all track widths targetZones.push(unifiedTargetZone); // Add unified background covering entire play area var unifiedBg = LK.getAsset('unifiedBackground', { anchorX: 0.5, anchorY: 0 }); unifiedBg.x = gameWidth / 2; // Center horizontally unifiedBg.y = 0; // Start from top of screen unifiedBg.width = gameWidth + 800; // Extend much further beyond screen width on both sides unifiedBg.height = 3500; // Extend further downward beyond screen height unifiedBg.alpha = 0.8; // Slightly transparent to show game elements clearly game.addChild(unifiedBg); // Re-add strip lines and unified target zone to foreground for (var i = 0; i < numTracks; i++) { // Add strip line for each track (moved to foreground) var stripLine = LK.getAsset('stripLine', { anchorX: 0.5, anchorY: 0 }); stripLine.x = startX + i * trackWidth; stripLine.y = 0; stripLine.alpha = 0.8; game.addChild(stripLine); } // Add unified target zone to foreground game.addChild(unifiedTargetZone); // Create rounded border around unified target zone var borderThickness = 8; var targetZoneWidth = 350 * unifiedTargetZone.scale.x; var targetZoneHeight = 200; // Top border var topBorder = LK.getAsset('stripLine', { anchorX: 0.5, anchorY: 0.5 }); topBorder.width = targetZoneWidth - borderThickness; topBorder.height = borderThickness; topBorder.x = unifiedTargetZone.x; topBorder.y = unifiedTargetZone.y - targetZoneHeight / 2 - borderThickness / 2; topBorder.alpha = 1.0; game.addChild(topBorder); // Bottom border var bottomBorder = LK.getAsset('stripLine', { anchorX: 0.5, anchorY: 0.5 }); bottomBorder.width = targetZoneWidth - borderThickness; bottomBorder.height = borderThickness; bottomBorder.x = unifiedTargetZone.x; bottomBorder.y = unifiedTargetZone.y + targetZoneHeight / 2 + borderThickness / 2; bottomBorder.alpha = 1.0; game.addChild(bottomBorder); // Left border var leftBorder = LK.getAsset('stripLine', { anchorX: 0.5, anchorY: 0.5 }); leftBorder.width = borderThickness; leftBorder.height = targetZoneHeight - borderThickness; leftBorder.x = unifiedTargetZone.x - targetZoneWidth / 2 - borderThickness / 2; leftBorder.y = unifiedTargetZone.y; leftBorder.alpha = 1.0; game.addChild(leftBorder); // Right border var rightBorder = LK.getAsset('stripLine', { anchorX: 0.5, anchorY: 0.5 }); rightBorder.width = borderThickness; rightBorder.height = targetZoneHeight - borderThickness; rightBorder.x = unifiedTargetZone.x + targetZoneWidth / 2 + borderThickness / 2; rightBorder.y = unifiedTargetZone.y; rightBorder.alpha = 1.0; game.addChild(rightBorder); // Add rounded corners with ellipses // Top-left corner var topLeftCorner = LK.getAsset('cornerEllipse', { anchorX: 0.5, anchorY: 0.5 }); topLeftCorner.x = unifiedTargetZone.x - targetZoneWidth / 2; topLeftCorner.y = unifiedTargetZone.y - targetZoneHeight / 2; topLeftCorner.alpha = 1.0; game.addChild(topLeftCorner); // Top-right corner var topRightCorner = LK.getAsset('cornerEllipse', { anchorX: 0.5, anchorY: 0.5 }); topRightCorner.x = unifiedTargetZone.x + targetZoneWidth / 2; topRightCorner.y = unifiedTargetZone.y - targetZoneHeight / 2; topRightCorner.alpha = 1.0; game.addChild(topRightCorner); // Bottom-left corner var bottomLeftCorner = LK.getAsset('cornerEllipse', { anchorX: 0.5, anchorY: 0.5 }); bottomLeftCorner.x = unifiedTargetZone.x - targetZoneWidth / 2; bottomLeftCorner.y = unifiedTargetZone.y + targetZoneHeight / 2; bottomLeftCorner.alpha = 1.0; game.addChild(bottomLeftCorner); // Bottom-right corner var bottomRightCorner = LK.getAsset('cornerEllipse', { anchorX: 0.5, anchorY: 0.5 }); bottomRightCorner.x = unifiedTargetZone.x + targetZoneWidth / 2; bottomRightCorner.y = unifiedTargetZone.y + targetZoneHeight / 2; bottomRightCorner.alpha = 1.0; game.addChild(bottomRightCorner); // Helper functions function spawnNote() { var trackIndex = Math.floor(Math.random() * numTracks); var isPowerNote = Math.random() < 0.1; var note = new Note(trackIndex, isPowerNote); note.x = startX + trackIndex * trackWidth; note.y = -50; note.speed = 8 * gameSpeed; notes.push(note); game.addChild(note); } function updateScore(points) { score += points * Math.max(1, Math.floor(combo / 5)); scoreTxt.setText('Score: ' + score); LK.setScore(score); } function updateCombo(increase) { if (increase) { combo++; maxCombo = Math.max(maxCombo, combo); } else { combo = 0; } comboTxt.setText('Combo: ' + combo); } function updateMissed() { missedNotes++; missedTxt.setText('Missed: ' + missedNotes + '/' + maxMissedNotes); // Player is now immortal - no game over on missed notes } function showPerfectEffect(x, y) { var effect = LK.getAsset('perfectEffect', { anchorX: 0.5, anchorY: 0.5 }); effect.x = x; effect.y = y; effect.alpha = 0.8; game.addChild(effect); tween(effect, { alpha: 0, scaleX: 2, scaleY: 2 }, { duration: 300, onFinish: function onFinish() { effect.destroy(); } }); } function checkNoteInTrack(trackIndex) { for (var i = 0; i < notes.length; i++) { var note = notes[i]; if (note.trackIndex === trackIndex && !note.hasBeenTapped) { var timing = note.checkTiming(); if (timing !== 'miss') { note.hasBeenTapped = true; var points = 0; if (timing === 'perfect') { points = note.isPowerNote ? 200 : 100; LK.getSound('perfect').play(); showPerfectEffect(note.x, note.y); } else if (timing === 'good') { points = note.isPowerNote ? 100 : 50; LK.getSound('tap').play(); } updateScore(points); updateCombo(true); unifiedTargetZone.flash(); // Add shake effect to strip line var stripLine = game.children.find(function (child) { return child.x === startX + trackIndex * trackWidth && child.width === 8; }); if (stripLine) { var originalX = stripLine.x; tween(stripLine, { x: originalX + 50 }, { duration: 25, onFinish: function onFinish() { tween(stripLine, { x: originalX - 50 }, { duration: 25, onFinish: function onFinish() { tween(stripLine, { x: originalX + 35 }, { duration: 25, onFinish: function onFinish() { tween(stripLine, { x: originalX - 35 }, { duration: 25, onFinish: function onFinish() { tween(stripLine, { x: originalX + 20 }, { duration: 20, onFinish: function onFinish() { tween(stripLine, { x: originalX - 20 }, { duration: 20, onFinish: function onFinish() { tween(stripLine, { x: originalX + 10 }, { duration: 15, onFinish: function onFinish() { tween(stripLine, { x: originalX }, { duration: 15 }); } }); } }); } }); } }); } }); } }); } }); } note.destroy(); notes.splice(i, 1); return true; } } } return false; } // Touch handlers game.down = function (x, y, obj) { for (var i = 0; i < numTracks; i++) { var trackX = startX + i * trackWidth; if (x >= trackX - trackWidth / 2 && x <= trackX + trackWidth / 2) { if (!checkNoteInTrack(i)) { updateCombo(false); LK.getSound('miss').play(); } break; } } }; // Main game loop game.update = function () { // Spawn notes noteSpawnTimer++; if (noteSpawnTimer >= noteSpawnInterval) { spawnNote(); noteSpawnTimer = 0; } // Update difficulty difficultyTimer++; if (difficultyTimer >= 1800) { // Every 30 seconds gameSpeed += 0.2; noteSpawnInterval = Math.max(20, noteSpawnInterval - 2); difficultyTimer = 0; } // Update notes for (var i = notes.length - 1; i >= 0; i--) { var note = notes[i]; // Check if note missed target zone if (!note.hasBeenTapped && note.lastY <= 1700 && note.y > 1700) { updateCombo(false); updateMissed(); note.destroy(); notes.splice(i, 1); continue; } // Remove notes that are off screen if (note.y > 2800) { note.destroy(); notes.splice(i, 1); } } // Win condition if (score >= 10000) { LK.showYouWin(); } }; // Add 3 objects at bottom of target zone (left, center, right) var targetBottomY = unifiedTargetZone.y + targetZoneHeight / 2 + 600; // Position even further down var objectSpacing = targetZoneWidth / 2.5; // Increase spacing between objects // Left object var leftObject = LK.getAsset('cornerEllipse', { anchorX: 0.5, anchorY: 0.5 }); leftObject.x = unifiedTargetZone.x - objectSpacing; leftObject.y = targetBottomY; leftObject.tint = 0xff6b6b; // Red color for distinction leftObject.alpha = 0.8; game.addChild(leftObject); // Center object var centerObject = LK.getAsset('cornerEllipse', { anchorX: 0.5, anchorY: 0.5 }); centerObject.x = unifiedTargetZone.x; centerObject.y = targetBottomY; centerObject.tint = 0x00ff00; // Green color for distinction centerObject.alpha = 0.8; game.addChild(centerObject); // Right object var rightObject = LK.getAsset('cornerEllipse', { anchorX: 0.5, anchorY: 0.5 }); rightObject.x = unifiedTargetZone.x + objectSpacing; rightObject.y = targetBottomY; rightObject.tint = 0x4169e1; // Blue color for distinction rightObject.alpha = 0.8; game.addChild(rightObject); // Scale all 3 objects to 30x using tween tween(leftObject, { scaleX: 30, scaleY: 30 }, { duration: 1000, easing: tween.easeOut, onFinish: function onFinish() { // Move to topmost layer after scaling game.removeChild(leftObject); game.addChild(leftObject); } }); tween(centerObject, { scaleX: 30, scaleY: 30 }, { duration: 1000, easing: tween.easeOut, onFinish: function onFinish() { // Move to topmost layer after scaling game.removeChild(centerObject); game.addChild(centerObject); } }); tween(rightObject, { scaleX: 30, scaleY: 30 }, { duration: 1000, easing: tween.easeOut, onFinish: function onFinish() { // Move to topmost layer after scaling game.removeChild(rightObject); game.addChild(rightObject); } }); // Start background music LK.playMusic('bgmusic'); ;
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Note = Container.expand(function (trackIndex, isPowerNote) {
var self = Container.call(this);
self.trackIndex = trackIndex;
self.isPowerNote = isPowerNote || false;
self.speed = 8;
self.hasBeenTapped = false;
self.lastY = 0;
var noteGraphics = self.attachAsset(self.isPowerNote ? 'powerNote' : 'note', {
anchorX: 0.5,
anchorY: 0.5
});
if (self.isPowerNote) {
noteGraphics.tint = 0xFFD93D;
self.scale.set(1.2);
}
self.update = function () {
self.lastY = self.y;
self.y += self.speed;
};
self.checkTiming = function () {
var targetY = unifiedTargetZone.y;
var distance = Math.abs(self.y - targetY);
if (distance <= 30) {
return 'perfect';
} else if (distance <= 60) {
return 'good';
}
return 'miss';
};
return self;
});
var TargetZone = Container.expand(function (trackIndex) {
var self = Container.call(this);
self.trackIndex = trackIndex;
var zoneGraphics = self.attachAsset('targetZone', {
anchorX: 0.5,
anchorY: 0.5
});
zoneGraphics.alpha = 0.9;
self.flash = function () {
zoneGraphics.alpha = 1.0;
tween(zoneGraphics, {
alpha: 0.9
}, {
duration: 200
});
};
return self;
});
var Track = Container.expand(function (trackIndex) {
var self = Container.call(this);
self.trackIndex = trackIndex;
var trackGraphics = self.attachAsset('track', {
anchorX: 0.5,
anchorY: 0
});
trackGraphics.alpha = 0.1;
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x1a1a2e
});
/****
* Game Code
****/
// Game variables
var notes = [];
var tracks = [];
var targetZones = [];
var numTracks = 3;
var trackWidth = 300;
var gameWidth = 2048;
var score = 0;
var combo = 0;
var maxCombo = 0;
var missedNotes = 0;
var maxMissedNotes = 5;
var noteSpawnTimer = 0;
var noteSpawnInterval = 45;
var gameSpeed = 1;
var difficultyTimer = 0;
// UI elements
var scoreTxt = new Text2('Score: 0', {
size: 60,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var comboTxt = new Text2('Combo: 0', {
size: 50,
fill: 0xFFD93D
});
comboTxt.anchor.set(0, 0);
comboTxt.x = 150;
comboTxt.y = 150;
LK.gui.top.addChild(comboTxt);
var missedTxt = new Text2('Missed: 0/5', {
size: 40,
fill: 0xFF6B6B
});
missedTxt.anchor.set(1, 0);
LK.gui.topRight.addChild(missedTxt);
// Add background image
var background = LK.getAsset('background', {
anchorX: 0,
anchorY: 0
});
background.x = 0;
background.y = 0;
background.tint = 0x000000;
game.addChild(background);
// Initialize tracks and unified target zone
var startX = (gameWidth - numTracks * trackWidth) / 2 + trackWidth / 2;
for (var i = 0; i < numTracks; i++) {
var track = new Track(i);
track.x = startX + i * trackWidth;
track.y = 0;
tracks.push(track);
game.addChild(track);
}
// Create single unified target zone covering all tracks
var unifiedTargetZone = new TargetZone(0);
unifiedTargetZone.x = gameWidth / 2; // Center of screen
unifiedTargetZone.y = 1600;
// Scale the target zone to cover all tracks
unifiedTargetZone.scale.x = numTracks * trackWidth / 350; // Scale to cover all track widths
targetZones.push(unifiedTargetZone);
// Add unified background covering entire play area
var unifiedBg = LK.getAsset('unifiedBackground', {
anchorX: 0.5,
anchorY: 0
});
unifiedBg.x = gameWidth / 2; // Center horizontally
unifiedBg.y = 0; // Start from top of screen
unifiedBg.width = gameWidth + 800; // Extend much further beyond screen width on both sides
unifiedBg.height = 3500; // Extend further downward beyond screen height
unifiedBg.alpha = 0.8; // Slightly transparent to show game elements clearly
game.addChild(unifiedBg);
// Re-add strip lines and unified target zone to foreground
for (var i = 0; i < numTracks; i++) {
// Add strip line for each track (moved to foreground)
var stripLine = LK.getAsset('stripLine', {
anchorX: 0.5,
anchorY: 0
});
stripLine.x = startX + i * trackWidth;
stripLine.y = 0;
stripLine.alpha = 0.8;
game.addChild(stripLine);
}
// Add unified target zone to foreground
game.addChild(unifiedTargetZone);
// Create rounded border around unified target zone
var borderThickness = 8;
var targetZoneWidth = 350 * unifiedTargetZone.scale.x;
var targetZoneHeight = 200;
// Top border
var topBorder = LK.getAsset('stripLine', {
anchorX: 0.5,
anchorY: 0.5
});
topBorder.width = targetZoneWidth - borderThickness;
topBorder.height = borderThickness;
topBorder.x = unifiedTargetZone.x;
topBorder.y = unifiedTargetZone.y - targetZoneHeight / 2 - borderThickness / 2;
topBorder.alpha = 1.0;
game.addChild(topBorder);
// Bottom border
var bottomBorder = LK.getAsset('stripLine', {
anchorX: 0.5,
anchorY: 0.5
});
bottomBorder.width = targetZoneWidth - borderThickness;
bottomBorder.height = borderThickness;
bottomBorder.x = unifiedTargetZone.x;
bottomBorder.y = unifiedTargetZone.y + targetZoneHeight / 2 + borderThickness / 2;
bottomBorder.alpha = 1.0;
game.addChild(bottomBorder);
// Left border
var leftBorder = LK.getAsset('stripLine', {
anchorX: 0.5,
anchorY: 0.5
});
leftBorder.width = borderThickness;
leftBorder.height = targetZoneHeight - borderThickness;
leftBorder.x = unifiedTargetZone.x - targetZoneWidth / 2 - borderThickness / 2;
leftBorder.y = unifiedTargetZone.y;
leftBorder.alpha = 1.0;
game.addChild(leftBorder);
// Right border
var rightBorder = LK.getAsset('stripLine', {
anchorX: 0.5,
anchorY: 0.5
});
rightBorder.width = borderThickness;
rightBorder.height = targetZoneHeight - borderThickness;
rightBorder.x = unifiedTargetZone.x + targetZoneWidth / 2 + borderThickness / 2;
rightBorder.y = unifiedTargetZone.y;
rightBorder.alpha = 1.0;
game.addChild(rightBorder);
// Add rounded corners with ellipses
// Top-left corner
var topLeftCorner = LK.getAsset('cornerEllipse', {
anchorX: 0.5,
anchorY: 0.5
});
topLeftCorner.x = unifiedTargetZone.x - targetZoneWidth / 2;
topLeftCorner.y = unifiedTargetZone.y - targetZoneHeight / 2;
topLeftCorner.alpha = 1.0;
game.addChild(topLeftCorner);
// Top-right corner
var topRightCorner = LK.getAsset('cornerEllipse', {
anchorX: 0.5,
anchorY: 0.5
});
topRightCorner.x = unifiedTargetZone.x + targetZoneWidth / 2;
topRightCorner.y = unifiedTargetZone.y - targetZoneHeight / 2;
topRightCorner.alpha = 1.0;
game.addChild(topRightCorner);
// Bottom-left corner
var bottomLeftCorner = LK.getAsset('cornerEllipse', {
anchorX: 0.5,
anchorY: 0.5
});
bottomLeftCorner.x = unifiedTargetZone.x - targetZoneWidth / 2;
bottomLeftCorner.y = unifiedTargetZone.y + targetZoneHeight / 2;
bottomLeftCorner.alpha = 1.0;
game.addChild(bottomLeftCorner);
// Bottom-right corner
var bottomRightCorner = LK.getAsset('cornerEllipse', {
anchorX: 0.5,
anchorY: 0.5
});
bottomRightCorner.x = unifiedTargetZone.x + targetZoneWidth / 2;
bottomRightCorner.y = unifiedTargetZone.y + targetZoneHeight / 2;
bottomRightCorner.alpha = 1.0;
game.addChild(bottomRightCorner);
// Helper functions
function spawnNote() {
var trackIndex = Math.floor(Math.random() * numTracks);
var isPowerNote = Math.random() < 0.1;
var note = new Note(trackIndex, isPowerNote);
note.x = startX + trackIndex * trackWidth;
note.y = -50;
note.speed = 8 * gameSpeed;
notes.push(note);
game.addChild(note);
}
function updateScore(points) {
score += points * Math.max(1, Math.floor(combo / 5));
scoreTxt.setText('Score: ' + score);
LK.setScore(score);
}
function updateCombo(increase) {
if (increase) {
combo++;
maxCombo = Math.max(maxCombo, combo);
} else {
combo = 0;
}
comboTxt.setText('Combo: ' + combo);
}
function updateMissed() {
missedNotes++;
missedTxt.setText('Missed: ' + missedNotes + '/' + maxMissedNotes);
// Player is now immortal - no game over on missed notes
}
function showPerfectEffect(x, y) {
var effect = LK.getAsset('perfectEffect', {
anchorX: 0.5,
anchorY: 0.5
});
effect.x = x;
effect.y = y;
effect.alpha = 0.8;
game.addChild(effect);
tween(effect, {
alpha: 0,
scaleX: 2,
scaleY: 2
}, {
duration: 300,
onFinish: function onFinish() {
effect.destroy();
}
});
}
function checkNoteInTrack(trackIndex) {
for (var i = 0; i < notes.length; i++) {
var note = notes[i];
if (note.trackIndex === trackIndex && !note.hasBeenTapped) {
var timing = note.checkTiming();
if (timing !== 'miss') {
note.hasBeenTapped = true;
var points = 0;
if (timing === 'perfect') {
points = note.isPowerNote ? 200 : 100;
LK.getSound('perfect').play();
showPerfectEffect(note.x, note.y);
} else if (timing === 'good') {
points = note.isPowerNote ? 100 : 50;
LK.getSound('tap').play();
}
updateScore(points);
updateCombo(true);
unifiedTargetZone.flash();
// Add shake effect to strip line
var stripLine = game.children.find(function (child) {
return child.x === startX + trackIndex * trackWidth && child.width === 8;
});
if (stripLine) {
var originalX = stripLine.x;
tween(stripLine, {
x: originalX + 50
}, {
duration: 25,
onFinish: function onFinish() {
tween(stripLine, {
x: originalX - 50
}, {
duration: 25,
onFinish: function onFinish() {
tween(stripLine, {
x: originalX + 35
}, {
duration: 25,
onFinish: function onFinish() {
tween(stripLine, {
x: originalX - 35
}, {
duration: 25,
onFinish: function onFinish() {
tween(stripLine, {
x: originalX + 20
}, {
duration: 20,
onFinish: function onFinish() {
tween(stripLine, {
x: originalX - 20
}, {
duration: 20,
onFinish: function onFinish() {
tween(stripLine, {
x: originalX + 10
}, {
duration: 15,
onFinish: function onFinish() {
tween(stripLine, {
x: originalX
}, {
duration: 15
});
}
});
}
});
}
});
}
});
}
});
}
});
}
});
}
note.destroy();
notes.splice(i, 1);
return true;
}
}
}
return false;
}
// Touch handlers
game.down = function (x, y, obj) {
for (var i = 0; i < numTracks; i++) {
var trackX = startX + i * trackWidth;
if (x >= trackX - trackWidth / 2 && x <= trackX + trackWidth / 2) {
if (!checkNoteInTrack(i)) {
updateCombo(false);
LK.getSound('miss').play();
}
break;
}
}
};
// Main game loop
game.update = function () {
// Spawn notes
noteSpawnTimer++;
if (noteSpawnTimer >= noteSpawnInterval) {
spawnNote();
noteSpawnTimer = 0;
}
// Update difficulty
difficultyTimer++;
if (difficultyTimer >= 1800) {
// Every 30 seconds
gameSpeed += 0.2;
noteSpawnInterval = Math.max(20, noteSpawnInterval - 2);
difficultyTimer = 0;
}
// Update notes
for (var i = notes.length - 1; i >= 0; i--) {
var note = notes[i];
// Check if note missed target zone
if (!note.hasBeenTapped && note.lastY <= 1700 && note.y > 1700) {
updateCombo(false);
updateMissed();
note.destroy();
notes.splice(i, 1);
continue;
}
// Remove notes that are off screen
if (note.y > 2800) {
note.destroy();
notes.splice(i, 1);
}
}
// Win condition
if (score >= 10000) {
LK.showYouWin();
}
};
// Add 3 objects at bottom of target zone (left, center, right)
var targetBottomY = unifiedTargetZone.y + targetZoneHeight / 2 + 600; // Position even further down
var objectSpacing = targetZoneWidth / 2.5; // Increase spacing between objects
// Left object
var leftObject = LK.getAsset('cornerEllipse', {
anchorX: 0.5,
anchorY: 0.5
});
leftObject.x = unifiedTargetZone.x - objectSpacing;
leftObject.y = targetBottomY;
leftObject.tint = 0xff6b6b; // Red color for distinction
leftObject.alpha = 0.8;
game.addChild(leftObject);
// Center object
var centerObject = LK.getAsset('cornerEllipse', {
anchorX: 0.5,
anchorY: 0.5
});
centerObject.x = unifiedTargetZone.x;
centerObject.y = targetBottomY;
centerObject.tint = 0x00ff00; // Green color for distinction
centerObject.alpha = 0.8;
game.addChild(centerObject);
// Right object
var rightObject = LK.getAsset('cornerEllipse', {
anchorX: 0.5,
anchorY: 0.5
});
rightObject.x = unifiedTargetZone.x + objectSpacing;
rightObject.y = targetBottomY;
rightObject.tint = 0x4169e1; // Blue color for distinction
rightObject.alpha = 0.8;
game.addChild(rightObject);
// Scale all 3 objects to 30x using tween
tween(leftObject, {
scaleX: 30,
scaleY: 30
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
// Move to topmost layer after scaling
game.removeChild(leftObject);
game.addChild(leftObject);
}
});
tween(centerObject, {
scaleX: 30,
scaleY: 30
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
// Move to topmost layer after scaling
game.removeChild(centerObject);
game.addChild(centerObject);
}
});
tween(rightObject, {
scaleX: 30,
scaleY: 30
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
// Move to topmost layer after scaling
game.removeChild(rightObject);
game.addChild(rightObject);
}
});
// Start background music
LK.playMusic('bgmusic');
;
Gitar gövde kısmı
Do müzik notası
Mavi pastel renkli daire. In-Game asset. 2d. High contrast. No shadows
Kalp. In-Game asset. 2d. High contrast. No shadows
Gitar aksesuarı turuncu pastel renk. In-Game asset. 2d. High contrast. No shadows
Kırmızı pastel renk gitar çalma aksesuarı. In-Game asset. 2d. High contrast. No shadows