User prompt
Move level select screen column further up towards the top by 20 cm
User prompt
Move level select screen column further up towards the top by 5 cm
User prompt
Move level select screen column further up the top
User prompt
Move level select screen column further MORE towards the left
User prompt
still not fixed pls move more towards the left corner
User prompt
lütfen artık düzeltir misin hala daha olmadı, referans alman için ekranın orta altında tom butonu duruyor onun 500 pixel kadar yukarısında hizalı olması lazım
User prompt
not fixed again are you kidding me, it still stays in right down corner
User prompt
seviye seçme ekranını hala tam düzeltmedin yazıları ekranın yukarı orta kısma yerleştir
User prompt
seviye seçme kısmını da düzelt
User prompt
Fix intro and level select screen text/button alignment and positioning, tam ortada alt alta hizalı bir şekilde olsunlar
User prompt
yazılar kaymış ve saçma yerlerde duruyor onu düzelt, giriş ve level ekranındaki yazılardan bahsediyorum
User prompt
seviye seçme ekranından önce oyuna girince bizi karşılayan "Play" yazan tuşu olan bir giriş ekranı olsun ve buna tıkladıktan sonra level seçme ekranı gelsin
User prompt
seviye seçme ekranından önce oyuna girince bizi karşılayan "Play" yazan tuşu olan bir giriş ekranı olsun ve buna tıklayınca level seçme ekranı gelsin
User prompt
giriş ekranını geçmek için ekrana basılması lazım ve ingilizce olarak: başlamak için dokunun yazan bir yazı ekle
User prompt
level menüsünden öncesine oyun açıldığında bizi karşılayan bir giriş ekranı ve onun assetlerini ekle
User prompt
health bar uı için görsel asset ekle
User prompt
can barını yeşil yap
User prompt
şuan olan can barının assetleri gözükmüyor
User prompt
can barının assetlerini ekle
User prompt
can barının assetini ekle
User prompt
can biterse oynanılan level dursun ve "Failed" yazısı çıkarak kaybedilsin ve menüye geri dönsün ama oyun komple bitmesin sadece failed yazısı çıkıp level seçilen menüye geri atsın
User prompt
oyun komple bitmesin sadece failed yazısı çıkıp level seçilen menüye geri atsın
User prompt
can biterse level dursun ve "Failed" yazısı çıkarak kaybedilsin ve menüye geri dönsün
User prompt
her kaçırılan vuruşta 2 can gitsin
User prompt
her kaçırılan vuruşta 5 can gitsin
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ // DrumPad: Interactive drum pad at the bottom var DrumPad = Container.expand(function () { var self = Container.call(this); // .padType: 'kick', 'snare', etc. (set after creation) self.padType = null; self.asset = null; // .isPressed: for visual feedback self.isPressed = false; // Set up asset self.setPadType = function (type) { self.padType = type; var assetId = type + 'Pad'; if (self.asset) { self.removeChild(self.asset); } var size = PAD_SIZES[type]; self.asset = self.attachAsset(assetId, { anchorX: 0.5, anchorY: 0.5, width: size ? size.w : undefined, height: size ? size.h : undefined }); }; // Visual feedback on press self.flash = function () { if (!self.asset) { return; } tween(self.asset, { alpha: 0.5 }, { duration: 60, onFinish: function onFinish() { tween(self.asset, { alpha: 1 }, { duration: 120 }); } }); }; return self; }); // Note: Falling note bar var Note = Container.expand(function () { var self = Container.call(this); // .noteType: 'kick', 'snare', etc. self.noteType = null; self.asset = null; self.hit = false; // If already hit self.setNoteType = function (type) { self.noteType = type; var assetId = type + 'Note'; if (self.asset) { self.removeChild(self.asset); } self.asset = self.attachAsset(assetId, { anchorX: 0.5, anchorY: 0.5 }); }; // Called every tick self.update = function () { self.y += noteSpeed; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x181818 }); /**** * Game Code ****/ // --- Game constants --- // Drum pads (kick, snare, hi-hat, tom1, tom2, crash1, crash2) // Note bars (falling notes) // Sounds for each drum // Music track // Drum pad sounds var PAD_TYPES = ['kick', 'snare', 'hihat', 'tom1', 'crash1']; var PAD_COLS = PAD_TYPES.length; var GAME_W = 2048, GAME_H = 2732; var PAD_Y = GAME_H - 320; // Y position for pads // --- Pad Sizing and Full-Width Layout --- // Each pad will be as wide as possible, with no side gaps, and all pads will be adjacent. var PAD_SIZES = {}; var PAD_X_POSITIONS = {}; var padWidth = GAME_W / PAD_COLS; var padCenterY = PAD_Y; for (var i = 0; i < PAD_COLS; i++) { var type = PAD_TYPES[i]; // Pad width: fill the column, pad height: keep previous aspect ratio (or max of previous) // We'll use the original aspect ratio for each pad type, but scale width to padWidth // Use original aspect ratios from previous PAD_SIZES var origSizes = { 'kick': { w: 420, h: 210 }, 'snare': { w: 340, h: 170 }, 'hihat': { w: 300, h: 150 }, 'tom1': { w: 320, h: 160 }, 'crash1': { w: 340, h: 170 } }; var aspect = origSizes[type].h / origSizes[type].w; var w = padWidth; var h = w * aspect; PAD_SIZES[type] = { w: w, h: h }; // Center of each pad: left edge + half width + i*padWidth PAD_X_POSITIONS[type] = i * padWidth + padWidth / 2; } // Swap hihat and tom1 X positions var tmpX = PAD_X_POSITIONS['hihat']; PAD_X_POSITIONS['hihat'] = PAD_X_POSITIONS['tom1']; PAD_X_POSITIONS['tom1'] = tmpX; // Note spawn area (top) var NOTE_START_Y = -60; var NOTE_TARGET_Y = PAD_Y - 80; // Where notes should be hit // Note speed (pixels per frame) var noteSpeed = 18; // Timing window (pixels): how close to NOTE_TARGET_Y is a "hit" var HIT_WINDOW = 100; // --- State --- // NOTE_OFFSET_TICKS: Delay (in ticks) to align first note with music start (positive = notes spawn later) var NOTE_OFFSET_TICKS = 0; // Default 0, adjust for perfect sync (e.g. try 20, 30, 40, ...) var pads = []; var notes = []; var score = 0; var combo = 0; var maxCombo = 0; var lastTick = 0; var noteIndex = 0; var isPlaying = false; var songStartTick = 0; // --- Health Bar State --- var health = 150; var maxHealth = 150; var healthBarContainer = null; var healthBarBg = null; var healthBarFg = null; // --- UI --- var scoreTxt = new Text2('0', { size: 120, fill: "#fff" }); 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; // --- Song Data for all levels --- // Each entry: {tick: <when to spawn>, type: <padType>} // Level 1: MasterofUpit, original notes var LEVELS = [{ name: "Level 1", music: "MasterofUpit", notes: [{ tick: 1, type: 'kick' }, { tick: 1, type: 'crash1' }, { tick: 62, type: 'crash1' }, { tick: 63, type: 'kick' }, { tick: 78, type: 'crash1' }, { tick: 78, type: 'kick' }, { tick: 93, type: 'crash1' }, { tick: 93, type: 'kick' }, { tick: 193, type: 'crash1' }, { tick: 193, type: 'kick' }, { tick: 266, type: 'hihat' }, { tick: 283, type: 'hihat' }, { tick: 299, type: 'hihat' }, { tick: 316, type: 'hihat' }, { tick: 334, type: 'hihat' }, { tick: 351, type: 'hihat' }, { tick: 368, type: 'hihat' }, { tick: 386, type: 'hihat' }, { tick: 403, type: 'hihat' }, { tick: 420, type: 'hihat' }, { tick: 438, type: 'hihat' }, { tick: 451, type: 'kick' }, { tick: 452, type: 'crash1' }, { tick: 470, type: 'crash1' }, { tick: 471, type: 'kick' }, { tick: 490, type: 'hihat' }, { tick: 505, type: 'hihat' }, { tick: 522, type: 'hihat' }, { tick: 538, type: 'kick' }, { tick: 539, type: 'crash1' }, { tick: 556, type: 'crash1' }, { tick: 558, type: 'kick' }, { tick: 572, type: 'crash1' }, { tick: 572, type: 'kick' }, { tick: 590, type: 'hihat' }, { tick: 607, type: 'hihat' }, { tick: 625, type: 'hihat' }, { tick: 640, type: 'hihat' }, { tick: 658, type: 'hihat' }, { tick: 676, type: 'hihat' }, { tick: 694, type: 'hihat' }, { tick: 710, type: 'hihat' }, { tick: 725, type: 'crash1' }, { tick: 727, type: 'kick' }, { tick: 742, type: 'kick' }, { tick: 742, type: 'crash1' }, { tick: 758, type: 'hihat' }, { tick: 776, type: 'hihat' }, { tick: 795, type: 'hihat' }, { tick: 812, type: 'crash1' }, { tick: 812, type: 'kick' }, { tick: 829, type: 'crash1' }, { tick: 829, type: 'kick' }, { tick: 847, type: 'crash1' }, { tick: 847, type: 'kick' }, { tick: 863, type: 'hihat' }, { tick: 881, type: 'hihat' }, { tick: 899, type: 'hihat' }, { tick: 916, type: 'hihat' }, { tick: 933, type: 'hihat' }, { tick: 951, type: 'hihat' }, { tick: 969, type: 'hihat' }, { tick: 986, type: 'hihat' }, { tick: 1003, type: 'kick' }, { tick: 1003, type: 'crash1' }, { tick: 1020, type: 'crash1' }, { tick: 1021, type: 'kick' }, { tick: 1036, type: 'hihat' }, { tick: 1054, type: 'hihat' }, { tick: 1070, type: 'hihat' }, { tick: 1087, type: 'crash1' }, { tick: 1087, type: 'kick' }, { tick: 1104, type: 'crash1' }, { tick: 1105, type: 'kick' }, { tick: 1122, type: 'crash1' }, { tick: 1122, type: 'kick' }, { tick: 1155, type: 'snare' }, { tick: 1166, type: 'snare' }, { tick: 1173, type: 'snare' }, { tick: 1183, type: 'snare' }, { tick: 1189, type: 'snare' }, { tick: 1198, type: 'snare' }, { tick: 1206, type: 'snare' }, { tick: 1215, type: 'snare' }, { tick: 1223, type: 'snare' }, { tick: 1231, type: 'snare' }, { tick: 1239, type: 'snare' }, { tick: 1249, type: 'snare' }, { tick: 1257, type: 'snare' }, { tick: 1267, type: 'snare' }, { tick: 1275, type: 'snare' }, { tick: 1293, type: 'kick' }, { tick: 1293, type: 'crash1' }, { tick: 1500, type: 'crash1' }, { tick: 1500, type: 'kick' }, { tick: 1527, type: 'crash1' }, { tick: 1528, type: 'kick' }, { tick: 1549, type: 'crash1' }, { tick: 1549, type: 'kick' }, { tick: 1566, type: 'crash1' }, { tick: 1566, type: 'kick' }, { tick: 1775, type: 'crash1' }, { tick: 1776, type: 'kick' }, { tick: 1802, type: 'kick' }, { tick: 1802, type: 'crash1' }, { tick: 1825, type: 'crash1' }, { tick: 1826, type: 'kick' }, { tick: 1842, type: 'crash1' }, { tick: 1842, type: 'kick' }, { tick: 1856, type: 'hihat' }, { tick: 1860, type: 'snare' }, { tick: 1876, type: 'hihat' }, { tick: 1884, type: 'kick' }, { tick: 1892, type: 'hihat' }, { tick: 1892, type: 'snare' }, { tick: 1910, type: 'hihat' }, { tick: 1911, type: 'kick' }, { tick: 1927, type: 'snare' }, { tick: 1928, type: 'hihat' }, { tick: 1946, type: 'hihat' }, { tick: 1954, type: 'kick' }, { tick: 1961, type: 'hihat' }, { tick: 1963, type: 'snare' }, { tick: 1980, type: 'hihat' }, { tick: 1981, type: 'kick' }, { tick: 1996, type: 'snare' }, { tick: 1996, type: 'hihat' }, { tick: 2014, type: 'hihat' }, { tick: 2021, type: 'kick' }, { tick: 2028, type: 'hihat' }, { tick: 2031, type: 'snare' }, { tick: 2048, type: 'hihat' }, { tick: 2049, type: 'kick' }, { tick: 2066, type: 'hihat' }, { tick: 2066, type: 'snare' }, { tick: 2086, type: 'hihat' }, { tick: 2096, type: 'kick' }, { tick: 2102, type: 'crash1' }, { tick: 2105, type: 'kick' }, { tick: 2119, type: 'kick' }, { tick: 2119, type: 'crash1' }, { tick: 2165, type: 'hihat' }, { tick: 2168, type: 'snare' }, { tick: 2185, type: 'hihat' }, { tick: 2187, type: 'kick' }, { tick: 2202, type: 'snare' }, { tick: 2202, type: 'hihat' }, { tick: 2219, type: 'hihat' }, { tick: 2229, type: 'kick' }, { tick: 2235, type: 'hihat' }, { tick: 2237, type: 'snare' }, { tick: 2245, type: 'snare' }, { tick: 2252, type: 'snare' }, { tick: 2257, type: 'crash1' }, { tick: 2261, type: 'kick' }, { tick: 2273, type: 'snare' }, { tick: 2273, type: 'hihat' }, { tick: 2290, type: 'hihat' }, { tick: 2305, type: 'hihat' }, { tick: 2308, type: 'snare' }, { tick: 2324, type: 'crash1' }, { tick: 2325, type: 'kick' }, { tick: 2350, type: 'kick' }, { tick: 2350, type: 'crash1' }, { tick: 2376, type: 'crash1' }, { tick: 2376, type: 'kick' }, { tick: 2392, type: 'crash1' }, { tick: 2392, type: 'kick' }, { tick: 2407, type: 'hihat' }, { tick: 2409, type: 'snare' }, { tick: 2427, type: 'hihat' }, { tick: 2436, type: 'kick' }, { tick: 2442, type: 'hihat' }, { tick: 2444, type: 'snare' }, { tick: 2460, type: 'hihat' }, { tick: 2462, type: 'kick' }, { tick: 2479, type: 'hihat' }, { tick: 2479, type: 'snare' }, { tick: 2496, type: 'hihat' }, { tick: 2506, type: 'kick' }, { tick: 2511, type: 'hihat' }, { tick: 2515, type: 'snare' }, { tick: 2530, type: 'hihat' }, { tick: 2532, type: 'kick' }, { tick: 2546, type: 'hihat' }, { tick: 2546, type: 'snare' }, { tick: 2564, type: 'hihat' }, { tick: 2573, type: 'kick' }, { tick: 2581, type: 'hihat' }, { tick: 2584, type: 'snare' }, { tick: 2599, type: 'hihat' }, { tick: 2600, type: 'kick' }, { tick: 2615, type: 'snare' }, { tick: 2615, type: 'hihat' }, { tick: 2635, type: 'hihat' }, { tick: 2641, type: 'kick' }, { tick: 2651, type: 'snare' }, { tick: 2654, type: 'crash1' }, { tick: 2669, type: 'kick' }, { tick: 2671, type: 'hihat' }, { tick: 2686, type: 'snare' }, { tick: 2686, type: 'hihat' }, { tick: 2704, type: 'hihat' }, { tick: 2713, type: 'kick' }, { tick: 2719, type: 'hihat' }, { tick: 2724, type: 'kick' }, { tick: 2739, type: 'hihat' }, { tick: 2750, type: 'snare' }, { tick: 2759, type: 'snare' }, { tick: 2769, type: 'snare' }, { tick: 2773, type: 'snare' }, { tick: 2781, type: 'snare' }, { tick: 2792, type: 'tom1' }, { tick: 2808, type: 'crash1' }, { tick: 2809, type: 'kick' }, { tick: 2822, type: 'hihat' }, { tick: 2823, type: 'snare' }, { tick: 2840, type: 'hihat' }, { tick: 2848, type: 'kick' }, { tick: 2855, type: 'hihat' }, { tick: 2856, type: 'snare' }, { tick: 2873, type: 'crash1' }, { tick: 2873, type: 'kick' }, { tick: 2899, type: 'kick' }, { tick: 2899, type: 'crash1' }, { tick: 2921, type: 'crash1' }, { tick: 2924, type: 'kick' }, { tick: 2939, type: 'crash1' }, { tick: 2939, type: 'kick' }, { tick: 2964, type: 'crash1' }, { tick: 2965, type: 'kick' }, { tick: 2988, type: 'crash1' }, { tick: 2988, type: 'kick' }, { tick: 3006, type: 'crash1' }, { tick: 3006, type: 'kick' }, { tick: 3024, type: 'hihat' }, { tick: 3044, type: 'hihat' }, { tick: 3060, type: 'hihat' }, { tick: 3079, type: 'hihat' }, { tick: 3097, type: 'hihat' }, { tick: 3114, type: 'hihat' }, { tick: 3132, type: 'hihat' }, { tick: 3149, type: 'crash1' }, { tick: 3149, type: 'kick' }, { tick: 3165, type: 'hihat' }, { tick: 3165, type: 'snare' }, { tick: 3183, type: 'hihat' }, { tick: 3192, type: 'kick' }, { tick: 3198, type: 'hihat' }, { tick: 3200, type: 'snare' }, { tick: 3217, type: 'hihat' }, { tick: 3231, type: 'kick' }, { tick: 3235, type: 'hihat' }, { tick: 3239, type: 'snare' }, { tick: 3254, type: 'hihat' }, { tick: 3254, type: 'kick' }, { tick: 3269, type: 'hihat' }, { tick: 3269, type: 'snare' }, { tick: 3285, type: 'hihat' }, { tick: 3288, type: 'kick' }, { tick: 3303, type: 'hihat' }, { tick: 3304, type: 'snare' }, { tick: 3321, type: 'hihat' }, { tick: 3329, type: 'kick' }, { tick: 3336, type: 'hihat' }, { tick: 3337, type: 'snare' }, { tick: 3354, type: 'hihat' }, { tick: 3361, type: 'snare' }, { tick: 3362, type: 'crash1' }, { tick: 3381, type: 'crash1' }, { tick: 3381, type: 'kick' }, { tick: 3399, type: 'hihat' }, { tick: 3399, type: 'kick' }, { tick: 3415, type: 'hihat' }, { tick: 3416, type: 'snare' }, { tick: 3434, type: 'hihat' }, { tick: 3443, type: 'kick' }, { tick: 3449, type: 'hihat' }, { tick: 3452, type: 'snare' }, { tick: 3469, type: 'hihat' }, { tick: 3478, type: 'snare' }, { tick: 3485, type: 'snare' }, { tick: 3501, type: 'tom1' }, { tick: 3519, type: 'tom1' }, { tick: 3537, type: 'kick' }, { tick: 3539, type: 'crash1' }, { tick: 3553, type: 'snare' }, { tick: 3554, type: 'hihat' }, { tick: 3570, type: 'hihat' }, { tick: 3578, type: 'kick' }, { tick: 3585, type: 'hihat' }, { tick: 3587, type: 'snare' }, { tick: 3603, type: 'hihat' }, { tick: 3612, type: 'crash1' }, { tick: 3613, type: 'kick' }, { tick: 3630, type: 'crash1' }, { tick: 3630, type: 'kick' }, { tick: 3647, type: 'hihat' }, { tick: 3663, type: 'hihat' }, { tick: 3664, type: 'snare' }, { tick: 3681, type: 'hihat' }, { tick: 3690, type: 'kick' }, { tick: 3697, type: 'hihat' }, { tick: 3699, type: 'snare' }, { tick: 3721, type: 'snare' }, { tick: 3729, type: 'snare' }, { tick: 3748, type: 'snare' }, { tick: 3756, type: 'snare' }, { tick: 3765, type: 'tom1' }, { tick: 3772, type: 'tom1' }, { tick: 3782, type: 'crash1' }, { tick: 3782, type: 'kick' }, { tick: 3798, type: 'snare' }, { tick: 3798, type: 'hihat' }, { tick: 3815, type: 'hihat' }, { tick: 3826, type: 'kick' }, { tick: 3831, type: 'hihat' }, { tick: 3834, type: 'snare' }, { tick: 3850, type: 'crash1' }, { tick: 3859, type: 'crash1' }, { tick: 3859, type: 'kick' }, { tick: 3878, type: 'crash1' }, { tick: 3878, type: 'kick' }, { tick: 3896, type: 'kick' }, { tick: 3896, type: 'hihat' }, { tick: 3912, type: 'hihat' }, { tick: 3913, type: 'snare' }, { tick: 3930, type: 'hihat' }, { tick: 3942, type: 'kick' }, { tick: 3947, type: 'hihat' }, { tick: 3950, type: 'snare' }, { tick: 3964, type: 'hihat' }, { tick: 3973, type: 'snare' }, { tick: 3981, type: 'snare' }, { tick: 3998, type: 'snare' }, { tick: 4006, type: 'snare' }, { tick: 4012, type: 'snare' }, { tick: 4020, type: 'tom1' }, { tick: 4027, type: 'tom1' }, { tick: 4035, type: 'kick' }, { tick: 4036, type: 'crash1' }, { tick: 4051, type: 'snare' }, { tick: 4052, type: 'hihat' }, { tick: 4068, type: 'hihat' }, { tick: 4078, type: 'kick' }, { tick: 4083, type: 'hihat' }, { tick: 4086, type: 'snare' }, { tick: 4101, type: 'hihat' }, { tick: 4106, type: 'kick' }, { tick: 4112, type: 'kick' }, { tick: 4112, type: 'crash1' }, { tick: 4128, type: 'crash1' }, { tick: 4128, type: 'kick' }, { tick: 4145, type: 'hihat' }, { tick: 4163, type: 'hihat' }, { tick: 4163, type: 'snare' }, { tick: 4180, type: 'hihat' }, { tick: 4190, type: 'kick' }, { tick: 4196, type: 'hihat' }, { tick: 4200, type: 'snare' }, { tick: 4224, type: 'snare' }, { tick: 4233, type: 'snare' }, { tick: 4249, type: 'snare' }, { tick: 4258, type: 'snare' }, { tick: 4265, type: 'tom1' }, { tick: 4273, type: 'tom1' }, { tick: 4282, type: 'crash1' }, { tick: 4283, type: 'kick' }, { tick: 4299, type: 'hihat' }, { tick: 4300, type: 'snare' }, { tick: 4317, type: 'hihat' }, { tick: 4329, type: 'kick' }, { tick: 4333, type: 'hihat' }, { tick: 4336, type: 'snare' }, { tick: 4351, type: 'hihat' }, { tick: 4361, type: 'crash1' }, { tick: 4361, type: 'kick' }, { tick: 4378, type: 'crash1' }, { tick: 4379, type: 'kick' }, { tick: 4394, type: 'crash1' }, { tick: 4396, type: 'kick' }, { tick: 4411, type: 'hihat' }, { tick: 4412, type: 'snare' }, { tick: 4429, type: 'hihat' }, { tick: 4439, type: 'kick' }, { tick: 4445, type: 'hihat' }, { tick: 4449, type: 'snare' }, { tick: 4464, type: 'hihat' }, { tick: 4474, type: 'snare' }, { tick: 4481, type: 'snare' }, { tick: 4497, type: 'snare' }, { tick: 4506, type: 'snare' }, { tick: 4519, type: 'tom1' }, { tick: 4531, type: 'kick' }, { tick: 4531, type: 'crash1' }, { tick: 4548, type: 'snare' }, { tick: 4548, type: 'hihat' }, { tick: 4565, type: 'hihat' }, { tick: 4574, type: 'kick' }, { tick: 4580, type: 'hihat' }, { tick: 4583, type: 'snare' }, { tick: 4599, type: 'hihat' }, { tick: 4602, type: 'kick' }, { tick: 4609, type: 'crash1' }, { tick: 4610, type: 'kick' }, { tick: 4627, type: 'crash1' }, { tick: 4627, type: 'kick' }, { tick: 4642, type: 'hihat' }, { tick: 4660, type: 'hihat' }, { tick: 4661, type: 'snare' }, { tick: 4678, type: 'hihat' }, { tick: 4688, type: 'snare' }, { tick: 4694, type: 'hihat' }, { tick: 4699, type: 'snare' }, { tick: 4725, type: 'snare' }, { tick: 4732, type: 'snare' }, { tick: 4748, type: 'snare' }, { tick: 4756, type: 'snare' }, { tick: 4763, type: 'tom1' }, { tick: 4772, type: 'kick' }, { tick: 4779, type: 'kick' }, { tick: 4780, type: 'crash1' }, { tick: 4797, type: 'snare' }, { tick: 4797, type: 'hihat' }, { tick: 4814, type: 'hihat' }, { tick: 4823, type: 'kick' }, { tick: 4830, type: 'hihat' }, { tick: 4832, type: 'snare' }, { tick: 4849, type: 'crash1' }, { tick: 4850, type: 'kick' }, { tick: 4856, type: 'crash1' }, { tick: 4857, type: 'kick' }, { tick: 4874, type: 'kick' }, { tick: 4875, type: 'crash1' }, { tick: 4891, type: 'hihat' }, { tick: 4907, type: 'hihat' }, { tick: 4907, type: 'snare' }, { tick: 4924, type: 'hihat' }, { tick: 4932, type: 'kick' }, { tick: 4940, type: 'hihat' }, { tick: 4942, type: 'snare' }, { tick: 4958, type: 'hihat' }, { tick: 4968, type: 'snare' }, { tick: 4975, type: 'snare' }, { tick: 4993, type: 'snare' }, { tick: 5000, type: 'snare' }, { tick: 5007, type: 'tom1' }, { tick: 5015, type: 'tom1' }, { tick: 5026, type: 'kick' }, { tick: 5029, type: 'crash1' }, { tick: 5046, type: 'hihat' }, { tick: 5046, type: 'snare' }, { tick: 5063, type: 'hihat' }, { tick: 5074, type: 'kick' }, { tick: 5079, type: 'hihat' }, { tick: 5083, type: 'snare' }, { tick: 5096, type: 'hihat' }, { tick: 5105, type: 'kick' }, { tick: 5106, type: 'crash1' }, { tick: 5124, type: 'crash1' }, { tick: 5125, type: 'kick' }, { tick: 5140, type: 'kick' }, { tick: 5150, type: 'snare' }, { tick: 5159, type: 'snare' }, { tick: 5168, type: 'snare' }, { tick: 5177, type: 'snare' }, { tick: 5182, type: 'snare' }, { tick: 5190, type: 'snare' }, { tick: 5198, type: 'snare' }, { tick: 5210, type: 'crash1' }, { tick: 5210, type: 'kick' }, { tick: 5245, type: 'hihat' }, { tick: 5246, type: 'snare' }, { tick: 5262, type: 'snare' }, { tick: 5262, type: 'hihat' }, { tick: 5278, type: 'crash1' }, { tick: 5312, type: 'hihat' }, { tick: 5313, type: 'snare' }, { tick: 5330, type: 'snare' }, { tick: 5330, type: 'hihat' }, { tick: 5347, type: 'hihat' }, { tick: 5348, type: 'kick' }, { tick: 5367, type: 'kick' }, { tick: 5368, type: 'hihat' }, { tick: 5381, type: 'hihat' }, { tick: 5383, type: 'snare' }, { tick: 5400, type: 'hihat' }, { tick: 5400, type: 'snare' }, { tick: 5416, type: 'snare' }, { tick: 5424, type: 'snare' }, { tick: 5431, type: 'snare' }, { tick: 5440, type: 'snare' }, { tick: 5447, type: 'tom1' }, { tick: 5456, type: 'tom1' }, { tick: 5463, type: 'snare' }, { tick: 5471, type: 'snare' }, { tick: 5482, type: 'kick' }, { tick: 5483, type: 'crash1' }, { tick: 5516, type: 'hihat' }, { tick: 5519, type: 'snare' }, { tick: 5534, type: 'hihat' }, { tick: 5535, type: 'snare' }, { tick: 5551, type: 'crash1' }, { tick: 5554, type: 'kick' }, { tick: 5569, type: 'kick' }, { tick: 5582, type: 'kick' }, { tick: 5584, type: 'hihat' }, { tick: 5601, type: 'snare' }, { tick: 5602, type: 'hihat' }, { tick: 5617, type: 'crash1' }, { tick: 5619, type: 'kick' }, { tick: 5637, type: 'kick' }, { tick: 5647, type: 'kick' }, { tick: 5653, type: 'hihat' }, { tick: 5655, type: 'snare' }, { tick: 5671, type: 'snare' }, { tick: 5687, type: 'snare' }, { tick: 5696, type: 'snare' }, { tick: 5703, type: 'snare' }, { tick: 5713, type: 'snare' }, { tick: 5721, type: 'tom1' }, { tick: 5729, type: 'tom1' }, { tick: 5739, type: 'snare' }, { tick: 5747, type: 'snare' }, { tick: 5757, type: 'crash1' }, { tick: 5758, type: 'kick' }, { tick: 5777, type: 'kick' }, { tick: 5786, type: 'kick' }, { tick: 5793, type: 'hihat' }, { tick: 5794, type: 'snare' }, { tick: 5809, type: 'snare' }, { tick: 5825, type: 'hihat' }, { tick: 5827, type: 'kick' }, { tick: 5842, type: 'kick' }, { tick: 5851, type: 'kick' }, { tick: 5859, type: 'hihat' }, { tick: 5861, type: 'snare' }, { tick: 5877, type: 'snare' }, { tick: 5895, type: 'hihat' }, { tick: 5896, type: 'kick' }, { tick: 5913, type: 'kick' }, { tick: 5914, type: 'hihat' }, { tick: 5931, type: 'snare' }, { tick: 5934, type: 'hihat' }, { tick: 5947, type: 'snare' }, { tick: 5964, type: 'snare' }, { tick: 5981, type: 'snare' }, { tick: 5998, type: 'tom1' }, { tick: 6008, type: 'snare' }, { tick: 6017, type: 'snare' }, { tick: 6025, type: 'snare' }, { tick: 6034, type: 'crash1' }, { tick: 6035, type: 'kick' }, { tick: 6054, type: 'kick' }, { tick: 6063, type: 'kick' }, { tick: 6067, type: 'hihat' }, { tick: 6072, type: 'snare' }, { tick: 6086, type: 'hihat' }, { tick: 6086, type: 'snare' }, { tick: 6103, type: 'hihat' }, { tick: 6103, type: 'kick' }, { tick: 6121, type: 'kick' }, { tick: 6133, type: 'hihat' }, { tick: 6134, type: 'snare' }, { tick: 6151, type: 'hihat' }, { tick: 6151, type: 'snare' }, { tick: 6168, type: 'hihat' }, { tick: 6169, type: 'kick' }, { tick: 6184, type: 'kick' }, { tick: 6193, type: 'kick' }, { tick: 6201, type: 'hihat' }, { tick: 6202, type: 'snare' }, { tick: 6220, type: 'snare' }, { tick: 6220, type: 'hihat' }, { tick: 6237, type: 'snare' }, { tick: 6243, type: 'snare' }, { tick: 6248, type: 'snare' }, { tick: 6254, type: 'snare' }, { tick: 6273, type: 'tom1' }, { tick: 6290, type: 'tom1' }, { tick: 6310, type: 'kick' }, { tick: 6310, type: 'crash1' }, { tick: 6324, type: 'kick' }, { tick: 6324, type: 'crash1' }, { tick: 6374, type: 'crash1' }, { tick: 6374, type: 'kick' }, { tick: 6390, type: 'kick' }, { tick: 6390, type: 'crash1' }] }, { name: "Level 2", music: "MasterofUpit", notes: [ // Example: simple pattern for demo, replace with real notes for level 2 { tick: 0, type: 'kick' }, { tick: 30, type: 'snare' }, { tick: 60, type: 'hihat' }, { tick: 90, type: 'crash1' }, { tick: 120, type: 'tom1' }, { tick: 150, type: 'kick' }, { tick: 180, type: 'snare' }, { tick: 210, type: 'hihat' }] }, { name: "Level 3", music: "MasterofUpit", notes: [ // Example: simple pattern for demo, replace with real notes for level 3 { tick: 0, type: 'hihat' }, { tick: 20, type: 'kick' }, { tick: 40, type: 'snare' }, { tick: 60, type: 'tom1' }, { tick: 80, type: 'crash1' }, { tick: 100, type: 'kick' }, { tick: 120, type: 'snare' }, { tick: 140, type: 'hihat' }] }]; // Current level index and songNotes reference var currentLevelIndex = 0; var songNotes = LEVELS[0].notes; var currentMusic = LEVELS[0].music; // --- Level Selection UI --- var levelSelectContainer = new Container(); levelSelectContainer.x = 0; levelSelectContainer.y = 0; levelSelectContainer.visible = true; LK.gui.center.addChild(levelSelectContainer); var levelSelectTitle = new Text2("Seviye Seç", { size: 120, fill: "#fff" }); levelSelectTitle.anchor.set(0.5, 0); levelSelectTitle.x = LK.gui.center.width / 2; levelSelectTitle.y = 100; levelSelectContainer.addChild(levelSelectTitle); var levelButtons = []; for (var i = 0; i < LEVELS.length; i++) { (function (idx) { var btn = new Text2(LEVELS[idx].name, { size: 100, fill: 0xFFE066 }); btn.anchor.set(0.5, 0.5); btn.x = LK.gui.center.width / 2; btn.y = 350 + idx * 220; btn.interactive = true; btn.buttonMode = true; btn.down = function () { selectLevel(idx); }; levelSelectContainer.addChild(btn); levelButtons.push(btn); })(i); } // --- Recording UI and Logic --- var recordTxt = new Text2('KAYIT: KAPALI', { size: 70, fill: 0xFF6666 }); recordTxt.anchor.set(0.5, 0); LK.gui.top.addChild(recordTxt); recordTxt.x = LK.gui.top.width / 2; recordTxt.y = 220; // Hide gameplay UI until level is selected scoreTxt.visible = false; comboTxt.visible = false; recordTxt.visible = false; // Level selection handler function selectLevel(idx) { currentLevelIndex = idx; songNotes = LEVELS[idx].notes; currentMusic = LEVELS[idx].music; levelSelectContainer.visible = false; scoreTxt.visible = true; comboTxt.visible = true; recordTxt.visible = true; if (typeof TEST_MODE !== "undefined" && TEST_MODE) { // Update songTotalTicks for timeline songTotalTicks = songNotes.length > 0 ? songNotes[songNotes.length - 1].tick : 1; } startGame(); // Start the game after selecting a level } var isRecording = false; var recordedNotes = []; var recordStartTick = 0; // Toggle recording on tap of recordTxt recordTxt.interactive = true; recordTxt.buttonMode = true; recordTxt.down = function () { if (!isRecording) { // Start recording isRecording = true; recordedNotes = []; recordStartTick = LK.ticks; recordTxt.setText('KAYIT: AÇIK'); comboTxt.setText('KAYIT MODU'); } else { // Stop recording and save as new level isRecording = false; recordTxt.setText('KAYIT: KAPALI'); comboTxt.setText(''); // Convert recordedNotes to songNotes format if (recordedNotes.length > 0) { // Normalize ticks to start at 0 var minTick = recordedNotes.length > 0 ? recordedNotes[0].tick : 0; for (var i = 0; i < recordedNotes.length; i++) { recordedNotes[i].tick -= minTick; } songNotes = []; for (var i = 0; i < recordedNotes.length; i++) { songNotes.push({ tick: recordedNotes[i].tick, type: recordedNotes[i].type }); } // Print recorded notes as code in the console var codeStr = "var songNotes = [\n"; for (var i = 0; i < recordedNotes.length; i++) { codeStr += " { tick: " + recordedNotes[i].tick + ", type: '" + recordedNotes[i].type + "' },\n"; } codeStr += "];"; console.log(codeStr); // Restart game with new level startGame(); } } }; LK.gui.top.addChild(recordTxt); // --- Record pad hits if in recording mode --- function recordPadHit(padType) { if (isRecording) { var tick = LK.ticks - recordStartTick; recordedNotes.push({ tick: tick, type: padType }); } } // --- Create Drum Pads --- for (var i = 0; i < PAD_COLS; i++) { var pad = new DrumPad(); pad.setPadType(PAD_TYPES[i]); pad.x = PAD_X_POSITIONS[PAD_TYPES[i]]; pad.y = PAD_Y; pad.padIndex = i; pads.push(pad); game.addChild(pad); } // --- Pad Touch Handling --- var activePad = null; function getPadAt(x, y) { for (var i = 0; i < pads.length; i++) { var pad = pads[i]; var dx = x - pad.x, dy = y - pad.y; var rx = pad.asset.width / 2, ry = pad.asset.height / 2; if (dx * dx / (rx * rx) + dy * dy / (ry * ry) <= 1) { return pad; } } return null; } game.down = function (x, y, obj) { var pad = getPadAt(x, y); if (pad) { activePad = pad; handlePadHit(pad); } }; game.move = function (x, y, obj) { // For multi-touch, could be extended }; game.up = function (x, y, obj) { activePad = null; }; // --- Note Spawning --- function spawnNote(type) { var note = new Note(); note.setNoteType(type); note.x = PAD_X_POSITIONS[type]; note.y = NOTE_START_Y; note.noteType = type; note.hit = false; notes.push(note); game.addChild(note); } // --- Pad Hit Logic --- function handlePadHit(pad) { // Play sound var soundId = pad.padType + 'Sound'; var sound = LK.getSound(soundId); if (sound) { if (sound.stop) { sound.stop(); } // Stop if already playing to avoid overlap/delay sound.play(); } // Record pad hit if in recording mode recordPadHit(pad.padType); // Visual feedback pad.flash(); // Allow even earlier and later hits by expanding the hit windows further var HIT_WINDOW_EARLY = HIT_WINDOW * 2.2; // allow 120% earlier var HIT_WINDOW_LATE = HIT_WINDOW * 1.7; // allow 70% later // Find closest note of this type in expanded hit window var bestNote = null, bestDist = HIT_WINDOW_LATE; for (var i = 0; i < notes.length; i++) { var note = notes[i]; if (note.hit) { continue; } if (note.noteType !== pad.padType) { continue; } var dist = Math.abs(note.y - NOTE_TARGET_Y); // Accept if note is within early or late window if (note.y >= NOTE_TARGET_Y - HIT_WINDOW_EARLY && note.y <= NOTE_TARGET_Y + HIT_WINDOW_LATE && dist < bestDist) { bestDist = dist; bestNote = note; } } if (bestNote) { // Hit! bestNote.hit = true; LK.effects.flashObject(bestNote, 0xffffff, 120); tween(bestNote, { alpha: 0 }, { duration: 120, onFinish: function onFinish() { bestNote.destroy(); } }); notes.splice(notes.indexOf(bestNote), 1); score += 100; combo += 1; if (combo > maxCombo) { maxCombo = combo; } scoreTxt.setText(score); comboTxt.setText(combo > 1 ? combo + 'x' : ''); // Reset consecutiveMisses on successful hit if (typeof consecutiveMisses !== "undefined") { consecutiveMisses = 0; } // --- HEALTH BAR: Increase health by (1 * combo), clamp to maxHealth --- if (typeof health !== "undefined") { var addHealth = 1 * (combo > 0 ? combo : 1); health += addHealth; if (health > maxHealth) health = maxHealth; // Update health bar UI if (healthBarFg) { healthBarFg.width = health / maxHealth * healthBarBg.width; } } } else { // Miss! LK.effects.flashScreen(0xff0000, 200); // Track consecutive misses for combo reset if (typeof consecutiveMisses === "undefined") { consecutiveMisses = 0; } consecutiveMisses += 1; if (consecutiveMisses >= 2) { combo = 0; comboTxt.setText(''); consecutiveMisses = 0; } // --- HEALTH BAR: Decrease health by 2 (or more if many consecutive misses), clamp to 0 --- if (typeof health !== "undefined") { var missPenalty = 2; if (consecutiveMisses >= 3) { // For every group of 3 consecutive misses, double the penalty missPenalty = 2 * Math.pow(2, Math.floor(consecutiveMisses / 3)); } health -= missPenalty; if (health < 0) health = 0; if (healthBarFg) { healthBarFg.width = health / maxHealth * healthBarBg.width; } } } } // --- Game Update --- game.update = function () { if (!isPlaying) { return; } // If recording, do not spawn notes, do not check for misses, do not end game if (isRecording) { // Allow player to play freely, but do not process notes return; } // --- FAIL CHECK: If health is 0, fail the level and return to menu --- if (typeof health !== "undefined" && health <= 0 && isPlaying) { isPlaying = false; LK.stopMusic(); // Show "Failed" text in the center of the screen var failedTxt = new Text2("FAILED", { size: 220, fill: 0xFF4444 }); failedTxt.anchor.set(0.5, 0.5); failedTxt.x = GAME_W / 2; failedTxt.y = GAME_H / 2; game.addChild(failedTxt); // Hide gameplay UI scoreTxt.visible = false; comboTxt.visible = false; recordTxt.visible = false; if (healthBarContainer && healthBarContainer.parent) { healthBarContainer.parent.removeChild(healthBarContainer); } // After 1.2s, remove failed text and return to level select LK.setTimeout(function () { if (failedTxt && failedTxt.parent) { failedTxt.parent.removeChild(failedTxt); } levelSelectContainer.visible = true; }, 1200); return; } // Spawn notes according to songNotes, with NOTE_OFFSET_TICKS for sync var relTick = LK.ticks - songStartTick; while (noteIndex < songNotes.length && songNotes[noteIndex].tick <= relTick + NOTE_OFFSET_TICKS) { spawnNote(songNotes[noteIndex].type); noteIndex++; } // Update notes, check for misses for (var i = notes.length - 1; i >= 0; i--) { var note = notes[i]; note.update(); if (!note.hit && note.y > NOTE_TARGET_Y + HIT_WINDOW) { // Missed note LK.effects.flashObject(note, 0xff0000, 120); tween(note, { alpha: 0 }, { duration: 120, onFinish: function onFinish() { note.destroy(); } }); notes.splice(i, 1); // Track consecutive misses for combo reset in update loop if (typeof consecutiveMisses === "undefined") { consecutiveMisses = 0; } consecutiveMisses += 1; if (consecutiveMisses >= 2) { combo = 0; comboTxt.setText(''); consecutiveMisses = 0; } // --- HEALTH BAR: Decrease health by 2 (or more if many consecutive misses), clamp to 0 --- if (typeof health !== "undefined") { var missPenalty = 2; if (consecutiveMisses >= 3) { // For every group of 3 consecutive misses, double the penalty missPenalty = 2 * Math.pow(2, Math.floor(consecutiveMisses / 3)); } health -= missPenalty; if (health < 0) health = 0; if (healthBarFg) { healthBarFg.width = health / maxHealth * healthBarBg.width; } } } // Remove notes that go off screen if (note.y > GAME_H + 100) { if (notes.indexOf(note) !== -1) { notes.splice(notes.indexOf(note), 1); } note.destroy(); } } // End of song if (noteIndex >= songNotes.length && notes.length === 0) { isPlaying = false; LK.stopMusic(); // Instead of showing win popup, return to level selection levelSelectContainer.visible = true; scoreTxt.visible = false; comboTxt.visible = false; recordTxt.visible = false; if (healthBarContainer && healthBarContainer.parent) { healthBarContainer.parent.removeChild(healthBarContainer); } } }; // --- Start Game --- function startGame() { score = 0; combo = 0; maxCombo = 0; scoreTxt.setText('0'); comboTxt.setText(''); notes = []; noteIndex = 0; isPlaying = true; songStartTick = LK.ticks; consecutiveMisses = 0; // --- Health Bar Setup --- health = 150; maxHealth = 150; // Remove previous health bar if exists if (healthBarContainer && healthBarContainer.parent) { healthBarContainer.parent.removeChild(healthBarContainer); } healthBarContainer = new Container(); var barW = 900, barH = 60; healthBarBg = LK.getAsset('snarePad', { anchorX: 0.5, anchorY: 0.5, width: barW, height: barH }); healthBarBg.alpha = 0.18; healthBarFg = LK.getAsset('kickPad', { anchorX: 0.5, anchorY: 0.5, width: barW, height: barH }); healthBarFg.alpha = 0.7; healthBarContainer.addChild(healthBarBg); healthBarContainer.addChild(healthBarFg); // Place at bottom center, above pads healthBarContainer.x = GAME_W / 2; healthBarContainer.y = GAME_H - 80; game.addChild(healthBarContainer); // Preload all drum sounds to reduce latency var preloadSounds = ['kickSound', 'snareSound', 'hihatSound', 'tom1Sound', 'crash1Sound']; for (var i = 0; i < preloadSounds.length; i++) { var s = LK.getSound(preloadSounds[i]); if (s && s.play) { // Play at zero volume to warm up, then stop immediately s.volume = 0; s.play(); if (s.stop) { s.stop(); } s.volume = 1; } } // Preload music to reduce latency var preloadMusic = LK.getMusic ? LK.getMusic('MasterofUpit') : null; if (preloadMusic && preloadMusic.play) { preloadMusic.volume = 0; preloadMusic.play(); if (preloadMusic.stop) { preloadMusic.stop(); } preloadMusic.volume = 1; } // Stop any currently playing music to ensure clean start LK.stopMusic(); // Play selected level's music with no fade, no loop, and start at full volume for best sync LK.playMusic(currentMusic, { loop: false, fade: { start: 1, end: 1, duration: 0 } }); } // --- Game Over Handling (missed notes or end of song) --- // Handled by LK.showYouWin() or LK.showGameOver() as needed // --- Responsive UI (center score) --- scoreTxt.x = LK.gui.top.width / 2; comboTxt.x = LK.gui.top.width / 2; // --- TEST MODE: Show timeline and tick counter for sync debugging --- var TEST_MODE = true; // Set to true to enable timeline and tick counter var timelineBar = null; var tickCounterTxt = null; if (TEST_MODE) { // Timeline bar (shows song progress) timelineBar = new Container(); var barBg = LK.getAsset('crash1Pad', { anchorX: 0, anchorY: 0, width: LK.gui.top.width - 200, height: 24 }); barBg.alpha = 0.18; timelineBar.addChild(barBg); var barFg = LK.getAsset('hihatPad', { anchorX: 0, anchorY: 0, width: 0, height: 24 }); barFg.alpha = 0.7; timelineBar.addChild(barFg); timelineBar.x = 100; timelineBar.y = LK.gui.top.height - 60; LK.gui.top.addChild(timelineBar); // Tick counter tickCounterTxt = new Text2('Tick: 0', { size: 48, fill: "#fff" }); tickCounterTxt.anchor.set(0, 0.5); tickCounterTxt.x = 100; tickCounterTxt.y = LK.gui.top.height - 100; LK.gui.top.addChild(tickCounterTxt); // Update timeline and tick counter every frame var lastTimelineUpdateTick = -1; var songTotalTicks = songNotes.length > 0 ? songNotes[songNotes.length - 1].tick : 1; game.update = function (origUpdate) { return function () { if (origUpdate) { origUpdate.apply(this, arguments); } if (isPlaying && TEST_MODE) { // Update songTotalTicks in case level changed songTotalTicks = songNotes.length > 0 ? songNotes[songNotes.length - 1].tick : 1; var relTick = LK.ticks - songStartTick; // Timeline bar var progress = Math.min(1, (relTick + NOTE_OFFSET_TICKS) / songTotalTicks); barFg.width = (LK.gui.top.width - 200) * progress; // Tick counter tickCounterTxt.setText('Tick: ' + relTick); } }; }(game.update); }
===================================================================
--- original.js
+++ change.js
@@ -2277,37 +2277,8 @@
if (health < 0) health = 0;
if (healthBarFg) {
healthBarFg.width = health / maxHealth * healthBarBg.width;
}
- // --- FAIL CHECK: If health reaches zero, stop game, show 'Failed', return to menu ---
- if (health <= 0) {
- isPlaying = false;
- LK.stopMusic();
- LK.effects.flashScreen(0xff0000, 800);
- // Show 'Failed' text and return to level select menu after a short delay
- var failedTxt = new Text2("Failed", {
- size: 200,
- fill: 0xFF4444
- });
- failedTxt.anchor.set(0.5, 0.5);
- failedTxt.x = GAME_W / 2;
- failedTxt.y = GAME_H / 2;
- game.addChild(failedTxt);
- scoreTxt.visible = false;
- comboTxt.visible = false;
- recordTxt.visible = false;
- if (healthBarContainer && healthBarContainer.parent) {
- healthBarContainer.parent.removeChild(healthBarContainer);
- }
- LK.setTimeout(function () {
- if (failedTxt && failedTxt.parent) {
- failedTxt.parent.removeChild(failedTxt);
- }
- levelSelectContainer.visible = true;
- }, 1200);
- // Do not call LK.showGameOver here
- return;
- }
}
}
}
// --- Game Update ---
@@ -2319,8 +2290,37 @@
if (isRecording) {
// Allow player to play freely, but do not process notes
return;
}
+ // --- FAIL CHECK: If health is 0, fail the level and return to menu ---
+ if (typeof health !== "undefined" && health <= 0 && isPlaying) {
+ isPlaying = false;
+ LK.stopMusic();
+ // Show "Failed" text in the center of the screen
+ var failedTxt = new Text2("FAILED", {
+ size: 220,
+ fill: 0xFF4444
+ });
+ failedTxt.anchor.set(0.5, 0.5);
+ failedTxt.x = GAME_W / 2;
+ failedTxt.y = GAME_H / 2;
+ game.addChild(failedTxt);
+ // Hide gameplay UI
+ scoreTxt.visible = false;
+ comboTxt.visible = false;
+ recordTxt.visible = false;
+ if (healthBarContainer && healthBarContainer.parent) {
+ healthBarContainer.parent.removeChild(healthBarContainer);
+ }
+ // After 1.2s, remove failed text and return to level select
+ LK.setTimeout(function () {
+ if (failedTxt && failedTxt.parent) {
+ failedTxt.parent.removeChild(failedTxt);
+ }
+ levelSelectContainer.visible = true;
+ }, 1200);
+ return;
+ }
// Spawn notes according to songNotes, with NOTE_OFFSET_TICKS for sync
var relTick = LK.ticks - songStartTick;
while (noteIndex < songNotes.length && songNotes[noteIndex].tick <= relTick + NOTE_OFFSET_TICKS) {
spawnNote(songNotes[noteIndex].type);
@@ -2330,8 +2330,9 @@
for (var i = notes.length - 1; i >= 0; i--) {
var note = notes[i];
note.update();
if (!note.hit && note.y > NOTE_TARGET_Y + HIT_WINDOW) {
+ // Missed note
LK.effects.flashObject(note, 0xff0000, 120);
tween(note, {
alpha: 0
}, {
@@ -2362,37 +2363,8 @@
if (health < 0) health = 0;
if (healthBarFg) {
healthBarFg.width = health / maxHealth * healthBarBg.width;
}
- // --- FAIL CHECK: If health reaches zero, stop game, show 'Failed', return to menu ---
- if (health <= 0) {
- isPlaying = false;
- LK.stopMusic();
- LK.effects.flashScreen(0xff0000, 800);
- // Show 'Failed' text and return to level select menu after a short delay
- var failedTxt = new Text2("Failed", {
- size: 200,
- fill: 0xFF4444
- });
- failedTxt.anchor.set(0.5, 0.5);
- failedTxt.x = GAME_W / 2;
- failedTxt.y = GAME_H / 2;
- game.addChild(failedTxt);
- scoreTxt.visible = false;
- comboTxt.visible = false;
- recordTxt.visible = false;
- if (healthBarContainer && healthBarContainer.parent) {
- healthBarContainer.parent.removeChild(healthBarContainer);
- }
- LK.setTimeout(function () {
- if (failedTxt && failedTxt.parent) {
- failedTxt.parent.removeChild(failedTxt);
- }
- levelSelectContainer.visible = true;
- }, 1200);
- // Do not call LK.showGameOver here
- return;
- }
}
}
// Remove notes that go off screen
if (note.y > GAME_H + 100) {
birebir aynısı sadece SNARE yerine TOM yazsın ve butonunun rengi yeşil olsun. ve yazı paralel bir şekilde düz hizada olsun Transparent background. Blank background.
butonun altını gri yap ve yazıyı birazcık daha büyült
birebir aynısı sadece HI_HAT yerine CRASH yazsın ve butonunun rengi açık mor lila olsun. Transparent background. Blank background.
ortadaki ışıktan yukarı doğru hafif soluk ısık hüzmeleri çıksın
mavi versiyonunu yap
yeşil versiyonunu yap
sarı versiyonunu yap
lil rengi versiyonunu yap
make hand signs smaller but more crowded lightly blended into the background flu
transparent blank background
he is holding drumstick
make the next frame when he is hitting the drums while grin smile with one's teeth showing, his hands are down and drumstick are on the drums
add drum sticks held on both sides
no perspective all parralel lines from birdswiew
Game title text