User prompt
kule imlecin gittiği yöne dönsün. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
zombie çeşidi 6 olsun.
User prompt
alev oku isabet edince duman ve alev patlaması olsun. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
alev oku isabetlerinde patlama sesi olsun.
User prompt
ekrana dokunmadan ateş etmesin.
User prompt
üzerine dokunduğumuz düşmana ateş etsin .
User prompt
silahımızı ortadaki kuleye yerleştir.
User prompt
mermi hızını artır 3 kat
User prompt
kule ateşetsin
User prompt
silah menzilini 10 kat artır.
User prompt
kule silah menzilimizi 10 kat artır.
User prompt
Ekranda dokunduğumuz yere doğru silah kulemizden mermi atılsın..
User prompt
silahımız gelen zombilere, ekranda dokunduğumuz yere ateş etsin.
User prompt
6 tür zombi gelsin.
User prompt
Zombiler 6 çeşit olsun.
User prompt
100 bölüm oyun olsun.Her bölüm 5 dalga olsun .Her bölümde düşmanlarımız değişsin.
User prompt
silahımız dokunduğumuz düşmana dönsün. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
zoom iptal et
User prompt
Düşman kulemize yaklaştıkça silahımızın gücü artsın.
User prompt
silah kulemiz gelen düşmanlara dokundukça ateş etsin.
User prompt
uzaktan üzerimize gelen zombiler olsun.
User prompt
düşmanlar ekranın üstünden yürüyerek gelsin. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
karşımızda düşman olsun.Ekranın ortasından uzaklardan çıkarak silah kulemize doğru gelsin. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
silahımızın artı şeklinde hareket eden bir artıkıl ı olsun. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
zoom kaldır
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.attachAsset('enemy', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 2;
self.isAlive = true;
self.lastY = 0;
self.startWalking = function () {
// Start from top of screen
self.y = -60;
self.x = Math.random() * 1848 + 100; // Random x position avoiding edges
// Animate walking down the screen
tween(self, {
y: 2800
}, {
duration: 8000 + Math.random() * 4000,
// 8-12 seconds to cross screen
easing: tween.linear,
onFinish: function onFinish() {
if (self.parent) {
self.destroy();
}
}
});
};
self.update = function () {
if (!self.isAlive) return;
// Track last Y position for collision detection
self.lastY = self.y;
};
self.hit = function () {
if (!self.isAlive) return;
self.isAlive = false;
tween.stop(self, {
y: true
}); // Stop walking animation
// Flash red and fade out
tween(self, {
tint: 0xff0000,
alpha: 0
}, {
duration: 500,
easing: tween.easeOut,
onFinish: function onFinish() {
if (self.parent) {
self.destroy();
}
}
});
// Increase score
LK.setScore(LK.getScore() + 10);
};
return self;
});
/****
* Initialize Game
****/
// Create background
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Create background
var background = game.attachAsset('background', {
x: 0,
y: 0
});
// Create scope overlay
var scope = game.attachAsset('scope', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366,
scaleX: 15,
scaleY: 15,
alpha: 0.3
});
// Create crosshair
var crosshair = game.attachAsset('crosshair', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366,
scaleX: 0.5,
scaleY: 0.5
});
// Score display
var scoreTxt = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Enemy management
var enemies = [];
var enemySpawnTimer = 0;
// Spawn enemies from top
function spawnEnemy() {
var enemy = new Enemy();
enemies.push(enemy);
game.addChild(enemy);
enemy.startWalking();
}
// Mouse/touch controls for aiming
game.move = function (x, y, obj) {
crosshair.x = x;
crosshair.y = y;
};
// Shooting mechanics
game.down = function (x, y, obj) {
// Check if we hit any enemy
for (var i = enemies.length - 1; i >= 0; i--) {
var enemy = enemies[i];
if (enemy.isAlive && enemy.intersects(crosshair)) {
enemy.hit();
enemies.splice(i, 1);
// Show hit marker
var hitMarker = game.attachAsset('hitMarker', {
anchorX: 0.5,
anchorY: 0.5,
x: enemy.x,
y: enemy.y
});
// Animate hit marker
tween(hitMarker, {
scaleX: 3,
scaleY: 3,
alpha: 0
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
if (hitMarker.parent) {
hitMarker.destroy();
}
}
});
break;
}
}
// Update score display
scoreTxt.setText('Score: ' + LK.getScore());
};
// Game update loop
game.update = function () {
// Spawn enemies periodically
enemySpawnTimer++;
if (enemySpawnTimer >= 120) {
// Every 2 seconds at 60fps
spawnEnemy();
enemySpawnTimer = 0;
}
// Clean up destroyed enemies
for (var i = enemies.length - 1; i >= 0; i--) {
var enemy = enemies[i];
if (!enemy.parent) {
enemies.splice(i, 1);
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -9,205 +9,166 @@
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.attachAsset('enemy', {
anchorX: 0.5,
- anchorY: 1.0
+ anchorY: 0.5
});
+ self.speed = 2;
self.isAlive = true;
- self.lastX = 0;
self.lastY = 0;
- self.moveTowardsCenter = function () {
- if (!self.isAlive) return;
- var centerX = 2048 / 2;
- var centerY = 2732 / 2;
- var duration = 8000 + Math.random() * 4000; // 8-12 seconds
+ self.startWalking = function () {
+ // Start from top of screen
+ self.y = -60;
+ self.x = Math.random() * 1848 + 100; // Random x position avoiding edges
+ // Animate walking down the screen
tween(self, {
- x: centerX,
- y: centerY
+ y: 2800
}, {
- duration: duration,
+ duration: 8000 + Math.random() * 4000,
+ // 8-12 seconds to cross screen
easing: tween.linear,
onFinish: function onFinish() {
- if (self.isAlive) {
- // Enemy reached the center - game over
- LK.showGameOver();
+ if (self.parent) {
+ self.destroy();
}
}
});
};
- self.die = function () {
+ self.update = function () {
if (!self.isAlive) return;
+ // Track last Y position for collision detection
+ self.lastY = self.y;
+ };
+ self.hit = function () {
+ if (!self.isAlive) return;
self.isAlive = false;
tween.stop(self, {
- x: true,
y: true
- });
- // Create hit marker
- var hitMarker = LK.getAsset('hitMarker', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: self.x,
- y: self.y - 60
- });
- game.addChild(hitMarker);
- // Fade out hit marker
- tween(hitMarker, {
+ }); // Stop walking animation
+ // Flash red and fade out
+ tween(self, {
+ tint: 0xff0000,
alpha: 0
}, {
- duration: 1000,
+ duration: 500,
+ easing: tween.easeOut,
onFinish: function onFinish() {
- hitMarker.destroy();
+ if (self.parent) {
+ self.destroy();
+ }
}
});
- // Remove enemy
- self.destroy();
+ // Increase score
+ LK.setScore(LK.getScore() + 10);
};
return self;
});
-var SniperScope = Container.expand(function () {
- var self = Container.call(this);
- var scopeGraphics = self.attachAsset('scope', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- var crosshair = self.attachAsset('crosshair', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.zoomLevel = 1;
- self.maxZoom = 3;
- self.minZoom = 0.5;
- self.zoom = function (direction) {
- var newZoom = self.zoomLevel + direction * 0.5;
- newZoom = Math.max(self.minZoom, Math.min(self.maxZoom, newZoom));
- if (newZoom !== self.zoomLevel) {
- self.zoomLevel = newZoom;
- tween(self, {
- scaleX: self.zoomLevel,
- scaleY: self.zoomLevel
- }, {
- duration: 300,
- easing: tween.easeOut
- });
- }
- };
- return self;
-});
/****
* Initialize Game
****/
-// Create battlefield background
+// Create background
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
-// Create battlefield background
-var background = game.addChild(LK.getAsset('background', {
+// Create background
+var background = game.attachAsset('background', {
+ x: 0,
+ y: 0
+});
+// Create scope overlay
+var scope = game.attachAsset('scope', {
anchorX: 0.5,
anchorY: 0.5,
- x: 2048 / 2,
- y: 2732 / 2
-}));
-// Create sniper scope
-var scope = game.addChild(new SniperScope());
-scope.x = 2048 / 2;
-scope.y = 2732 / 2;
-// Enemy management
-var enemies = [];
-var enemySpawnTimer = 0;
-var enemySpawnInterval = 3000; // Spawn every 3 seconds
+ x: 1024,
+ y: 1366,
+ scaleX: 15,
+ scaleY: 15,
+ alpha: 0.3
+});
+// Create crosshair
+var crosshair = game.attachAsset('crosshair', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1366,
+ scaleX: 0.5,
+ scaleY: 0.5
+});
// Score display
var scoreTxt = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
-// Zoom controls text
-var zoomTxt = new Text2('Tap to zoom in/out', {
- size: 60,
- fill: 0xFFFFFF
-});
-zoomTxt.anchor.set(0.5, 1);
-LK.gui.bottom.addChild(zoomTxt);
+// Enemy management
+var enemies = [];
+var enemySpawnTimer = 0;
+// Spawn enemies from top
function spawnEnemy() {
var enemy = new Enemy();
- // Spawn from random edge of screen, far from center
- var spawnSide = Math.floor(Math.random() * 4);
- var centerX = 2048 / 2;
- var centerY = 2732 / 2;
- switch (spawnSide) {
- case 0:
- // Top
- enemy.x = Math.random() * 2048;
- enemy.y = 0;
- break;
- case 1:
- // Right
- enemy.x = 2048;
- enemy.y = Math.random() * 2732;
- break;
- case 2:
- // Bottom
- enemy.x = Math.random() * 2048;
- enemy.y = 2732;
- break;
- case 3:
- // Left
- enemy.x = 0;
- enemy.y = Math.random() * 2732;
- break;
- }
- enemy.lastX = enemy.x;
- enemy.lastY = enemy.y;
- game.addChild(enemy);
enemies.push(enemy);
- // Start moving towards center
- enemy.moveTowardsCenter();
+ game.addChild(enemy);
+ enemy.startWalking();
}
-// Touch controls
+// Mouse/touch controls for aiming
+game.move = function (x, y, obj) {
+ crosshair.x = x;
+ crosshair.y = y;
+};
+// Shooting mechanics
game.down = function (x, y, obj) {
- // Check if we hit an enemy
+ // Check if we hit any enemy
for (var i = enemies.length - 1; i >= 0; i--) {
var enemy = enemies[i];
- if (enemy.isAlive) {
- var distance = Math.sqrt(Math.pow(x - enemy.x, 2) + Math.pow(y - enemy.y, 2));
- if (distance < 50) {
- // Hit radius
- enemy.die();
- enemies.splice(i, 1);
- LK.setScore(LK.getScore() + 10);
- scoreTxt.setText('Score: ' + LK.getScore());
- return;
- }
+ if (enemy.isAlive && enemy.intersects(crosshair)) {
+ enemy.hit();
+ enemies.splice(i, 1);
+ // Show hit marker
+ var hitMarker = game.attachAsset('hitMarker', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: enemy.x,
+ y: enemy.y
+ });
+ // Animate hit marker
+ tween(hitMarker, {
+ scaleX: 3,
+ scaleY: 3,
+ alpha: 0
+ }, {
+ duration: 300,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ if (hitMarker.parent) {
+ hitMarker.destroy();
+ }
+ }
+ });
+ break;
}
}
- // If no enemy hit, zoom in
- scope.zoom(1);
+ // Update score display
+ scoreTxt.setText('Score: ' + LK.getScore());
};
-game.up = function (x, y, obj) {
- // Zoom out on release
- scope.zoom(-1);
-};
+// Game update loop
game.update = function () {
// Spawn enemies periodically
- enemySpawnTimer += 16; // Approximately 60 FPS
- if (enemySpawnTimer >= enemySpawnInterval) {
+ enemySpawnTimer++;
+ if (enemySpawnTimer >= 120) {
+ // Every 2 seconds at 60fps
spawnEnemy();
enemySpawnTimer = 0;
- // Gradually increase spawn rate
- if (enemySpawnInterval > 1000) {
- enemySpawnInterval -= 50;
- }
}
// Clean up destroyed enemies
for (var i = enemies.length - 1; i >= 0; i--) {
var enemy = enemies[i];
- if (!enemy.isAlive || !enemy.parent) {
+ if (!enemy.parent) {
enemies.splice(i, 1);
}
}
};
\ No newline at end of file
hareketli silah. In-Game asset. 2d. High contrast. No shadows
duman. In-Game asset. 2d. High contrast. No shadows
zombie. In-Game asset. 2d. High contrast. No shadows
dinazor. In-Game asset. 2d. High contrast. No shadows
kuş bakışı silahlı kule.. In-Game asset. 2d. High contrast. No shadows
dairesel mevzi.. In-Game asset. 2d. High contrast. No shadows
roket namlusu kuş bakışı ,üstten görünüm.. In-Game asset. 2d. High contrast. No shadows
patlama efekti alev duman. In-Game asset. 2d. High contrast. No shadows