User prompt
Skor 100 ə çatası vaxt bir çıxış qapısı açılsın və oyun bitsin
User prompt
Skor 100 olanda başaq bir səhifə gəlib kutlama olsun oyunu qazandınız deyə
User prompt
Divarı engelleri sil yerinə meteorite elə və meteorite formasında olsun və quite sözünədə assets elə ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Engellere tam çarpan zaman ölmeliyim
User prompt
Engelleri azca çok az kiçilt ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Engelleri atm yap eğri olmasın düm düz
User prompt
Tüm arkaplanı deyiş ve gökyüzü ve gece gibi yap
User prompt
Gökyüzü ve gece gibi olsun
User prompt
Arkaplanı deyiş
User prompt
Start ve quit yazısını arala azca uzaklaştır
User prompt
Engelleri geniş ve azca uzun yapsana pls
User prompt
Duvarlar rastgele düşsün
User prompt
Delete ball pattern
User prompt
En çok nerede durarsak engeller oraya düşsün
User prompt
Top en üste gitdiğinde sonsuza kadar gitmesin
User prompt
Start yazısını 4 bucaklı yap
User prompt
Yazı tam düz olsun
User prompt
Start yazısını çok büyük yap
User prompt
Start sözünüassest olarak al
User prompt
O menüde top hareket etmesin top aşağı düşmesin
User prompt
O ekranda top hareketsiz kalsın yanlız starta basanda hareket etsin
User prompt
Ayrı bir hoşgeldin menüsü ve start-a bastıkta oyun o zaman başlasın
User prompt
Girişde start ve quit sözü olsun ve kaliteyi güzelleştir
User prompt
Top yanlız sağ ve sola gitsin
User prompt
Biraz daha
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Obstacle = Container.expand(function () {
var self = Container.call(this);
// Create obstacle graphics
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
// Movement properties
self.speed = 5;
self.direction = 1; // 1 for down, -1 for up
self.lastIntersecting = false;
self.update = function () {
// Move obstacle down only
self.y += self.speed;
// Remove obstacle if it goes off screen
if (self.y > 2732) {
self.destroy();
}
};
return self;
});
var SoccerBall = Container.expand(function () {
var self = Container.call(this);
// Create ball graphics
var ballBase = self.attachAsset('ball', {
anchorX: 0.5,
anchorY: 0.5
});
var ballPattern = self.attachAsset('ballPattern', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.7,
scaleY: 0.7
});
// Physics properties
self.velocityY = 0;
self.velocityX = 0;
self.gravity = 0.6;
self.bounceDamping = 0.8;
self.tapForce = -18;
self.maxVelocityY = 25;
self.maxVelocityX = 8;
// Game state
self.isGrounded = false;
self.lastY = 0;
self.update = function () {
// Only update physics if game has started
if (!gameStarted) {
return;
}
// Store last position
self.lastY = self.y;
// Apply gravity
self.velocityY += self.gravity;
// Limit velocities
if (self.velocityY > self.maxVelocityY) {
self.velocityY = self.maxVelocityY;
}
if (self.velocityX > self.maxVelocityX) {
self.velocityX = self.maxVelocityX;
}
if (self.velocityX < -self.maxVelocityX) {
self.velocityX = -self.maxVelocityX;
}
// Update position
self.x += self.velocityX;
self.y += self.velocityY;
// Screen boundaries
var ballRadius = 60;
// Left/right wall bouncing
if (self.x - ballRadius <= 0) {
self.x = ballRadius;
self.velocityX = Math.abs(self.velocityX) * self.bounceDamping;
LK.getSound('bounce').play();
} else if (self.x + ballRadius >= 2048) {
self.x = 2048 - ballRadius;
self.velocityX = -Math.abs(self.velocityX) * self.bounceDamping;
LK.getSound('bounce').play();
}
// Ground collision detection
if (self.y + ballRadius >= 2732) {
if (!self.isGrounded) {
self.isGrounded = true;
gameOver();
}
}
// Add slight rotation for visual effect
ballBase.rotation += self.velocityX * 0.02;
ballPattern.rotation += self.velocityX * 0.02;
};
self.applyTapForce = function (tapX) {
if (!self.isGrounded) {
self.velocityY = self.tapForce;
// Apply horizontal force based on tap position
var screenCenter = 1024; // Screen width / 2
var horizontalForce = 6;
if (tapX > screenCenter) {
// Tap on right side - move right
self.velocityX += horizontalForce;
} else {
// Tap on left side - move left
self.velocityX -= horizontalForce;
}
// Visual feedback
tween(self, {
scaleX: 1.2,
scaleY: 1.2
}, {
duration: 100
});
tween(self, {
scaleX: 1.0,
scaleY: 1.0
}, {
duration: 200
});
LK.getSound('tap').play();
// Increase score
score++;
updateScore();
// Increase difficulty
increaseDifficulty();
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2E7D32
});
/****
* Game Code
****/
// Game variables
var ball;
var score = 0;
var baseGravity = 0.6;
var baseTapForce = -18;
var gameStarted = false;
var obstacles = [];
var obstacleSpawnTimer = 0;
var obstacleSpawnInterval = 180; // Spawn every 3 seconds at 60fps
// UI elements
var scoreTxt = new Text2('0', {
size: 120,
fill: 0xFFD700
});
scoreTxt.anchor.set(0.5, 0);
scoreTxt.y = 50;
LK.gui.top.addChild(scoreTxt);
var scoreLabel = new Text2('SCORE', {
size: 60,
fill: 0xFFFFFF
});
scoreLabel.anchor.set(0.5, 0);
scoreLabel.y = 10;
LK.gui.top.addChild(scoreLabel);
// Welcome screen elements
var welcomeScreen = new Container();
game.addChild(welcomeScreen);
var titleTxt = new Text2('SOCCER BALL KEEPER', {
size: 100,
fill: 0xFFFFFF
});
titleTxt.anchor.set(0.5, 0.5);
titleTxt.x = 1024;
titleTxt.y = 800;
welcomeScreen.addChild(titleTxt);
var subtitleTxt = new Text2('HOŞGELDİNİZ', {
size: 80,
fill: 0xFFD700
});
subtitleTxt.anchor.set(0.5, 0.5);
subtitleTxt.x = 1024;
subtitleTxt.y = 950;
welcomeScreen.addChild(subtitleTxt);
var startButton = LK.getAsset('start', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 3.0,
scaleY: 3.0
});
startButton.x = 1024;
startButton.y = 1200;
startButton.interactive = true;
startButton.buttonMode = true;
startButton.alpha = 0.9;
welcomeScreen.addChild(startButton);
var quitButton = new Text2('QUIT', {
size: 120,
fill: 0xFF0000
});
quitButton.anchor.set(0.5, 0.5);
quitButton.x = 1024;
quitButton.y = 1350;
quitButton.interactive = true;
quitButton.buttonMode = true;
quitButton.alpha = 0.9;
welcomeScreen.addChild(quitButton);
// Add button hover effects
startButton.move = function () {
startButton.alpha = 1.0;
tween(startButton, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 150
});
};
quitButton.move = function () {
quitButton.alpha = 1.0;
tween(quitButton, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 150
});
};
var instructionTxt = new Text2('TAP TO KEEP THE BALL UP!', {
size: 80,
fill: 0xFFFFFF
});
instructionTxt.anchor.set(0.5, 0.5);
instructionTxt.x = 1024;
instructionTxt.y = 900;
instructionTxt.visible = false;
game.addChild(instructionTxt);
// Add field elements
var centerLine = LK.getAsset('fieldLine', {
anchorX: 0.5,
anchorY: 0.5
});
centerLine.x = 1024;
centerLine.y = 1366;
game.addChild(centerLine);
var centerCircleOutline = LK.getAsset('centerCircle', {
anchorX: 0.5,
anchorY: 0.5
});
centerCircleOutline.x = 1024;
centerCircleOutline.y = 1366;
centerCircleOutline.alpha = 0.3;
game.addChild(centerCircleOutline);
var topGoalArea = LK.getAsset('goalArea', {
anchorX: 0.5,
anchorY: 0.5
});
topGoalArea.x = 1024;
topGoalArea.y = 100;
topGoalArea.alpha = 0.2;
game.addChild(topGoalArea);
var bottomGoalArea = LK.getAsset('goalArea', {
anchorX: 0.5,
anchorY: 0.5
});
bottomGoalArea.x = 1024;
bottomGoalArea.y = 2632;
bottomGoalArea.alpha = 0.2;
game.addChild(bottomGoalArea);
// Initialize ball but hide it initially
ball = game.addChild(new SoccerBall());
ball.x = 1024;
ball.y = 1000;
ball.visible = false;
// Hide field elements initially
centerLine.visible = false;
centerCircleOutline.visible = false;
topGoalArea.visible = false;
bottomGoalArea.visible = false;
function updateScore() {
scoreTxt.setText(score.toString());
}
function increaseDifficulty() {
// Slightly increase gravity and reduce tap effectiveness as score increases
var difficultyMultiplier = Math.min(1 + score * 0.01, 1.5);
ball.gravity = baseGravity * difficultyMultiplier;
ball.tapForce = baseTapForce * (1 / Math.sqrt(difficultyMultiplier));
}
function gameOver() {
LK.showGameOver();
}
function startGame() {
if (!gameStarted) {
gameStarted = true;
// Hide welcome screen
welcomeScreen.visible = false;
// Show game elements
ball.visible = true;
centerLine.visible = true;
centerCircleOutline.visible = true;
topGoalArea.visible = true;
bottomGoalArea.visible = true;
instructionTxt.visible = true;
ball.applyTapForce(1024);
// Clear any existing obstacles
for (var i = 0; i < obstacles.length; i++) {
obstacles[i].destroy();
}
obstacles = [];
obstacleSpawnTimer = 0;
}
}
// Event handlers
startButton.down = function (x, y, obj) {
startGame();
};
quitButton.down = function (x, y, obj) {
LK.showGameOver();
};
game.down = function (x, y, obj) {
if (gameStarted) {
ball.applyTapForce(x);
}
};
game.update = function () {
// Game loop handled by ball's update method
if (gameStarted) {
// Spawn obstacles
obstacleSpawnTimer++;
if (obstacleSpawnTimer >= obstacleSpawnInterval) {
obstacleSpawnTimer = 0;
var obstacle = new Obstacle();
obstacle.x = Math.random() * 1800 + 124; // Random X position with margins
obstacle.y = -50; // Start from top of screen
obstacles.push(obstacle);
game.addChild(obstacle);
}
// Check collision with obstacles
for (var i = obstacles.length - 1; i >= 0; i--) {
var obstacle = obstacles[i];
var currentIntersecting = ball.intersects(obstacle);
if (!obstacle.lastIntersecting && currentIntersecting) {
// Collision detected - game over
ball.isGrounded = true;
gameOver();
break;
}
obstacle.lastIntersecting = currentIntersecting;
}
// Remove obstacles that are too old (optional cleanup)
if (obstacles.length > 6) {
var oldObstacle = obstacles.shift();
oldObstacle.destroy();
}
}
};
// Initial score display
updateScore(); ===================================================================
--- original.js
+++ change.js
@@ -187,9 +187,11 @@
subtitleTxt.y = 950;
welcomeScreen.addChild(subtitleTxt);
var startButton = LK.getAsset('start', {
anchorX: 0.5,
- anchorY: 0.5
+ anchorY: 0.5,
+ scaleX: 3.0,
+ scaleY: 3.0
});
startButton.x = 1024;
startButton.y = 1200;
startButton.interactive = true;
Anything . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
A rocket . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Thunder logo. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
A sign . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Robotic door metal exit door. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
A stone. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat