User prompt
daha güzel gol sevinçleri olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
farklı gol sevinçleri daha ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (3 edits merged)
Please save this source code
User prompt
Top gol olmayınca kalplerimiz den biri gitsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
futbolcu sevincinde (süüüüüü) diye bağırsın
User prompt
futbolcu farklı bir şekilde sevinsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
futbolcu gol atınca sevinsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
futbolcu topa vursun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
şutu bir futbolcu çeksin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
arka planı stadyum yap
Code edit (2 edits merged)
Please save this source code
User prompt
kalp üst adlı varlığı sil
User prompt
kalpler olsun
Code edit (1 edits merged)
Please save this source code
User prompt
kalpler sol alt köşede olsun
User prompt
canlarımız kalp sembolü ile gösterilsin ve üç canımız olsun
User prompt
canlarımız sembolle gösterilsin
Initial prompt
kaleci her kurtardığında bir canımız gitsin ve üç canımız olsun
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Ball = Container.expand(function () { var self = Container.call(this); var ballGraphics = self.attachAsset('ball', { anchorX: 0.5, anchorY: 0.5 }); self.velocityX = 0; self.velocityY = 0; self.gravity = 0.3; self.isMoving = false; self.startX = 0; self.startY = 0; self.reset = function () { self.x = self.startX; self.y = self.startY; self.velocityX = 0; self.velocityY = 0; self.isMoving = false; ballGraphics.alpha = 1; }; self.shoot = function (powerX, powerY) { self.velocityX = powerX * 0.8; self.velocityY = powerY * 0.8; self.isMoving = true; LK.getSound('kick').play(); }; self.update = function () { if (self.isMoving) { self.x += self.velocityX; self.y += self.velocityY; self.velocityY += self.gravity; // Ball physics - slow down over time self.velocityX *= 0.99; } }; return self; }); var Goalkeeper = Container.expand(function () { var self = Container.call(this); var keeperGraphics = self.attachAsset('goalkeeper', { anchorX: 0.5, anchorY: 1 }); self.homeX = 0; self.homeY = 0; self.targetX = 0; self.speed = 3; self.reactionTime = 0; self.isReacting = false; self.setHome = function (x, y) { self.homeX = x; self.homeY = y; self.x = x; self.y = y; self.targetX = x; }; self.reactToBall = function (ballX, ballY) { if (!self.isReacting && self.reactionTime <= 0) { self.isReacting = true; self.reactionTime = 30; // Reaction delay // Predict where ball will be if (ballX < self.homeX - 50) { self.targetX = self.homeX - 150; } else if (ballX > self.homeX + 50) { self.targetX = self.homeX + 150; } } }; self.returnHome = function () { self.targetX = self.homeX; self.isReacting = false; self.reactionTime = 60; // Cooldown before next reaction }; self.update = function () { if (self.reactionTime > 0) { self.reactionTime--; } // Move towards target var dx = self.targetX - self.x; if (Math.abs(dx) > self.speed) { self.x += dx > 0 ? self.speed : -self.speed; } else { self.x = self.targetX; } }; return self; }); var TargetZone = Container.expand(function () { var self = Container.call(this); var zoneGraphics = self.attachAsset('targetZone', { anchorX: 0.5, anchorY: 0.5 }); zoneGraphics.alpha = 0.3; self.points = 1; self.isActive = false; self.activate = function () { self.isActive = true; zoneGraphics.alpha = 0.6; tween(zoneGraphics, { alpha: 0.3 }, { duration: 1000 }); }; self.setPoints = function (points) { self.points = points; if (points > 1) { zoneGraphics.tint = 0xffd700; // Gold for high value zones } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x2E8B57 }); /**** * Game Code ****/ // Game dimensions and positioning var gameWidth = 2048; var gameHeight = 2732; var goalWidth = 600; var goalHeight = 400; var goalX = gameWidth / 2; var goalY = gameHeight * 0.3; // Game state var currentLevel = 1; var streak = 0; var isAiming = false; var isShooting = false; var shotsTaken = 0; var lives = 3; // Create goal structure var goalBackground = game.addChild(LK.getAsset('goalBackground', { anchorX: 0.5, anchorY: 0.5, x: goalX, y: goalY })); var leftPost = game.addChild(LK.getAsset('goalPost', { anchorX: 0.5, anchorY: 0.5, x: goalX - goalWidth / 2, y: goalY })); var rightPost = game.addChild(LK.getAsset('goalPost', { anchorX: 0.5, anchorY: 0.5, x: goalX + goalWidth / 2, y: goalY })); var crossbar = game.addChild(LK.getAsset('goalCrossbar', { anchorX: 0.5, anchorY: 0.5, x: goalX, y: goalY - goalHeight / 2 })); // Create ball var ball = game.addChild(new Ball()); ball.startX = gameWidth / 2; ball.startY = gameHeight * 0.8; ball.reset(); // Create goalkeeper var goalkeeper = game.addChild(new Goalkeeper()); goalkeeper.setHome(goalX, goalY + goalHeight / 2 - 20); // Create target zones var targetZones = []; var zonePositions = [{ x: goalX - 200, y: goalY - 100, points: 3 }, // Top left corner { x: goalX + 200, y: goalY - 100, points: 3 }, // Top right corner { x: goalX - 200, y: goalY + 100, points: 2 }, // Bottom left { x: goalX + 200, y: goalY + 100, points: 2 }, // Bottom right { x: goalX, y: goalY, points: 1 } // Center ]; for (var i = 0; i < zonePositions.length; i++) { var zone = game.addChild(new TargetZone()); zone.x = zonePositions[i].x; zone.y = zonePositions[i].y; zone.setPoints(zonePositions[i].points); targetZones.push(zone); } // Aim line for visualization var aimLine = game.addChild(LK.getAsset('aimLine', { anchorX: 0.5, anchorY: 0, alpha: 0 })); // UI Elements var scoreTxt = new Text2('Score: 0', { size: 80, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var shotsTxt = new Text2('Shots: 0', { size: 60, fill: 0xFFFFFF }); shotsTxt.anchor.set(1, 0); LK.gui.topRight.addChild(shotsTxt); var levelTxt = new Text2('Level: 1', { size: 60, fill: 0xFFFFFF }); levelTxt.anchor.set(0, 0); LK.gui.topLeft.addChild(levelTxt); // Create heart symbols for lives var heartSymbols = []; for (var h = 0; h < 3; h++) { var heart = LK.getAsset('heart', { anchorX: 0.5, anchorY: 0.5 }); heart.x = 50 + h * 70; heart.y = 50; heartSymbols.push(heart); LK.gui.bottomLeft.addChild(heart); } // Game variables var dragStartX = 0; var dragStartY = 0; var isDragging = false; function resetShot() { ball.reset(); goalkeeper.returnHome(); isShooting = false; isAiming = false; aimLine.alpha = 0; // Activate random target zone var randomZone = targetZones[Math.floor(Math.random() * targetZones.length)]; randomZone.activate(); } function checkGoal() { // Check if ball is in goal area if (ball.x > goalX - goalWidth / 2 && ball.x < goalX + goalWidth / 2 && ball.y > goalY - goalHeight / 2 && ball.y < goalY + goalHeight / 2) { // Check which target zone was hit for (var i = 0; i < targetZones.length; i++) { var zone = targetZones[i]; if (zone.isActive && ball.intersects(zone)) { LK.setScore(LK.getScore() + zone.points); scoreTxt.setText('Score: ' + LK.getScore()); streak++; LK.getSound('goal').play(); LK.effects.flashScreen(0x00ff00, 500); LK.setTimeout(function () { nextShot(); }, 1000); return true; } } // Goal but missed target zone LK.setScore(LK.getScore() + 1); scoreTxt.setText('Score: ' + LK.getScore()); streak++; LK.getSound('goal').play(); LK.setTimeout(function () { nextShot(); }, 1000); return true; } // Check if goalkeeper saved if (ball.intersects(goalkeeper)) { streak = 0; lives--; // Hide a heart symbol if (lives >= 0 && lives < heartSymbols.length) { heartSymbols[lives].alpha = 0.3; } LK.getSound('save').play(); LK.effects.flashObject(goalkeeper, 0x00ff00, 500); if (lives <= 0) { LK.setTimeout(function () { LK.showGameOver(); }, 1000); } else { LK.setTimeout(function () { nextShot(); }, 1000); } return true; } return false; } function nextShot() { shotsTaken++; shotsTxt.setText('Shots: ' + shotsTaken); if (LK.getScore() >= currentLevel * 15) { currentLevel++; levelTxt.setText('Level: ' + currentLevel); // Increase difficulty goalkeeper.speed = Math.min(goalkeeper.speed + 0.5, 8); } resetShot(); } // Touch/Mouse controls game.down = function (x, y, obj) { if (!isShooting && !isAiming) { isAiming = true; isDragging = true; dragStartX = x; dragStartY = y; aimLine.x = ball.x; aimLine.y = ball.y; aimLine.alpha = 0.7; } }; game.move = function (x, y, obj) { if (isDragging && isAiming) { var dx = x - dragStartX; var dy = y - dragStartY; var distance = Math.sqrt(dx * dx + dy * dy); var maxDistance = 300; if (distance > maxDistance) { dx = dx / distance * maxDistance; dy = dy / distance * maxDistance; } // Update aim line aimLine.rotation = Math.atan2(dy, dx) + Math.PI / 2; aimLine.height = Math.min(distance, maxDistance); } }; game.up = function (x, y, obj) { if (isDragging && isAiming) { isDragging = false; isAiming = false; isShooting = true; aimLine.alpha = 0; var dx = x - dragStartX; var dy = y - dragStartY; var distance = Math.sqrt(dx * dx + dy * dy); var power = Math.min(distance / 10, 20); ball.shoot(dx / 10, dy / 10); goalkeeper.reactToBall(ball.x + dx, ball.y + dy); } }; // Game update loop game.update = function () { if (isShooting && ball.isMoving) { // Check if ball went out of bounds if (ball.y < goalY - goalHeight / 2 - 100 || ball.x < 0 || ball.x > gameWidth || ball.y > gameHeight) { ball.isMoving = false; isShooting = false; streak = 0; LK.setTimeout(function () { nextShot(); }, 500); return; } // Check for goal or save if (checkGoal()) { ball.isMoving = false; isShooting = false; return; } } }; // Initialize first shot resetShot();
===================================================================
--- original.js
+++ change.js
@@ -240,14 +240,20 @@
fill: 0xFFFFFF
});
levelTxt.anchor.set(0, 0);
LK.gui.topLeft.addChild(levelTxt);
-var livesTxt = new Text2('Lives: 3', {
- size: 60,
- fill: 0xFFFFFF
-});
-livesTxt.anchor.set(0, 1);
-LK.gui.bottomLeft.addChild(livesTxt);
+// Create heart symbols for lives
+var heartSymbols = [];
+for (var h = 0; h < 3; h++) {
+ var heart = LK.getAsset('heart', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ heart.x = 50 + h * 70;
+ heart.y = 50;
+ heartSymbols.push(heart);
+ LK.gui.bottomLeft.addChild(heart);
+}
// Game variables
var dragStartX = 0;
var dragStartY = 0;
var isDragging = false;
@@ -292,9 +298,12 @@
// Check if goalkeeper saved
if (ball.intersects(goalkeeper)) {
streak = 0;
lives--;
- livesTxt.setText('Lives: ' + lives);
+ // Hide a heart symbol
+ if (lives >= 0 && lives < heartSymbols.length) {
+ heartSymbols[lives].alpha = 0.3;
+ }
LK.getSound('save').play();
LK.effects.flashObject(goalkeeper, 0x00ff00, 500);
if (lives <= 0) {
LK.setTimeout(function () {
ball. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
courtuis. In-Game asset. High contrast. No shadows. goalkeeper . full body . facing forward
kalp. In-Game asset. 2d. High contrast. No shadows
full body ronnaldo. In-Game asset. 2d. High contrast. No shadows. top olmasın. turned away. no ball