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.activate = function () {
self.removeChild(graphics);
graphics = self.attachAsset('longTileActive', {
anchorX: 0.5,
anchorY: 0.5
});
};
self.update = function () {
if (!self.holding) {
self.y += self.speed;
}
var tileBottom = self.y + 120;
var tileTop = self.y - 120;
// 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) {
self.missed = true;
missedTiles++;
comboCount = 0;
LK.getSound('miss').play();
if (missedTiles >= maxMisses) {
LK.showGameOver();
}
}
// Check if holding is complete
if (self.holding && self.y >= self.holdStartY + 240) {
self.completed = true;
self.holding = false;
LK.setScore(LK.getScore() + 20);
comboCount++;
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.update = function () {
self.y += self.speed;
// Check if tile is past hit line and not hit
if (self.y > hitLineY + 60 && !self.hit && !self.missed) {
self.missed = true;
missedTiles++;
comboCount = 0;
LK.getSound('miss').play();
if (missedTiles >= maxMisses) {
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 missedTiles = 0;
var maxMisses = 5;
var tileSpawnTimer = 0;
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);
var missText = new Text2('Misses: 0/5', {
size: 50,
fill: 0xFF0000
});
missText.anchor.set(1, 0);
LK.gui.topRight.addChild(missText);
function updateScoreDisplay() {
scoreText.setText('Score: ' + LK.getScore());
comboText.setText('Combo: ' + comboCount);
missText.setText('Misses: ' + missedTiles + '/' + maxMisses);
}
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);
// Check for quick tile hits
for (var i = 0; i < tiles.length; i++) {
var tile = tiles[i];
if (tile instanceof QuickTile && tile.lane === laneIndex && !tile.hit && !tile.missed) {
var distance = Math.abs(tile.y - hitLineY);
if (distance <= 60) {
tile.hit = true;
LK.setScore(LK.getScore() + 10);
comboCount++;
LK.getSound('tap').play();
// Visual effect
tween(tile, {
alpha: 0,
scaleX: 1.5,
scaleY: 1.5
}, {
duration: 200,
onFinish: function onFinish() {
tile.destroy();
}
});
updateScoreDisplay();
break;
}
}
}
};
game.up = function (x, y, obj) {
var laneIndex = getLaneFromX(x);
deactivateLane(laneIndex);
// 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;
missedTiles++;
comboCount = 0;
LK.getSound('miss').play();
if (missedTiles >= maxMisses) {
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) {
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
@@ -1,6 +1,275 @@
-/****
+/****
+* 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.activate = function () {
+ self.removeChild(graphics);
+ graphics = self.attachAsset('longTileActive', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ };
+ self.update = function () {
+ if (!self.holding) {
+ self.y += self.speed;
+ }
+ var tileBottom = self.y + 120;
+ var tileTop = self.y - 120;
+ // 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) {
+ self.missed = true;
+ missedTiles++;
+ comboCount = 0;
+ LK.getSound('miss').play();
+ if (missedTiles >= maxMisses) {
+ LK.showGameOver();
+ }
+ }
+ // Check if holding is complete
+ if (self.holding && self.y >= self.holdStartY + 240) {
+ self.completed = true;
+ self.holding = false;
+ LK.setScore(LK.getScore() + 20);
+ comboCount++;
+ 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.update = function () {
+ self.y += self.speed;
+ // Check if tile is past hit line and not hit
+ if (self.y > hitLineY + 60 && !self.hit && !self.missed) {
+ self.missed = true;
+ missedTiles++;
+ comboCount = 0;
+ LK.getSound('miss').play();
+ if (missedTiles >= maxMisses) {
+ LK.showGameOver();
+ }
+ }
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x1a1a1a
+});
+
+/****
+* Game Code
+****/
+var lanes = [];
+var hitLineY = 2200;
+var tiles = [];
+var activeLanes = [false, false, false, false];
+var comboCount = 0;
+var missedTiles = 0;
+var maxMisses = 5;
+var tileSpawnTimer = 0;
+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);
+var missText = new Text2('Misses: 0/5', {
+ size: 50,
+ fill: 0xFF0000
+});
+missText.anchor.set(1, 0);
+LK.gui.topRight.addChild(missText);
+function updateScoreDisplay() {
+ scoreText.setText('Score: ' + LK.getScore());
+ comboText.setText('Combo: ' + comboCount);
+ missText.setText('Misses: ' + missedTiles + '/' + maxMisses);
+}
+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);
+ // Check for quick tile hits
+ for (var i = 0; i < tiles.length; i++) {
+ var tile = tiles[i];
+ if (tile instanceof QuickTile && tile.lane === laneIndex && !tile.hit && !tile.missed) {
+ var distance = Math.abs(tile.y - hitLineY);
+ if (distance <= 60) {
+ tile.hit = true;
+ LK.setScore(LK.getScore() + 10);
+ comboCount++;
+ LK.getSound('tap').play();
+ // Visual effect
+ tween(tile, {
+ alpha: 0,
+ scaleX: 1.5,
+ scaleY: 1.5
+ }, {
+ duration: 200,
+ onFinish: function onFinish() {
+ tile.destroy();
+ }
+ });
+ updateScoreDisplay();
+ break;
+ }
+ }
+ }
+};
+game.up = function (x, y, obj) {
+ var laneIndex = getLaneFromX(x);
+ deactivateLane(laneIndex);
+ // 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;
+ missedTiles++;
+ comboCount = 0;
+ LK.getSound('miss').play();
+ if (missedTiles >= maxMisses) {
+ 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) {
+ 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;
+ }
+};
\ No newline at end of file
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