User prompt
Make it only if it says bad 3 times then it does the soda everywhere saying you lost ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make it if you miss the cups 3 times then the Coca Cola can explodes and covers the screen with soda saying you lost ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make everything but the background bigger
User prompt
Make it so if you hit it and it says great the soda bottles disappear
User prompt
Make the hitbox bigger and easier to hit
User prompt
Add a skibidi toilet background
User prompt
Add music
User prompt
Make it when I hit the yellow square on the blue square it says great but any where else it says bad
User prompt
Make the note hitters bigger like arrows like dance dance revolution
Code edit (1 edits merged)
Please save this source code
User prompt
Fizzy Beats
Initial prompt
Can you create a game like Friday night funkin but the characters are soda cans
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var HitEffect = Container.expand(function () {
var self = Container.call(this);
var effectGraphics = self.attachAsset('hitEffect', {
anchorX: 0.5,
anchorY: 0.5
});
self.play = function () {
effectGraphics.alpha = 1;
effectGraphics.scaleX = 0.5;
effectGraphics.scaleY = 0.5;
tween(effectGraphics, {
scaleX: 1.5,
scaleY: 1.5,
alpha: 0
}, {
duration: 400,
easing: tween.easeOut,
onFinish: function onFinish() {
self.destroy();
}
});
};
return self;
});
var Note = Container.expand(function () {
var self = Container.call(this);
var noteGraphics = self.attachAsset('note', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 8;
self.lane = 0;
self.hitProcessed = false;
self.update = function () {
self.y += self.speed;
};
return self;
});
var OpponentCan = Container.expand(function () {
var self = Container.call(this);
var canGraphics = self.attachAsset('opponentCan', {
anchorX: 0.5,
anchorY: 0.5
});
self.isAnimating = false;
self.sing = function () {
if (self.isAnimating) return;
self.isAnimating = true;
tween(canGraphics, {
scaleY: 1.1,
scaleX: 1.1
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(canGraphics, {
scaleY: 1,
scaleX: 1
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
self.isAnimating = false;
}
});
}
});
};
return self;
});
var SodaCan = Container.expand(function () {
var self = Container.call(this);
var canGraphics = self.attachAsset('sodaCan', {
anchorX: 0.5,
anchorY: 0.5
});
self.isAnimating = false;
self.celebrate = function () {
if (self.isAnimating) return;
self.isAnimating = true;
tween(canGraphics, {
scaleY: 1.2,
scaleX: 0.9
}, {
duration: 200,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(canGraphics, {
scaleY: 1,
scaleX: 1
}, {
duration: 200,
easing: tween.easeOut,
onFinish: function onFinish() {
self.isAnimating = false;
}
});
}
});
};
self.miss = function () {
if (self.isAnimating) return;
self.isAnimating = true;
tween(canGraphics, {
rotation: -0.3
}, {
duration: 150,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(canGraphics, {
rotation: 0.3
}, {
duration: 150,
easing: tween.easeOut,
onFinish: function onFinish() {
tween(canGraphics, {
rotation: 0
}, {
duration: 150,
easing: tween.easeOut,
onFinish: function onFinish() {
self.isAnimating = false;
}
});
}
});
}
});
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2c3e50
});
/****
* Game Code
****/
// Game state
var gameState = 'playing'; // 'playing', 'gameover'
var combo = 0;
var maxCombo = 0;
var accuracy = 100;
var totalNotes = 0;
var hitNotes = 0;
// Game objects
var playerCan;
var opponentCan;
var notes = [];
var targetZones = [];
var beatPattern = [0, 1, 2, 1, 0, 2, 1, 0]; // Note lanes pattern
var patternIndex = 0;
var noteSpawnTimer = 0;
var noteSpawnInterval = 45; // Spawn note every 45 ticks (0.75 seconds at 60fps)
// Target zones positions
var lanePositions = [2048 / 4,
// Lane 0
2048 / 2,
// Lane 1
3 * 2048 / 4 // Lane 2
];
// UI Elements
var comboText = new Text2('Combo: 0', {
size: 60,
fill: 0xFFFFFF
});
comboText.anchor.set(0.5, 0);
LK.gui.top.addChild(comboText);
var accuracyText = new Text2('Accuracy: 100%', {
size: 50,
fill: 0xFFFFFF
});
accuracyText.anchor.set(1, 0);
LK.gui.topRight.addChild(accuracyText);
// Initialize characters
playerCan = game.addChild(new SodaCan());
playerCan.x = 2048 / 2;
playerCan.y = 2200;
opponentCan = game.addChild(new OpponentCan());
opponentCan.x = 2048 / 2;
opponentCan.y = 400;
// Create target zones
for (var i = 0; i < 3; i++) {
var targetZone = LK.getAsset('targetZone', {
anchorX: 0.5,
anchorY: 0.5
});
targetZone.x = lanePositions[i];
targetZone.y = 2000;
targetZone.alpha = 0.7;
targetZones.push(targetZone);
game.addChild(targetZone);
}
// Input handling
game.down = function (x, y, obj) {
if (gameState !== 'playing') return;
// Determine which lane was tapped
var tappedLane = -1;
var minDistance = Infinity;
for (var i = 0; i < lanePositions.length; i++) {
var distance = Math.abs(x - lanePositions[i]);
if (distance < minDistance && distance < 300) {
minDistance = distance;
tappedLane = i;
}
}
if (tappedLane === -1) return;
// Check for notes in this lane
var hitNote = null;
var bestDistance = Infinity;
for (var j = 0; j < notes.length; j++) {
var note = notes[j];
if (note.lane === tappedLane && !note.hitProcessed) {
var noteDistance = Math.abs(note.y - 2000);
if (noteDistance < 200 && noteDistance < bestDistance) {
bestDistance = noteDistance;
hitNote = note;
}
}
}
if (hitNote) {
// Hit!
hitNote.hitProcessed = true;
combo++;
hitNotes++;
LK.setScore(LK.getScore() + 10 * combo);
// Create hit effect
var effect = game.addChild(new HitEffect());
effect.x = lanePositions[tappedLane];
effect.y = 2000;
effect.play();
// Player animation
playerCan.celebrate();
// Play hit sound
LK.getSound('hit').play();
// Update combo text
comboText.setText('Combo: ' + combo);
if (combo > maxCombo) {
maxCombo = combo;
}
} else {
// Miss!
combo = 0;
playerCan.miss();
LK.getSound('miss').play();
comboText.setText('Combo: 0');
}
// Update accuracy
if (totalNotes > 0) {
accuracy = Math.round(hitNotes / totalNotes * 100);
accuracyText.setText('Accuracy: ' + accuracy + '%');
}
};
// Main game update
game.update = function () {
if (gameState !== 'playing') return;
// Spawn notes based on pattern
noteSpawnTimer++;
if (noteSpawnTimer >= noteSpawnInterval) {
noteSpawnTimer = 0;
var newNote = new Note();
newNote.lane = beatPattern[patternIndex];
newNote.x = lanePositions[newNote.lane];
newNote.y = -50;
notes.push(newNote);
game.addChild(newNote);
totalNotes++;
patternIndex = (patternIndex + 1) % beatPattern.length;
// Opponent animation on note spawn
if (LK.ticks % 90 === 0) {
// Every 1.5 seconds
opponentCan.sing();
}
}
// Update notes
for (var i = notes.length - 1; i >= 0; i--) {
var note = notes[i];
// Remove notes that went off screen
if (note.y > 2732 + 50) {
if (!note.hitProcessed) {
// Missed note
combo = 0;
comboText.setText('Combo: 0');
// Update accuracy
if (totalNotes > 0) {
accuracy = Math.round(hitNotes / totalNotes * 100);
accuracyText.setText('Accuracy: ' + accuracy + '%');
}
}
note.destroy();
notes.splice(i, 1);
continue;
}
// Auto-miss notes that are too far past the target
if (!note.hitProcessed && note.y > 2150) {
note.hitProcessed = true;
combo = 0;
playerCan.miss();
comboText.setText('Combo: 0');
// Update accuracy
if (totalNotes > 0) {
accuracy = Math.round(hitNotes / totalNotes * 100);
accuracyText.setText('Accuracy: ' + accuracy + '%');
}
}
}
// Check win condition
if (LK.getScore() >= 1000) {
gameState = 'gameover';
LK.showYouWin();
}
// Check lose condition (very low accuracy after many notes)
if (totalNotes > 20 && accuracy < 30) {
gameState = 'gameover';
LK.showGameOver();
}
};
// Start background music
LK.playMusic('bgtrack'); ===================================================================
--- original.js
+++ change.js
@@ -210,9 +210,9 @@
var tappedLane = -1;
var minDistance = Infinity;
for (var i = 0; i < lanePositions.length; i++) {
var distance = Math.abs(x - lanePositions[i]);
- if (distance < minDistance && distance < 200) {
+ if (distance < minDistance && distance < 300) {
minDistance = distance;
tappedLane = i;
}
}
@@ -223,9 +223,9 @@
for (var j = 0; j < notes.length; j++) {
var note = notes[j];
if (note.lane === tappedLane && !note.hitProcessed) {
var noteDistance = Math.abs(note.y - 2000);
- if (noteDistance < 150 && noteDistance < bestDistance) {
+ if (noteDistance < 200 && noteDistance < bestDistance) {
bestDistance = noteDistance;
hitNote = note;
}
}