User prompt
Parçalar biraz daha büyük olsun.
User prompt
300 puana ulaştığımızda oyunu kazanmış olalım.
User prompt
Parçaların hepsi aynı hızda gelsin.
User prompt
Generate the first version of the source code of my game: Meme Müzik
Code edit (1 edits merged)
Please save this source code
User prompt
Müzik Parçaları Yağmuru
Initial prompt
Yeni müzik oyunu istiyorum. Yukarıdan gelen parçalar olsun. O parçalara tıkladığımda on puan kazanayım, sigor tablosu üstte olsun. Her on puan kazandığımda onlar olarak artsınlar.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ // Müzik parçası (düşen kutu) sınıfı var MusicNote = Container.expand(function () { var self = Container.call(this); // Asseti ekle ve ortala var note = self.attachAsset('musicNote', { anchorX: 0.5, anchorY: 0.5 }); // Hız (her not için rastgele belirlenebilir) self.speed = 8 + Math.random() * 6; // Tıklanıp tıklanmadığını takip et self.collected = false; // Her frame çağrılır self.update = function () { self.y += self.speed; }; // Tıklama/dokunma olayı self.down = function (x, y, obj) { if (self.collected) return; self.collected = true; // Skoru artır LK.setScore(LK.getScore() + 10); scoreTxt.setText(LK.getScore()); // Kısa bir animasyonla kaybolsun tween(self, { alpha: 0, scaleX: 1.5, scaleY: 1.5 }, { duration: 200, easing: tween.easeOut, onFinish: function onFinish() { self.destroy(); // Diziden silinecek, ana döngüde } }); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x181818 }); /**** * Game Code ****/ // Animasyonlar için tween eklentisi // Müzik parçası için renkli bir kutu şeklinde asset // Skor metni var scoreTxt = new Text2('0', { size: 120, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); // Skor üstte ortada, menüyle çakışmasın diye biraz aşağıda LK.gui.top.addChild(scoreTxt); scoreTxt.y = 40; // Düşen notaların tutulduğu dizi var notes = []; // Yeni nota oluşturma fonksiyonu function spawnNote() { var note = new MusicNote(); // Rastgele x (ekranın kenarına taşmasın) var margin = 120; note.x = margin + Math.random() * (2048 - 2 * margin); note.y = -100; note.scaleX = 1; note.scaleY = 1; note.alpha = 1; note.collected = false; notes.push(note); game.addChild(note); } // Notaların rastgele aralıklarla gelmesi için zamanlayıcı var minInterval = 500; var maxInterval = 1200; var noteTimer = null; function scheduleNextNote() { var interval = minInterval + Math.random() * (maxInterval - minInterval); noteTimer = LK.setTimeout(function () { spawnNote(); scheduleNextNote(); }, interval); } scheduleNextNote(); // Oyun güncelleme döngüsü game.update = function () { for (var i = notes.length - 1; i >= 0; i--) { var note = notes[i]; // Not güncelle note.update(); // Ekranın dışına çıktıysa sil if (note.y - note.height / 2 > 2732 + 50 || note.collected) { note.destroy(); notes.splice(i, 1); } } }; // Oyun sıfırlanırken zamanlayıcıyı temizle game.destroy = function () { if (noteTimer) LK.clearTimeout(noteTimer); }; // Oyun başladığında ilk skor sıfırlansın LK.setScore(0); scoreTxt.setText('0'); // Oyun alanında başka bir şey yok, sadece notalar ve skor var.
===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,118 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+// Müzik parçası (düşen kutu) sınıfı
+var MusicNote = Container.expand(function () {
+ var self = Container.call(this);
+ // Asseti ekle ve ortala
+ var note = self.attachAsset('musicNote', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ // Hız (her not için rastgele belirlenebilir)
+ self.speed = 8 + Math.random() * 6;
+ // Tıklanıp tıklanmadığını takip et
+ self.collected = false;
+ // Her frame çağrılır
+ self.update = function () {
+ self.y += self.speed;
+ };
+ // Tıklama/dokunma olayı
+ self.down = function (x, y, obj) {
+ if (self.collected) return;
+ self.collected = true;
+ // Skoru artır
+ LK.setScore(LK.getScore() + 10);
+ scoreTxt.setText(LK.getScore());
+ // Kısa bir animasyonla kaybolsun
+ tween(self, {
+ alpha: 0,
+ scaleX: 1.5,
+ scaleY: 1.5
+ }, {
+ duration: 200,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ self.destroy();
+ // Diziden silinecek, ana döngüde
+ }
+ });
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x181818
+});
+
+/****
+* Game Code
+****/
+// Animasyonlar için tween eklentisi
+// Müzik parçası için renkli bir kutu şeklinde asset
+// Skor metni
+var scoreTxt = new Text2('0', {
+ size: 120,
+ fill: 0xFFFFFF
+});
+scoreTxt.anchor.set(0.5, 0);
+// Skor üstte ortada, menüyle çakışmasın diye biraz aşağıda
+LK.gui.top.addChild(scoreTxt);
+scoreTxt.y = 40;
+// Düşen notaların tutulduğu dizi
+var notes = [];
+// Yeni nota oluşturma fonksiyonu
+function spawnNote() {
+ var note = new MusicNote();
+ // Rastgele x (ekranın kenarına taşmasın)
+ var margin = 120;
+ note.x = margin + Math.random() * (2048 - 2 * margin);
+ note.y = -100;
+ note.scaleX = 1;
+ note.scaleY = 1;
+ note.alpha = 1;
+ note.collected = false;
+ notes.push(note);
+ game.addChild(note);
+}
+// Notaların rastgele aralıklarla gelmesi için zamanlayıcı
+var minInterval = 500;
+var maxInterval = 1200;
+var noteTimer = null;
+function scheduleNextNote() {
+ var interval = minInterval + Math.random() * (maxInterval - minInterval);
+ noteTimer = LK.setTimeout(function () {
+ spawnNote();
+ scheduleNextNote();
+ }, interval);
+}
+scheduleNextNote();
+// Oyun güncelleme döngüsü
+game.update = function () {
+ for (var i = notes.length - 1; i >= 0; i--) {
+ var note = notes[i];
+ // Not güncelle
+ note.update();
+ // Ekranın dışına çıktıysa sil
+ if (note.y - note.height / 2 > 2732 + 50 || note.collected) {
+ note.destroy();
+ notes.splice(i, 1);
+ }
+ }
+};
+// Oyun sıfırlanırken zamanlayıcıyı temizle
+game.destroy = function () {
+ if (noteTimer) LK.clearTimeout(noteTimer);
+};
+// Oyun başladığında ilk skor sıfırlansın
+LK.setScore(0);
+scoreTxt.setText('0');
+// Oyun alanında başka bir şey yok, sadece notalar ve skor var.
\ No newline at end of file
Arkaplanı kaldır
arkaplan temizle
arkaplan temizle
meme silah uzatan kedi. In-Game asset. 2d. High contrast. No shadows
regular show modecaı. In-Game asset. 2d. High contrast. No shadows
kaka yüzü. In-Game asset. 2d. High contrast. No shadows
kalp. In-Game asset. 2d. High contrast. No shadows
meme chill guy face. In-Game asset. 2d. High contrast. No shadows
minecraft chiken jokey. In-Game asset. 2d. High contrast. No shadows
halay çeken insan. In-Game asset. 2d. High contrast. No shadows