User prompt
elmalar daha fazla düşsün
User prompt
elmalar dağa hızlı düşsün her 10 skor arttığında dahada hızlı düşsün
User prompt
agacı arka plan yap
User prompt
elmayı tutamassak ölelim
User prompt
her 20 skor arttığında elma düşme hızı artsın
User prompt
elmalar hızlı düşsün
User prompt
sepet fareyi takip etsin
User prompt
1 sepet olsun
User prompt
sepet fareyi takip etmesin
User prompt
sepet fareyi takip etsin
User prompt
farem hareket ederken sepette görüntü bozukluğu olmasın
Initial prompt
Apple Picking
===================================================================
--- original.js
+++ change.js
@@ -1,85 +1,85 @@
-/****
+/****
* Classes
-****/
+****/
//<Assets used in the game will automatically appear here>
//<Write imports for supported plugins here>
// Apple class representing falling apples
var Apple = Container.expand(function () {
- var self = Container.call(this);
- var appleGraphics = self.attachAsset('apple', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speed = 5; // Speed at which the apple falls
- self.update = function () {
- self.y += self.speed;
- };
+ var self = Container.call(this);
+ var appleGraphics = self.attachAsset('apple', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 5; // Speed at which the apple falls
+ self.update = function () {
+ self.y += self.speed;
+ };
});
// Basket class representing the player's basket
var Basket = Container.expand(function () {
- var self = Container.call(this);
- var basketGraphics = self.attachAsset('basket', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.move = function (x) {
- self.x = x;
- };
+ var self = Container.call(this);
+ var basketGraphics = self.attachAsset('basket', {
+ anchorX: 0.5,
+ anchorY: 1.0
+ });
+ self.move = function (x) {
+ self.x = x;
+ };
});
-/****
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000 //Init game with black background
+ backgroundColor: 0x000000 //Init game with black background
});
-/****
+/****
* Game Code
-****/
+****/
var apples = [];
var basket;
var score = 0;
var scoreTxt;
// Initialize game elements
function initGame() {
- basket = game.addChild(new Basket());
- basket.x = 2048 / 2;
- basket.y = 2500; // Position basket near the bottom of the screen
- scoreTxt = new Text2('Score: 0', {
- size: 100,
- fill: 0xFFFFFF
- });
- scoreTxt.anchor.set(0.5, 0);
- LK.gui.top.addChild(scoreTxt);
+ basket = game.addChild(new Basket());
+ basket.x = 2048 / 2;
+ basket.y = 2500; // Position basket near the bottom of the screen
+ scoreTxt = new Text2('Score: 0', {
+ size: 100,
+ fill: 0xFFFFFF
+ });
+ scoreTxt.anchor.set(0.5, 0);
+ LK.gui.top.addChild(scoreTxt);
}
// Handle game updates
game.update = function () {
- // Update apples
- for (var i = apples.length - 1; i >= 0; i--) {
- apples[i].update();
- if (apples[i].intersects(basket)) {
- score++;
- scoreTxt.setText('Score: ' + score);
- apples[i].destroy();
- apples.splice(i, 1);
- } else if (apples[i].y > 2732) {
- apples[i].destroy();
- apples.splice(i, 1);
- }
- }
- // Spawn new apples
- if (LK.ticks % 60 == 0) {
- var newApple = new Apple();
- newApple.x = Math.random() * 2048;
- newApple.y = 0;
- apples.push(newApple);
- game.addChild(newApple);
- }
+ // Update apples
+ for (var i = apples.length - 1; i >= 0; i--) {
+ apples[i].update();
+ if (apples[i].intersects(basket)) {
+ score++;
+ scoreTxt.setText('Score: ' + score);
+ apples[i].destroy();
+ apples.splice(i, 1);
+ } else if (apples[i].y > 2732) {
+ apples[i].destroy();
+ apples.splice(i, 1);
+ }
+ }
+ // Spawn new apples
+ if (LK.ticks % 60 == 0) {
+ var newApple = new Apple();
+ newApple.x = Math.random() * 2048;
+ newApple.y = 0;
+ apples.push(newApple);
+ game.addChild(newApple);
+ }
};
// Handle touch/mouse move events
game.move = function (x, y, obj) {
- basket.move(x);
+ basket.move(x);
};
// Initialize the game
initGame();
\ No newline at end of file