User prompt
Kalplerimiz mario oyununcdaki kalplerle aynısı olsun
User prompt
Kalplerimiz kalp şeklinde olsun
User prompt
Daha düzgün kalp olsun
User prompt
Can haklarımız kalp şeklinde olsun
User prompt
Yavaş başlasın ve elmaları kazanınca yavaş yavaş hızı artsın
User prompt
Biraz daha hızlı düşsün
User prompt
Nesneler sadece kendini igilendirsin yani nensenin yanındaki boşluklar nesne içinde sayılmasın
User prompt
Biraz daha hızlı ve bomba lar daha az düşsün
User prompt
daha da yavaş
User prompt
3 hakkımız bittikten sonra ölelim
User prompt
3 kalbimiz olsun 3ü de bitince replay tuşu gelsin
User prompt
Bombalar patlayınca booom yazan bir ekran çıksın
User prompt
Nesneler daha yavaş düşsün
Code edit (1 edits merged)
Please save this source code
User prompt
Face Dash: Smile Runner
User prompt
Please continue polishing my design document.
User prompt
Please continue polishing my design document.
Initial prompt
Make me a basketball game and in the basketball game we need to use our voice to make our shot. If we use our voice in the right style, the shot can be made. These should be the vocalization of notes, i.e. do re mi fa sol la si do sounds, if they are vocalized, the shot can be made. There should be sound interactions in the game. If we shoot a basket into the basket, we should earn points. If the baskets are made, we should hear more difficult sounds. These can come randomly. If we make a mistake, we should receive a message that we lost and be given the opportunity to play again for a new game.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var facekit = LK.import("@upit/facekit.v1"); /**** * Classes ****/ // Collectible class var Collectible = Container.expand(function () { var self = Container.call(this); var col = self.attachAsset('collectible', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5 + Math.random() * 2.5; self.update = function () { self.y += self.speed; }; return self; }); // Obstacle class var Obstacle = Container.expand(function () { var self = Container.call(this); var obs = self.attachAsset('obstacle', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 7 + Math.random() * 3; // pixels per frame self.update = function () { self.y += self.speed; }; return self; }); // Player class (face-controlled) var Player = Container.expand(function () { var self = Container.call(this); var face = self.attachAsset('playerFace', { anchorX: 0.5, anchorY: 0.5 }); self.radius = face.width * 0.5; self.update = function () { // Facekit controls // Use mouthCenter for X, Y // Clamp to game area var targetX = facekit.mouthCenter && typeof facekit.mouthCenter.x === 'number' ? facekit.mouthCenter.x : 2048 / 2; var targetY = facekit.mouthCenter && typeof facekit.mouthCenter.y === 'number' ? facekit.mouthCenter.y : 2732 * 0.75; // Smooth follow for less jitter self.x += (targetX - self.x) * 0.3; self.y += (targetY - self.y) * 0.3; // Clamp to bounds if (self.x < self.radius) self.x = self.radius; if (self.x > 2048 - self.radius) self.x = 2048 - self.radius; if (self.y < self.radius + 200) self.y = self.radius + 200; if (self.y > 2732 - self.radius) self.y = 2732 - self.radius; // Animate scale with mouth open if (facekit.mouthOpen) { tween.stop(face); tween(face, { scaleX: 1.2, scaleY: 1.2 }, { duration: 120, easing: tween.easeOut }); } else { tween.stop(face); tween(face, { scaleX: 1, scaleY: 1 }, { duration: 120, easing: tween.easeOut }); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x181c2c }); /**** * Game Code ****/ // Music (background) // Sound for hitting obstacle // Sound for collecting // Collectible: a green ellipse // Obstacle: a red box // Character: a simple ellipse (face) // Play background music LK.playMusic('bgmusic', { fade: { start: 0, end: 0.7, duration: 1200 } }); // Score var score = 0; var scoreTxt = new Text2('0', { size: 120, fill: 0xFFF700 }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Player var player = new Player(); game.addChild(player); player.x = 2048 / 2; player.y = 2732 * 0.75; // Arrays for obstacles and collectibles var obstacles = []; var collectibles = []; // Timers for spawning var obstacleTimer = 0; var collectibleTimer = 0; // For collision state var lastHit = false; // Heart (life) system var maxHearts = 3; var hearts = maxHearts; // Heart UI var heartIcons = []; function drawHearts() { // Remove old icons for (var i = 0; i < heartIcons.length; i++) { if (heartIcons[i].parent) heartIcons[i].parent.removeChild(heartIcons[i]); heartIcons[i].destroy(); } heartIcons = []; // Draw new icons for (var i = 0; i < hearts; i++) { var heart = LK.getAsset('centerCircle', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.5, scaleY: 0.5, x: 180 + i * 120, y: 120 }); heart.tint = 0xff3b3b; LK.gui.top.addChild(heart); heartIcons.push(heart); } } drawHearts(); // Helper: spawn obstacle function spawnObstacle() { var obs = new Obstacle(); obs.x = 200 + Math.random() * (2048 - 400); obs.y = -100; obstacles.push(obs); game.addChild(obs); } // Helper: spawn collectible function spawnCollectible() { var col = new Collectible(); col.x = 150 + Math.random() * (2048 - 300); col.y = -80; collectibles.push(col); game.addChild(col); } // Main update loop game.update = function () { // Update player (face tracking) player.update(); // Spawn obstacles obstacleTimer--; if (obstacleTimer <= 0) { spawnObstacle(); obstacleTimer = 60 + Math.floor(Math.random() * 40); // ~1s, less frequent } // Spawn collectibles collectibleTimer--; if (collectibleTimer <= 0) { spawnCollectible(); collectibleTimer = 90 + Math.floor(Math.random() * 60); // ~1.5s } // Update obstacles for (var i = obstacles.length - 1; i >= 0; i--) { var obs = obstacles[i]; obs.update(); // Remove if off screen if (obs.y > 2732 + 100) { obs.destroy(); obstacles.splice(i, 1); continue; } // Collision with player var hit = player.intersects(obs); if (hit && !lastHit) { LK.effects.flashScreen(0xff0000, 800); LK.getSound('hit').play(); // Show "BOOOM" text in the center of the screen var boomTxt = new Text2('BOOOM', { size: 300, fill: 0xFF2222, font: "Impact, Arial Black, Tahoma" }); boomTxt.anchor.set(0.5, 0.5); boomTxt.x = 2048 / 2; boomTxt.y = 2732 / 2; game.addChild(boomTxt); tween(boomTxt, { alpha: 0 }, { duration: 1000, onComplete: function onComplete() { boomTxt.destroy(); } }); // Decrement hearts and update UI hearts--; drawHearts(); if (hearts <= 0) { // End game immediately when hearts reach 0 LK.showGameOver(); lastHit = true; break; } lastHit = true; break; } } // Reset lastHit if no collision if (!obstacles.some(function (o) { return player.intersects(o); })) { lastHit = false; } // Update collectibles for (var j = collectibles.length - 1; j >= 0; j--) { var col = collectibles[j]; col.update(); // Remove if off screen if (col.y > 2732 + 80) { col.destroy(); collectibles.splice(j, 1); continue; } // Collect if (player.intersects(col)) { LK.getSound('collect').play(); score += 1; scoreTxt.setText(score); LK.setScore(score); // Flash green LK.effects.flashObject(player, 0x44de83, 300); col.destroy(); collectibles.splice(j, 1); continue; } } }; // On game reset, reset score and clear arrays game.on('reset', function () { score = 0; scoreTxt.setText(score); LK.setScore(score); for (var i = 0; i < obstacles.length; i++) obstacles[i].destroy(); for (var j = 0; j < collectibles.length; j++) collectibles[j].destroy(); obstacles = []; collectibles = []; player.x = 2048 / 2; player.y = 2732 * 0.75; lastHit = false; obstacleTimer = 0; collectibleTimer = 0; // Reset hearts hearts = maxHearts; drawHearts(); }); // Touch fallback: allow dragging player if facekit not available var dragActive = false; game.down = function (x, y, obj) { if (!facekit.mouthCenter) { dragActive = true; player.x = x; player.y = y; } }; game.move = function (x, y, obj) { if (dragActive && !facekit.mouthCenter) { player.x = x; player.y = y; } }; game.up = function (x, y, obj) { dragActive = false; };
===================================================================
--- original.js
+++ change.js
@@ -13,9 +13,9 @@
var col = self.attachAsset('collectible', {
anchorX: 0.5,
anchorY: 0.5
});
- self.speed = 3 + Math.random() * 1.5;
+ self.speed = 5 + Math.random() * 2.5;
self.update = function () {
self.y += self.speed;
};
return self;
@@ -26,9 +26,9 @@
var obs = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
- self.speed = 4 + Math.random() * 2; // pixels per frame
+ self.speed = 7 + Math.random() * 3; // pixels per frame
self.update = function () {
self.y += self.speed;
};
return self;
@@ -175,9 +175,9 @@
// Spawn obstacles
obstacleTimer--;
if (obstacleTimer <= 0) {
spawnObstacle();
- obstacleTimer = 36 + Math.floor(Math.random() * 24); // ~0.6s
+ obstacleTimer = 60 + Math.floor(Math.random() * 40); // ~1s, less frequent
}
// Spawn collectibles
collectibleTimer--;
if (collectibleTimer <= 0) {