User prompt
Bütün tuşların "sadece" yüksekliğini arttır
User prompt
Bu tuşları 4e çıkart. Normal tuşlar olcak ama 4 tane olucak. Bende hepsini farklı tasarlayabilicem
User prompt
Oyunu biraz daha hizlandir. Ve ilerledikçe daha da hizlansin. (Erkenden olmasın bu yavaş yavaş ama kararlı bı sekilde hizlansin) ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Uzun notalari kaldır
User prompt
Uzun notaların colliderini düzelt. Basmama rağmen "early" hatası veriyor
User prompt
Bir notaya erken bastığımız zaman o nota yok olsun. Tekrar basmamiza gerek kalmasın. Uzun notalarda da aynı şekilde. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Uzun basmamız gereken notayı çizgiye degdikten sonra başlat tetiğini. Ve bundan sonra her early için eksi puan yiyelim. Not al notalari biraz daha uzat. Ve sıralar arasına görünür bı çizgi çek ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Early ve missed yazısı ekranın tam ortasında büyük olsun. Uzun basmamız gereken notaya bı kere basmamız yeterli olsun. Uzun basmak sadece ekstra puan versin. Zamanında basabildigimiz her tuş icin de "Nice" yazısı yazsın ekranın ortasında diğerlerinin büyüklüğünde. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Tuşlara bastigimi belirgin et. Çizgiye gelmeden bastiklarima "early" uyarısı, çizgiden sonra bastiklarima "Missed" uyarısı yazsın. Ve kaçırma sayım olmasın. Tek hakkım olsun. Tuşları büyüt. Tek tiklamali olan Normal olsun uzun basmanız gerek de biraz daha uzun olsun. Tuşa basma animasyonu da ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Piano Tiles Rush
Initial prompt
Bana piano tiles gibi bi oyun yap. 4 sıra olsun. Tuşlar olsun. Basılı tutmalı tuşlar olsun. Her bir tuşun animasyonu olsun.
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var LongTile = Container.expand(function () {
var self = Container.call(this);
var graphics = self.attachAsset('longTile', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 8;
self.lane = 0;
self.startHit = false;
self.holding = false;
self.completed = false;
self.missed = false;
self.holdStartY = 0;
self.earlyPressed = false;
self.activate = function () {
self.removeChild(graphics);
graphics = self.attachAsset('longTileActive', {
anchorX: 0.5,
anchorY: 0.5
});
// Add press animation
tween(graphics, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 100,
easing: tween.easeOut
});
};
self.update = function () {
if (!self.holding) {
self.y += self.speed;
}
var tileBottom = self.y + 180;
var tileTop = self.y - 180;
// Check if tile passed without being pressed
if (tileTop > hitLineY + 80 && !self.startHit && !self.missed) {
self.missed = true;
showFeedback('MISSED', self.lane);
LK.getSound('miss').play();
LK.showGameOver();
}
// Check if holding is complete (for bonus points)
if (self.holding && self.y >= self.holdStartY + 480) {
self.completed = true;
self.holding = false;
LK.setScore(LK.getScore() + 10); // Bonus points for holding
updateScoreDisplay();
}
};
return self;
});
var QuickTile = Container.expand(function () {
var self = Container.call(this);
var graphics = self.attachAsset('quickTile', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 8;
self.lane = 0;
self.hit = false;
self.missed = false;
self.earlyPressed = false;
self.update = function () {
self.y += self.speed;
// Check if tile is past hit line and not hit
if (self.y > hitLineY + 80 && !self.hit && !self.missed) {
self.missed = true;
showFeedback('MISSED', self.lane);
LK.getSound('miss').play();
LK.showGameOver();
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x1a1a1a
});
/****
* Game Code
****/
var lanes = [];
var hitLineY = 2200;
var tiles = [];
var activeLanes = [false, false, false, false];
var comboCount = 0;
var tileSpawnTimer = 0;
var feedbackTexts = [];
var tileSpawnInterval = 60;
var gameSpeed = 1;
// Create lanes
for (var i = 0; i < 4; i++) {
var lane = game.addChild(LK.getAsset('lane', {
anchorX: 0.5,
anchorY: 0.5
}));
lane.x = 256 + i * 512;
lane.y = 1366;
lanes.push(lane);
}
// Create hit line
var hitLine = game.addChild(LK.getAsset('hitLine', {
anchorX: 0.5,
anchorY: 0.5
}));
hitLine.x = 1024;
hitLine.y = hitLineY;
// Create UI
var scoreText = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreText.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreText);
var comboText = new Text2('Combo: 0', {
size: 60,
fill: 0xFFFF00
});
comboText.anchor.set(0.5, 0);
comboText.y = 100;
LK.gui.top.addChild(comboText);
function updateScoreDisplay() {
scoreText.setText('Score: ' + LK.getScore());
comboText.setText('Combo: ' + comboCount);
}
function showFeedback(text, laneIndex) {
var feedbackText = new Text2(text, {
size: 120,
fill: text === 'EARLY' ? 0xFFFF00 : text === 'MISSED' ? 0xFF0000 : 0x00FF00
});
feedbackText.anchor.set(0.5, 0.5);
feedbackText.x = 1024; // Center of screen
feedbackText.y = 1366; // Center of screen vertically
feedbackText.alpha = 1;
game.addChild(feedbackText);
feedbackTexts.push(feedbackText);
tween(feedbackText, {
alpha: 0,
y: feedbackText.y - 100
}, {
duration: 1000,
onFinish: function onFinish() {
feedbackText.destroy();
var index = feedbackTexts.indexOf(feedbackText);
if (index > -1) feedbackTexts.splice(index, 1);
}
});
}
function spawnTile() {
var laneIndex = Math.floor(Math.random() * 4);
var tileType = Math.random() < 0.7 ? 'quick' : 'long';
var tile;
if (tileType === 'quick') {
tile = new QuickTile();
} else {
tile = new LongTile();
}
tile.lane = laneIndex;
tile.x = 256 + laneIndex * 512;
tile.y = -100;
tiles.push(tile);
game.addChild(tile);
}
function getLaneFromX(x) {
if (x < 512) return 0;
if (x < 1024) return 1;
if (x < 1536) return 2;
return 3;
}
function activateLane(laneIndex) {
if (laneIndex >= 0 && laneIndex < 4) {
activeLanes[laneIndex] = true;
lanes[laneIndex].removeChild(lanes[laneIndex].children[0]);
var activeLane = LK.getAsset('laneActive', {
anchorX: 0.5,
anchorY: 0.5
});
lanes[laneIndex].addChild(activeLane);
}
}
function deactivateLane(laneIndex) {
if (laneIndex >= 0 && laneIndex < 4) {
activeLanes[laneIndex] = false;
lanes[laneIndex].removeChild(lanes[laneIndex].children[0]);
var normalLane = LK.getAsset('lane', {
anchorX: 0.5,
anchorY: 0.5
});
lanes[laneIndex].addChild(normalLane);
}
}
game.down = function (x, y, obj) {
var laneIndex = getLaneFromX(x);
activateLane(laneIndex);
// Add lane press animation
tween(lanes[laneIndex], {
scaleX: 1.05,
scaleY: 1.05
}, {
duration: 100,
easing: tween.easeOut
});
// Check for quick tile hits
var hitTile = false;
for (var i = 0; i < tiles.length; i++) {
var tile = tiles[i];
if (tile instanceof QuickTile && tile.lane === laneIndex && !tile.hit && !tile.missed && !tile.earlyPressed) {
var distance = Math.abs(tile.y - hitLineY);
if (distance <= 80) {
tile.hit = true;
LK.setScore(LK.getScore() + 10);
comboCount++;
showFeedback('NICE', laneIndex);
LK.getSound('tap').play();
// Visual effect
tween(tile, {
alpha: 0,
scaleX: 1.5,
scaleY: 1.5
}, {
duration: 200,
onFinish: function onFinish() {
tile.destroy();
}
});
updateScoreDisplay();
hitTile = true;
break;
} else if (tile.y < hitLineY - 80) {
// Early press
tile.earlyPressed = true;
showFeedback('EARLY', laneIndex);
LK.getSound('early').play();
hitTile = true;
break;
}
}
}
// Check for long tiles - single press activation
if (!hitTile) {
for (var i = 0; i < tiles.length; i++) {
var tile = tiles[i];
if (tile instanceof LongTile && tile.lane === laneIndex && !tile.startHit && !tile.missed && !tile.earlyPressed) {
var tileBottom = tile.y + 180;
var tileTop = tile.y - 180;
if (tileBottom >= hitLineY - 80 && tileTop <= hitLineY + 80) {
// Perfect hit - single press is enough
tile.startHit = true;
tile.completed = true;
LK.setScore(LK.getScore() + 15);
comboCount++;
showFeedback('NICE', laneIndex);
tile.activate();
LK.getSound('tap').play();
// Allow holding for bonus points
tile.holding = true;
tile.holdStartY = tile.y;
updateScoreDisplay();
hitTile = true;
break;
} else if (tile.y < hitLineY - 80 && tileBottom > hitLineY - 200) {
tile.earlyPressed = true;
showFeedback('EARLY', laneIndex);
LK.getSound('early').play();
break;
}
}
}
}
};
game.up = function (x, y, obj) {
var laneIndex = getLaneFromX(x);
deactivateLane(laneIndex);
// Add lane release animation
tween(lanes[laneIndex], {
scaleX: 1,
scaleY: 1
}, {
duration: 100,
easing: tween.easeOut
});
// Stop holding long tiles
for (var i = 0; i < tiles.length; i++) {
var tile = tiles[i];
if (tile instanceof LongTile && tile.lane === laneIndex && tile.holding) {
tile.holding = false;
// If not completed, it's a miss
if (!tile.completed) {
tile.missed = true;
showFeedback('MISSED', laneIndex);
LK.getSound('miss').play();
LK.showGameOver();
updateScoreDisplay();
}
}
}
};
game.update = function () {
// Spawn tiles
tileSpawnTimer++;
if (tileSpawnTimer >= tileSpawnInterval) {
spawnTile();
tileSpawnTimer = 0;
// Increase difficulty over time
if (LK.ticks % 600 === 0) {
gameSpeed += 0.1;
tileSpawnInterval = Math.max(30, tileSpawnInterval - 2);
}
}
// Clean up tiles
for (var i = tiles.length - 1; i >= 0; i--) {
var tile = tiles[i];
if (tile.y > 2800 || tile.hit || tile.completed || tile.missed && tile.y > hitLineY + 200 || tile.earlyPressed && tile.y > 2800) {
if (!tile.destroyed) {
tile.destroy();
tiles.splice(i, 1);
}
}
}
// Update tile speeds based on game speed
for (var i = 0; i < tiles.length; i++) {
tiles[i].speed = 8 * gameSpeed;
}
}; ===================================================================
--- original.js
+++ change.js
@@ -40,31 +40,20 @@
self.y += self.speed;
}
var tileBottom = self.y + 180;
var tileTop = self.y - 180;
- // Check if we can start holding
- if (tileBottom >= hitLineY - 30 && tileTop <= hitLineY + 30 && !self.startHit && !self.missed) {
- if (activeLanes[self.lane]) {
- self.startHit = true;
- self.holding = true;
- self.holdStartY = self.y;
- self.activate();
- LK.getSound('hold').play();
- }
- }
- // Check if tile passed without being held
- if (tileTop > hitLineY + 60 && !self.startHit && !self.missed) {
+ // Check if tile passed without being pressed
+ if (tileTop > hitLineY + 80 && !self.startHit && !self.missed) {
self.missed = true;
showFeedback('MISSED', self.lane);
LK.getSound('miss').play();
LK.showGameOver();
}
- // Check if holding is complete
+ // Check if holding is complete (for bonus points)
if (self.holding && self.y >= self.holdStartY + 480) {
self.completed = true;
self.holding = false;
- LK.setScore(LK.getScore() + 20);
- comboCount++;
+ LK.setScore(LK.getScore() + 10); // Bonus points for holding
updateScoreDisplay();
}
};
return self;
@@ -148,14 +137,14 @@
comboText.setText('Combo: ' + comboCount);
}
function showFeedback(text, laneIndex) {
var feedbackText = new Text2(text, {
- size: 60,
- fill: text === 'EARLY' ? 0xFFFF00 : 0xFF0000
+ size: 120,
+ fill: text === 'EARLY' ? 0xFFFF00 : text === 'MISSED' ? 0xFF0000 : 0x00FF00
});
feedbackText.anchor.set(0.5, 0.5);
- feedbackText.x = 256 + laneIndex * 512;
- feedbackText.y = hitLineY - 100;
+ feedbackText.x = 1024; // Center of screen
+ feedbackText.y = 1366; // Center of screen vertically
feedbackText.alpha = 1;
game.addChild(feedbackText);
feedbackTexts.push(feedbackText);
tween(feedbackText, {
@@ -233,8 +222,9 @@
if (distance <= 80) {
tile.hit = true;
LK.setScore(LK.getScore() + 10);
comboCount++;
+ showFeedback('NICE', laneIndex);
LK.getSound('tap').play();
// Visual effect
tween(tile, {
alpha: 0,
@@ -258,15 +248,31 @@
break;
}
}
}
- // Check for long tiles - early press detection
+ // Check for long tiles - single press activation
if (!hitTile) {
for (var i = 0; i < tiles.length; i++) {
var tile = tiles[i];
if (tile instanceof LongTile && tile.lane === laneIndex && !tile.startHit && !tile.missed && !tile.earlyPressed) {
var tileBottom = tile.y + 180;
- if (tile.y < hitLineY - 80 && tileBottom > hitLineY - 200) {
+ var tileTop = tile.y - 180;
+ if (tileBottom >= hitLineY - 80 && tileTop <= hitLineY + 80) {
+ // Perfect hit - single press is enough
+ tile.startHit = true;
+ tile.completed = true;
+ LK.setScore(LK.getScore() + 15);
+ comboCount++;
+ showFeedback('NICE', laneIndex);
+ tile.activate();
+ LK.getSound('tap').play();
+ // Allow holding for bonus points
+ tile.holding = true;
+ tile.holdStartY = tile.y;
+ updateScoreDisplay();
+ hitTile = true;
+ break;
+ } else if (tile.y < hitLineY - 80 && tileBottom > hitLineY - 200) {
tile.earlyPressed = true;
showFeedback('EARLY', laneIndex);
LK.getSound('early').play();
break;
A line. In-Game asset. 2d. High contrast. No shadows
A "single" tile of musical note 🎵. In-Game asset. 2d. High contrast. No shadows
A single tile of musical note 🎵 blue. In-Game asset. 2d. High contrast. No shadows
A single tile of musical note green. In-Game asset. 2d. High contrast. No shadows
A single musical tile red. In-Game asset. 2d. High contrast. No shadows
An UI written "NICE". In-Game asset. 2d. High contrast. No shadows
An UI written "Missed". In-Game asset. 2d. High contrast. No shadows
An UI written "Early". In-Game asset. 2d. High contrast. No shadows
A score display written +10 on it. In-Game asset. 2d. High contrast. No shadows
A score Ui that written -30 on it. In-Game asset. 2d. High contrast. No shadows
An image of "Perfect" Written on it. In-Game asset. 2d. High contrast. No shadows