User prompt
Eğer coin top tarafından yok olmazsa 10 saniyede bir yer değistirsin
User prompt
Yazı 10 saniye sonra yok olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Sağ üstte neden oyunu bitirmeye çalışmıyorsun? yazsın ingilizce olarak
User prompt
Oyun 1000 scorede bitsin
User prompt
Top platform'a çarpınca ses sesi olsun
User prompt
Arka planda müzik;1 olsun ve hep tekrar etsin!!!!!!! aynı zamanda ses;1 in ses seviyesini biraz daha arttır
User prompt
Her 10 scorede hız %5 artsın
User prompt
Top madeni paraya geldiğinde ses;2 olsun
User prompt
Top platforma deydiği zaman ses ; 1 çalışşın
User prompt
Coin yok olunca ekranın başka bir yerinde yeni bir coin oluşşsun
User prompt
Sadece bir tane coin olsun
User prompt
Üstte 1 coin olsun coin'e top geldiği zaman ekranın başka bir yerinde yeni bir top oluşsun
User prompt
Üstte coinler olsun Coine top değidiği zaman coin yok olsun ve Score de +10 artsın
User prompt
Plaform un değil topun renği değissin
User prompt
Please fix the bug: 'ReferenceError: platformGraphics is not defined' in or related to this line: 'platformGraphics.tint = Math.random() * 0xFFFFFF; // Change platform color to a random color' Line Number: 37
User prompt
Top platforma her değdiğinde renki değişssin
User prompt
Harita arka planı kaplasın!
Code edit (4 edits merged)
Please save this source code
User prompt
Kodlarda hata var mı diye bak
Code edit (1 edits merged)
Please save this source code
/**** * Classes ****/ // Ball class to represent the bouncing ball var Ball = Container.expand(function () { var self = Container.call(this); var ballGraphics = self.attachAsset('ball', { anchorX: 0.5, anchorY: 0.5 }); self.speedY = 5; // Initial vertical speed self.speedX = 3; // Initial horizontal speed self.update = function () { self.x += self.speedX; self.y += self.speedY; // Bounce off the left and right walls if (self.x <= 0 || self.x >= 2048) { self.speedX *= -1; self.speedX *= 1.25; // Increase speed by 25% when bouncing off the side walls } // Bounce off the top wall if (self.y <= 0) { self.speedY *= -1; self.speedY *= 1.25; // Increase speed by 25% when bouncing off the top wall } // Bounce off the platform if (self.y >= platform.y - platform.height / 2 && self.y <= platform.y + platform.height / 2 && self.x >= platform.x - platform.width / 2 && self.x <= platform.x + platform.width / 2) { self.speedY *= -1; self.speedY *= 1.45; // Increase speed by 45% when bouncing off the platform self.speedX *= 1.45; // Increase speed by 45% when bouncing off the platform LK.setScore(LK.getScore() + 1); scoreTxt.setText(LK.getScore()); } // Game over if the ball falls below the platform if (self.y > 2732) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } }; }); // Platform class to represent the platform var Platform = Container.expand(function () { var self = Container.call(this); var platformGraphics = self.attachAsset('platform', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Platform movement logic can be added here if needed }; }); /**** * Initialize Game ****/ // Initialize the game with black background var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Top ve platform şekilleri tanımlı // Initialize the ball and platform var ball = game.addChild(new Ball()); ball.x = 1024; // Center horizontally ball.y = 1366; // Start above the platform var platform = game.addChild(new Platform()); platform.x = 1024; // Center horizontally platform.y = 2100; // Platform position near the bottom (adjusted lower) // Initialize score display var scoreTxt = new Text2('0', { size: 150, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Handle game updates game.update = function () { ball.update(); platform.update(); }; // Handle touch/mouse movement to control the platform game.move = function (x, y, obj) { platform.x = x; };
/****
* Classes
****/
// Ball class to represent the bouncing ball
var Ball = Container.expand(function () {
var self = Container.call(this);
var ballGraphics = self.attachAsset('ball', {
anchorX: 0.5,
anchorY: 0.5
});
self.speedY = 5; // Initial vertical speed
self.speedX = 3; // Initial horizontal speed
self.update = function () {
self.x += self.speedX;
self.y += self.speedY;
// Bounce off the left and right walls
if (self.x <= 0 || self.x >= 2048) {
self.speedX *= -1;
self.speedX *= 1.25; // Increase speed by 25% when bouncing off the side walls
}
// Bounce off the top wall
if (self.y <= 0) {
self.speedY *= -1;
self.speedY *= 1.25; // Increase speed by 25% when bouncing off the top wall
}
// Bounce off the platform
if (self.y >= platform.y - platform.height / 2 && self.y <= platform.y + platform.height / 2 && self.x >= platform.x - platform.width / 2 && self.x <= platform.x + platform.width / 2) {
self.speedY *= -1;
self.speedY *= 1.45; // Increase speed by 45% when bouncing off the platform
self.speedX *= 1.45; // Increase speed by 45% when bouncing off the platform
LK.setScore(LK.getScore() + 1);
scoreTxt.setText(LK.getScore());
}
// Game over if the ball falls below the platform
if (self.y > 2732) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
};
});
// Platform class to represent the platform
var Platform = Container.expand(function () {
var self = Container.call(this);
var platformGraphics = self.attachAsset('platform', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
// Platform movement logic can be added here if needed
};
});
/****
* Initialize Game
****/
// Initialize the game with black background
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Top ve platform şekilleri tanımlı
// Initialize the ball and platform
var ball = game.addChild(new Ball());
ball.x = 1024; // Center horizontally
ball.y = 1366; // Start above the platform
var platform = game.addChild(new Platform());
platform.x = 1024; // Center horizontally
platform.y = 2100; // Platform position near the bottom (adjusted lower)
// Initialize score display
var scoreTxt = new Text2('0', {
size: 150,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Handle game updates
game.update = function () {
ball.update();
platform.update();
};
// Handle touch/mouse movement to control the platform
game.move = function (x, y, obj) {
platform.x = x;
};