User prompt
kuleler yere değsin
User prompt
kuleler arası mesafeyi 1/3 azalt
User prompt
çok yakın oldu uzaklaştır şuankinden 50 kat uzak olsun
User prompt
kuleler arası mesafeyi yaklaştır
User prompt
2. uçak çook arkada olsun
User prompt
oyun ve bulut hızı 100 olsun
User prompt
oyun ve bulut hızı 50x olsun
User prompt
oyun hızı ve bulut hızı 100x olsun
User prompt
ama 1. uçak kuleye çarpınca oyun bitmemeli 2 uçak ta ayrı ayrı kontrol edilmeli yani 1. uçak kuleye çarpınca 2. uçak devam etmeli ve o da kuleye çarpınca oyun bitmeli
User prompt
2. daha yukardan uçsun
User prompt
oyunda 2 canımız olsun 1. uçak kuleye çarpınca 1 canımız kalsın 2. uçak ta çarpınca game over olsun
User prompt
1. uçak yanınca oyun bitmesin 2. uçak ile devam edelim
User prompt
daha da geride olsun 2. uçak
User prompt
2. uçak biraz daha geride olsun ve 1. yanınca 2. yi kontrol edelim
User prompt
havada bizim uçağın arkasından gelen bir uçak daha olsun ve 1. uçak yandıktan sonra 2. uçağı kontrol edelim
User prompt
oyun başlar başlamaz kule olmasın
User prompt
oyunda sınırsız kule olsun ve aralarındaki mesafe şuankinden 5x katı olsun
User prompt
kuller arası mesafe 2x olsun
User prompt
bulutlar daha hızlı hareket etsin toplam hızları 50 olsun
Code edit (1 edits merged)
Please save this source code
User prompt
oyun 1,5x hızlansın
User prompt
yarısı kadar mesafe olsun
User prompt
10x daha aralık olsun
User prompt
kuleler arası mesafe şuankinin 1/3 ü kadar olsun
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Airplane = Container.expand(function () { var self = Container.call(this); var airplaneGraphics = self.attachAsset('airplane', { anchorX: 0.5, anchorY: 0.5 }); self.velocityY = 0; self.gravity = 0.5; self.jumpPower = -35; self.speed = 4; self.lastY = 0; self.lastIntersecting1 = false; self.lastIntersecting2 = false; self.jump = function () { if (!isPressed) { self.velocityY = self.jumpPower; LK.getSound('engine').play(); } isPressed = true; }; self.update = function () { self.lastY = self.y; // Apply gravity only when not continuously pressed if (!isPressed) { self.velocityY += self.gravity; } else { // Fly straight when continuously pressed self.velocityY = 0; } self.y += self.velocityY; // Keep airplane level at all times airplaneGraphics.rotation = 0; // Keep airplane within bounds - only lower bound if (self.y > 2600) { self.y = 2600; self.velocityY = 0; } }; return self; }); var Tower = Container.expand(function () { var self = Container.call(this); var towerGraphics = self.attachAsset('tower', { anchorX: 0.5, anchorY: 1.0 }); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ // Create a simple blue background game.setBackgroundColor(0x4169E1); // Add ground var ground = game.addChild(LK.getAsset('ground', { anchorX: 0.5, anchorY: 1.0 })); ground.x = 1024; ground.y = 2732; // Add sun var sun = game.addChild(LK.getAsset('sun', { anchorX: 0.5, anchorY: 0.5 })); sun.x = 1800; sun.y = 200; var scoreTxt = new Text2('Score: 0', { size: 60, fill: 0x000000 }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var airplane = game.addChild(new Airplane()); airplane.x = 200; airplane.y = 1366; var tower1 = game.addChild(new Tower()); tower1.x = -1000; // Start towers off-screen tower1.y = 2732; var tower2 = game.addChild(new Tower()); tower2.x = -1000; // Start towers off-screen tower2.y = 2732; var score = 0; var gameSpeed = 15; var isPressed = false; var touchX = 0; var touchY = 0; var isTouching = false; var clouds = []; // Create clouds in the sky for (var i = 0; i < 4; i++) { var cloud = game.addChild(LK.getAsset('cloud', { anchorX: 0.5, anchorY: 0.5 })); cloud.x = Math.random() * 3000 + 500; cloud.y = Math.random() * 800 + 200; cloud.alpha = 0.7; cloud.speed = Math.random() * 2 + 1; clouds.push(cloud); } var joystickCenter = { x: 300, y: 2400 }; // Add joystick visual elements var joystickBase = game.addChild(LK.getAsset('joystick_base', { anchorX: 0.5, anchorY: 0.5 })); joystickBase.x = joystickCenter.x; joystickBase.y = joystickCenter.y; joystickBase.alpha = 0.6; var joystickKnob = game.addChild(LK.getAsset('joystick_knob', { anchorX: 0.5, anchorY: 0.5 })); joystickKnob.x = joystickCenter.x; joystickKnob.y = joystickCenter.y; joystickKnob.alpha = 0.8; function updateScore() { scoreTxt.setText('Score: ' + score); } function checkCollisions() { // More precise collision detection - check if airplane nose penetrates tower // Calculate airplane nose position (front edge) var airplaneNoseX = airplane.x + 200; // Airplane nose is about 200px from center var airplaneLeftWing = airplane.x - 200; // Left wing edge var airplaneRightWing = airplane.x + 200; // Right wing edge var airplaneTop = airplane.y - 125; // Top of airplane var airplaneBottom = airplane.y + 125; // Bottom of airplane // Check tower1 collision - more precise detection var tower1Left = tower1.x - 50; // Tower width consideration var tower1Right = tower1.x + 50; var tower1Top = tower1.y - 1500; // Tower height var tower1Bottom = tower1.y; var currentIntersecting1 = airplaneNoseX >= tower1Left && airplaneLeftWing <= tower1Right && airplaneBottom >= tower1Top && airplaneTop <= tower1Bottom; // Check tower2 collision - more precise detection var tower2Left = tower2.x - 50; // Tower width consideration var tower2Right = tower2.x + 50; var tower2Top = tower2.y - 1500; // Tower height var tower2Bottom = tower2.y; var currentIntersecting2 = airplaneNoseX >= tower2Left && airplaneLeftWing <= tower2Right && airplaneBottom >= tower2Top && airplaneTop <= tower2Bottom; if (!airplane.lastIntersecting1 && currentIntersecting1 || !airplane.lastIntersecting2 && currentIntersecting2) { // Just hit a tower - create bomb explosion effect LK.getSound('crash').play(); // Flash the airplane red for explosion effect LK.effects.flashObject(airplane, 0xff0000, 500); // Create multiple explosion circles for bomb effect at airplane position var explosionCircles = []; for (var i = 0; i < 12; i++) { var circle = game.addChild(LK.getAsset('explosion_circle', { anchorX: 0.5, anchorY: 0.5 })); circle.x = airplane.x + (Math.random() - 0.5) * 300; circle.y = airplane.y + (Math.random() - 0.5) * 300; circle.alpha = 0.8; circle.tint = i % 2 === 0 ? 0xff4500 : 0xffa500; // Alternate between orange and yellow explosionCircles.push(circle); // Animate each circle expanding and fading tween(circle, { scaleX: 8 + Math.random() * 4, scaleY: 8 + Math.random() * 4, alpha: 0 }, { duration: 400 + Math.random() * 200, easing: tween.easeOut, onFinish: function onFinish() { circle.destroy(); } }); } // Screen shake effect using tween tween(game, { x: 10 }, { duration: 50, onFinish: function onFinish() { tween(game, { x: -10 }, { duration: 50, onFinish: function onFinish() { tween(game, { x: 5 }, { duration: 50, onFinish: function onFinish() { tween(game, { x: 0 }, { duration: 50, onFinish: function onFinish() { // Show game over after explosion effects complete LK.showGameOver(); } }); } }); } }); } }); } airplane.lastIntersecting1 = currentIntersecting1; airplane.lastIntersecting2 = currentIntersecting2; // Check if airplane passed towers for scoring if (airplane.lastX < tower1.x && airplane.x >= tower1.x) { score += 10; updateScore(); } if (airplane.lastX < tower2.x && airplane.x >= tower2.x) { score += 10; updateScore(); } } game.down = function (x, y, obj) { // Only respond to touches in the joystick area var distanceFromJoystick = Math.sqrt((x - joystickCenter.x) * (x - joystickCenter.x) + (y - joystickCenter.y) * (y - joystickCenter.y)); if (distanceFromJoystick <= 150) { touchX = x; touchY = y; isTouching = true; airplane.jump(); } }; game.move = function (x, y, obj) { if (isTouching) { touchX = x; touchY = y; } }; game.up = function (x, y, obj) { isPressed = false; isTouching = false; }; game.update = function () { airplane.lastX = airplane.x; // Initialize towers after some delay (when airplane moves forward) if (LK.ticks > 180) { // 3 seconds delay (60 FPS * 3) if (tower1.x < 0) { tower1.x = 2200; } if (tower2.x < 0) { tower2.x = 8533; // 1/3 of 25600 spacing between towers } } // Move towers left for side-scrolling effect if (tower1.x > 0) { tower1.x -= gameSpeed; } if (tower2.x > 0) { tower2.x -= gameSpeed; } // Reset tower positions when they go off-screen if (tower1.x < -100) { tower1.x = 8533; // 1/3 of previous spacing } if (tower2.x < -100) { tower2.x = 17066; // Maintain 1/3 spacing (8533 * 2) } checkCollisions(); // Move clouds slowly across the sky for (var i = 0; i < clouds.length; i++) { clouds[i].x -= clouds[i].speed; // Reset cloud position when it goes off-screen if (clouds[i].x < -200) { clouds[i].x = 2300; clouds[i].y = Math.random() * 800 + 200; } } // Joystick control - move airplane vertically only if (isTouching) { var deltaY = touchY - joystickCenter.y; // Limit joystick knob movement vertically only var maxRange = 100; if (deltaY > maxRange) { deltaY = maxRange; } else if (deltaY < -maxRange) { deltaY = -maxRange; } // Update joystick knob position - vertical movement only joystickKnob.x = joystickCenter.x; joystickKnob.y = joystickCenter.y + deltaY; // Move airplane vertically based on joystick input var moveScale = 4; var targetY = 1366 - deltaY * moveScale; // Inverted Y-axis // Keep airplane within screen bounds vertically airplane.y = Math.max(-500, Math.min(2632, targetY)); } else { // Reset joystick knob to center when not touching joystickKnob.x = joystickCenter.x; joystickKnob.y = joystickCenter.y; } // Keep airplane centered horizontally at all times airplane.x = 1024; // Win condition if (score >= 100) { LK.showYouWin(); } };
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Airplane = Container.expand(function () {
var self = Container.call(this);
var airplaneGraphics = self.attachAsset('airplane', {
anchorX: 0.5,
anchorY: 0.5
});
self.velocityY = 0;
self.gravity = 0.5;
self.jumpPower = -35;
self.speed = 4;
self.lastY = 0;
self.lastIntersecting1 = false;
self.lastIntersecting2 = false;
self.jump = function () {
if (!isPressed) {
self.velocityY = self.jumpPower;
LK.getSound('engine').play();
}
isPressed = true;
};
self.update = function () {
self.lastY = self.y;
// Apply gravity only when not continuously pressed
if (!isPressed) {
self.velocityY += self.gravity;
} else {
// Fly straight when continuously pressed
self.velocityY = 0;
}
self.y += self.velocityY;
// Keep airplane level at all times
airplaneGraphics.rotation = 0;
// Keep airplane within bounds - only lower bound
if (self.y > 2600) {
self.y = 2600;
self.velocityY = 0;
}
};
return self;
});
var Tower = Container.expand(function () {
var self = Container.call(this);
var towerGraphics = self.attachAsset('tower', {
anchorX: 0.5,
anchorY: 1.0
});
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
// Create a simple blue background
game.setBackgroundColor(0x4169E1);
// Add ground
var ground = game.addChild(LK.getAsset('ground', {
anchorX: 0.5,
anchorY: 1.0
}));
ground.x = 1024;
ground.y = 2732;
// Add sun
var sun = game.addChild(LK.getAsset('sun', {
anchorX: 0.5,
anchorY: 0.5
}));
sun.x = 1800;
sun.y = 200;
var scoreTxt = new Text2('Score: 0', {
size: 60,
fill: 0x000000
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var airplane = game.addChild(new Airplane());
airplane.x = 200;
airplane.y = 1366;
var tower1 = game.addChild(new Tower());
tower1.x = -1000; // Start towers off-screen
tower1.y = 2732;
var tower2 = game.addChild(new Tower());
tower2.x = -1000; // Start towers off-screen
tower2.y = 2732;
var score = 0;
var gameSpeed = 15;
var isPressed = false;
var touchX = 0;
var touchY = 0;
var isTouching = false;
var clouds = [];
// Create clouds in the sky
for (var i = 0; i < 4; i++) {
var cloud = game.addChild(LK.getAsset('cloud', {
anchorX: 0.5,
anchorY: 0.5
}));
cloud.x = Math.random() * 3000 + 500;
cloud.y = Math.random() * 800 + 200;
cloud.alpha = 0.7;
cloud.speed = Math.random() * 2 + 1;
clouds.push(cloud);
}
var joystickCenter = {
x: 300,
y: 2400
};
// Add joystick visual elements
var joystickBase = game.addChild(LK.getAsset('joystick_base', {
anchorX: 0.5,
anchorY: 0.5
}));
joystickBase.x = joystickCenter.x;
joystickBase.y = joystickCenter.y;
joystickBase.alpha = 0.6;
var joystickKnob = game.addChild(LK.getAsset('joystick_knob', {
anchorX: 0.5,
anchorY: 0.5
}));
joystickKnob.x = joystickCenter.x;
joystickKnob.y = joystickCenter.y;
joystickKnob.alpha = 0.8;
function updateScore() {
scoreTxt.setText('Score: ' + score);
}
function checkCollisions() {
// More precise collision detection - check if airplane nose penetrates tower
// Calculate airplane nose position (front edge)
var airplaneNoseX = airplane.x + 200; // Airplane nose is about 200px from center
var airplaneLeftWing = airplane.x - 200; // Left wing edge
var airplaneRightWing = airplane.x + 200; // Right wing edge
var airplaneTop = airplane.y - 125; // Top of airplane
var airplaneBottom = airplane.y + 125; // Bottom of airplane
// Check tower1 collision - more precise detection
var tower1Left = tower1.x - 50; // Tower width consideration
var tower1Right = tower1.x + 50;
var tower1Top = tower1.y - 1500; // Tower height
var tower1Bottom = tower1.y;
var currentIntersecting1 = airplaneNoseX >= tower1Left && airplaneLeftWing <= tower1Right && airplaneBottom >= tower1Top && airplaneTop <= tower1Bottom;
// Check tower2 collision - more precise detection
var tower2Left = tower2.x - 50; // Tower width consideration
var tower2Right = tower2.x + 50;
var tower2Top = tower2.y - 1500; // Tower height
var tower2Bottom = tower2.y;
var currentIntersecting2 = airplaneNoseX >= tower2Left && airplaneLeftWing <= tower2Right && airplaneBottom >= tower2Top && airplaneTop <= tower2Bottom;
if (!airplane.lastIntersecting1 && currentIntersecting1 || !airplane.lastIntersecting2 && currentIntersecting2) {
// Just hit a tower - create bomb explosion effect
LK.getSound('crash').play();
// Flash the airplane red for explosion effect
LK.effects.flashObject(airplane, 0xff0000, 500);
// Create multiple explosion circles for bomb effect at airplane position
var explosionCircles = [];
for (var i = 0; i < 12; i++) {
var circle = game.addChild(LK.getAsset('explosion_circle', {
anchorX: 0.5,
anchorY: 0.5
}));
circle.x = airplane.x + (Math.random() - 0.5) * 300;
circle.y = airplane.y + (Math.random() - 0.5) * 300;
circle.alpha = 0.8;
circle.tint = i % 2 === 0 ? 0xff4500 : 0xffa500; // Alternate between orange and yellow
explosionCircles.push(circle);
// Animate each circle expanding and fading
tween(circle, {
scaleX: 8 + Math.random() * 4,
scaleY: 8 + Math.random() * 4,
alpha: 0
}, {
duration: 400 + Math.random() * 200,
easing: tween.easeOut,
onFinish: function onFinish() {
circle.destroy();
}
});
}
// Screen shake effect using tween
tween(game, {
x: 10
}, {
duration: 50,
onFinish: function onFinish() {
tween(game, {
x: -10
}, {
duration: 50,
onFinish: function onFinish() {
tween(game, {
x: 5
}, {
duration: 50,
onFinish: function onFinish() {
tween(game, {
x: 0
}, {
duration: 50,
onFinish: function onFinish() {
// Show game over after explosion effects complete
LK.showGameOver();
}
});
}
});
}
});
}
});
}
airplane.lastIntersecting1 = currentIntersecting1;
airplane.lastIntersecting2 = currentIntersecting2;
// Check if airplane passed towers for scoring
if (airplane.lastX < tower1.x && airplane.x >= tower1.x) {
score += 10;
updateScore();
}
if (airplane.lastX < tower2.x && airplane.x >= tower2.x) {
score += 10;
updateScore();
}
}
game.down = function (x, y, obj) {
// Only respond to touches in the joystick area
var distanceFromJoystick = Math.sqrt((x - joystickCenter.x) * (x - joystickCenter.x) + (y - joystickCenter.y) * (y - joystickCenter.y));
if (distanceFromJoystick <= 150) {
touchX = x;
touchY = y;
isTouching = true;
airplane.jump();
}
};
game.move = function (x, y, obj) {
if (isTouching) {
touchX = x;
touchY = y;
}
};
game.up = function (x, y, obj) {
isPressed = false;
isTouching = false;
};
game.update = function () {
airplane.lastX = airplane.x;
// Initialize towers after some delay (when airplane moves forward)
if (LK.ticks > 180) {
// 3 seconds delay (60 FPS * 3)
if (tower1.x < 0) {
tower1.x = 2200;
}
if (tower2.x < 0) {
tower2.x = 8533; // 1/3 of 25600 spacing between towers
}
}
// Move towers left for side-scrolling effect
if (tower1.x > 0) {
tower1.x -= gameSpeed;
}
if (tower2.x > 0) {
tower2.x -= gameSpeed;
}
// Reset tower positions when they go off-screen
if (tower1.x < -100) {
tower1.x = 8533; // 1/3 of previous spacing
}
if (tower2.x < -100) {
tower2.x = 17066; // Maintain 1/3 spacing (8533 * 2)
}
checkCollisions();
// Move clouds slowly across the sky
for (var i = 0; i < clouds.length; i++) {
clouds[i].x -= clouds[i].speed;
// Reset cloud position when it goes off-screen
if (clouds[i].x < -200) {
clouds[i].x = 2300;
clouds[i].y = Math.random() * 800 + 200;
}
}
// Joystick control - move airplane vertically only
if (isTouching) {
var deltaY = touchY - joystickCenter.y;
// Limit joystick knob movement vertically only
var maxRange = 100;
if (deltaY > maxRange) {
deltaY = maxRange;
} else if (deltaY < -maxRange) {
deltaY = -maxRange;
}
// Update joystick knob position - vertical movement only
joystickKnob.x = joystickCenter.x;
joystickKnob.y = joystickCenter.y + deltaY;
// Move airplane vertically based on joystick input
var moveScale = 4;
var targetY = 1366 - deltaY * moveScale; // Inverted Y-axis
// Keep airplane within screen bounds vertically
airplane.y = Math.max(-500, Math.min(2632, targetY));
} else {
// Reset joystick knob to center when not touching
joystickKnob.x = joystickCenter.x;
joystickKnob.y = joystickCenter.y;
}
// Keep airplane centered horizontally at all times
airplane.x = 1024;
// Win condition
if (score >= 100) {
LK.showYouWin();
}
};
Plane. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
İkiz kule . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
yuvarlak ve gerçekçi güneş
gerçekçi patlama biraz ateş biraz duman. In-Game asset. 2d. High contrast. No shadows
bulut. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat