User prompt
mouse işareti yerine nişangah ekle
User prompt
tanklara ve silahlara farklı görseller atamak istiyorum tankı ve uçağı ayrı birer düşman olarak yap ki asset atayabileyim
User prompt
düşmana tanklar ve uçaklar ekle tankların canı daha çok olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
düşmanlara vurulma animasyonu ve vurulunca cıkan kan ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
askerlere daha güzel bir koşma animasyonu ekle ve mermim sınırsız olmasın adam vurdukça artsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
mermi giderken arkasından hafif bir iz bıraksın silahtan da duman çıksın ayrıca silahı büyüt ve görünür yap ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
mermiye gidiş animasyonu ekle ve ateş ettiğimde ses çıksın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
düşmanlara koşma animasyonu ekle ve kurşunların boyutunu büyüt ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
insan şeklinde yap
User prompt
Find real human designs from the web and make them in the shape of a real human being. Make real human beings.
User prompt
I want soldiers that look like real people, not square dots, and the targets should be bigger.
User prompt
The main character should be in the form of a soldier and the incoming enemies should be in the form of soldiers, the game should be faster.
Code edit (1 edits merged)
Please save this source code
User prompt
360 Defense: Last Stand
User prompt
In the game, there is a shelter and a gunman inside, and enemies come from 360 degrees around the man, and the aim of the game is to kill them.
User prompt
Please continue polishing my design document.
User prompt
In the game, there is a shelter and a gunman inside, and enemies come from 360 degrees around the man, and the aim of the game is to kill them.
Initial prompt
ı want to create a new game
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Bullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('bullet', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5 }); self.speed = 20; self.directionX = 0; self.directionY = 0; self.trailParticles = []; self.startAnimation = function () { // Add bullet trail effect with scale animation tween(bulletGraphics, { scaleX: 1.8, scaleY: 1.8 }, { duration: 100, easing: tween.easeOut, onFinish: function onFinish() { tween(bulletGraphics, { scaleX: 1.5, scaleY: 1.5 }, { duration: 100, easing: tween.easeIn }); } }); // Add rotation animation for bullet spin tween(bulletGraphics, { rotation: Math.PI * 4 }, { duration: 1000, easing: tween.linear }); }; self.update = function () { self.x += self.directionX * self.speed; self.y += self.directionY * self.speed; // Create trail particles every few frames if (LK.ticks % 3 === 0) { var trailParticle = LK.getAsset('bullet', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.8, scaleY: 0.8, x: self.x, y: self.y }); trailParticle.alpha = 0.6; trailParticle.tint = 0xFFAA00; self.parent.addChild(trailParticle); self.trailParticles.push(trailParticle); // Fade out and remove trail particle tween(trailParticle, { alpha: 0, scaleX: 0.3, scaleY: 0.3 }, { duration: 300, easing: tween.easeOut, onFinish: function onFinish() { if (trailParticle.parent) { trailParticle.parent.removeChild(trailParticle); } } }); } }; return self; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5, scaleX: 2.0, scaleY: 2.0 }); self.speed = 2.5; self.directionX = 0; self.directionY = 0; self.health = 1; self.update = function () { self.x += self.directionX * self.speed; self.y += self.directionY * self.speed; // Running animation - create bobbing effect if (!self.animationStarted) { self.animationStarted = true; self.startAnimation(); } }; self.startAnimation = function () { // Create continuous running animation with scale and slight rotation var animationDuration = 300; var scaleVariation = 0.1; // Animate scale for running effect tween(enemyGraphics, { scaleX: 2.0 + scaleVariation, scaleY: 2.0 - scaleVariation }, { duration: animationDuration, easing: tween.easeInOut, onFinish: function onFinish() { tween(enemyGraphics, { scaleX: 2.0 - scaleVariation, scaleY: 2.0 + scaleVariation }, { duration: animationDuration, easing: tween.easeInOut, onFinish: function onFinish() { if (self.parent) { self.startAnimation(); // Loop the animation } } }); } }); // Add slight rotation bobbing tween(self, { rotation: 0.1 }, { duration: animationDuration, easing: tween.easeInOut, onFinish: function onFinish() { tween(self, { rotation: -0.1 }, { duration: animationDuration, easing: tween.easeInOut, onFinish: function onFinish() { if (self.parent) { // Continue rotation loop tween(self, { rotation: 0 }, { duration: animationDuration / 2 }); } } }); } }); }; return self; }); var Gunman = Container.expand(function () { var self = Container.call(this); var gunmanGraphics = self.attachAsset('gunman', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5 }); var gun = self.attachAsset('gun', { anchorX: 0, anchorY: 0.5, x: 30, y: 0, scaleX: 2.0, scaleY: 2.0 }); gun.tint = 0x333333; self.aimAngle = 0; self.setAimDirection = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; self.aimAngle = Math.atan2(dy, dx); self.rotation = self.aimAngle; }; self.createGunSmoke = function () { var smokeParticle = LK.getAsset('bullet', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.5, scaleY: 0.5, x: gun.x + 40, y: gun.y }); smokeParticle.alpha = 0.7; smokeParticle.tint = 0x888888; self.addChild(smokeParticle); // Animate smoke dispersal tween(smokeParticle, { alpha: 0, scaleX: 1.5, scaleY: 1.5, x: smokeParticle.x + Math.cos(self.aimAngle) * 20, y: smokeParticle.y + Math.sin(self.aimAngle) * 20 }, { duration: 500, easing: tween.easeOut, onFinish: function onFinish() { if (smokeParticle.parent) { smokeParticle.parent.removeChild(smokeParticle); } } }); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x2F4F2F }); /**** * Game Code ****/ var centerX = 2048 / 2; var centerY = 2732 / 2; // Create shelter var shelter = game.addChild(LK.getAsset('shelter', { anchorX: 0.5, anchorY: 0.5, x: centerX, y: centerY })); // Create gunman var gunman = game.addChild(new Gunman()); gunman.x = centerX; gunman.y = centerY; // Game arrays var bullets = []; var enemies = []; // Game state var shelterHealth = 5; var enemySpawnTimer = 0; var enemySpawnRate = 80; // frames between spawns var waveNumber = 1; var lastShotTime = 0; var shootCooldown = 8; // frames between shots // UI elements var scoreTxt = new Text2('Score: 0', { size: 60, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var healthTxt = new Text2('Health: ' + shelterHealth, { size: 50, fill: 0xFF4444 }); healthTxt.anchor.set(0, 0); healthTxt.x = 100; healthTxt.y = 100; LK.gui.topLeft.addChild(healthTxt); var waveTxt = new Text2('Wave: 1', { size: 50, fill: 0x44FF44 }); waveTxt.anchor.set(1, 0); LK.gui.topRight.addChild(waveTxt); // Input handling var aimX = centerX + 100; var aimY = centerY; var isShooting = false; function spawnEnemy() { var enemy = new Enemy(); // Spawn from random position on perimeter var angle = Math.random() * Math.PI * 2; var spawnDistance = 1200; enemy.x = centerX + Math.cos(angle) * spawnDistance; enemy.y = centerY + Math.sin(angle) * spawnDistance; // Set direction toward shelter var dx = centerX - enemy.x; var dy = centerY - enemy.y; var distance = Math.sqrt(dx * dx + dy * dy); enemy.directionX = dx / distance; enemy.directionY = dy / distance; // Adjust speed based on wave enemy.speed = 2.5 + waveNumber * 0.3; enemies.push(enemy); game.addChild(enemy); } function shootBullet() { if (LK.ticks - lastShotTime < shootCooldown) return; var bullet = new Bullet(); bullet.x = gunman.x; bullet.y = gunman.y; bullet.directionX = Math.cos(gunman.aimAngle); bullet.directionY = Math.sin(gunman.aimAngle); bullet.startAnimation(); bullets.push(bullet); game.addChild(bullet); LK.getSound('shoot').play(); gunman.createGunSmoke(); lastShotTime = LK.ticks; } // Game input handlers game.move = function (x, y, obj) { aimX = x; aimY = y; gunman.setAimDirection(aimX, aimY); }; game.down = function (x, y, obj) { aimX = x; aimY = y; gunman.setAimDirection(aimX, aimY); isShooting = true; shootBullet(); }; game.up = function (x, y, obj) { isShooting = false; }; // Main game loop game.update = function () { // Enemy spawning enemySpawnTimer++; if (enemySpawnTimer >= enemySpawnRate) { spawnEnemy(); enemySpawnTimer = 0; // Increase difficulty over time if (enemySpawnRate > 30) { enemySpawnRate -= 1; } // Increase wave number if (LK.ticks % 600 === 0) { waveNumber++; waveTxt.setText('Wave: ' + waveNumber); } } // Continuous shooting while touching if (isShooting && LK.ticks % 6 === 0) { shootBullet(); } // Update bullets for (var i = bullets.length - 1; i >= 0; i--) { var bullet = bullets[i]; // Check if bullet is off screen if (bullet.x < -50 || bullet.x > 2098 || bullet.y < -50 || bullet.y > 2782) { bullet.destroy(); bullets.splice(i, 1); continue; } // Check bullet-enemy collisions var bulletHit = false; for (var j = enemies.length - 1; j >= 0; j--) { var enemy = enemies[j]; if (bullet.intersects(enemy)) { // Enemy hit LK.setScore(LK.getScore() + 10); scoreTxt.setText('Score: ' + LK.getScore()); LK.getSound('enemyHit').play(); LK.effects.flashObject(enemy, 0xFFFFFF, 200); enemy.destroy(); enemies.splice(j, 1); bullet.destroy(); bullets.splice(i, 1); bulletHit = true; break; } } } // Update enemies for (var k = enemies.length - 1; k >= 0; k--) { var enemy = enemies[k]; // Check if enemy reached shelter var distanceToShelter = Math.sqrt(Math.pow(enemy.x - centerX, 2) + Math.pow(enemy.y - centerY, 2)); if (distanceToShelter < 100) { shelterHealth--; healthTxt.setText('Health: ' + shelterHealth); LK.getSound('shelterHit').play(); LK.effects.flashObject(shelter, 0xFF0000, 300); enemy.destroy(); enemies.splice(k, 1); if (shelterHealth <= 0) { LK.showGameOver(); return; } } } };
===================================================================
--- original.js
+++ change.js
@@ -16,8 +16,9 @@
});
self.speed = 20;
self.directionX = 0;
self.directionY = 0;
+ self.trailParticles = [];
self.startAnimation = function () {
// Add bullet trail effect with scale animation
tween(bulletGraphics, {
scaleX: 1.8,
@@ -45,8 +46,37 @@
};
self.update = function () {
self.x += self.directionX * self.speed;
self.y += self.directionY * self.speed;
+ // Create trail particles every few frames
+ if (LK.ticks % 3 === 0) {
+ var trailParticle = LK.getAsset('bullet', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 0.8,
+ scaleY: 0.8,
+ x: self.x,
+ y: self.y
+ });
+ trailParticle.alpha = 0.6;
+ trailParticle.tint = 0xFFAA00;
+ self.parent.addChild(trailParticle);
+ self.trailParticles.push(trailParticle);
+ // Fade out and remove trail particle
+ tween(trailParticle, {
+ alpha: 0,
+ scaleX: 0.3,
+ scaleY: 0.3
+ }, {
+ duration: 300,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ if (trailParticle.parent) {
+ trailParticle.parent.removeChild(trailParticle);
+ }
+ }
+ });
+ }
};
return self;
});
var Enemy = Container.expand(function () {
@@ -135,17 +165,49 @@
var gun = self.attachAsset('gun', {
anchorX: 0,
anchorY: 0.5,
x: 30,
- y: 0
+ y: 0,
+ scaleX: 2.0,
+ scaleY: 2.0
});
+ gun.tint = 0x333333;
self.aimAngle = 0;
self.setAimDirection = function (targetX, targetY) {
var dx = targetX - self.x;
var dy = targetY - self.y;
self.aimAngle = Math.atan2(dy, dx);
self.rotation = self.aimAngle;
};
+ self.createGunSmoke = function () {
+ var smokeParticle = LK.getAsset('bullet', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 0.5,
+ scaleY: 0.5,
+ x: gun.x + 40,
+ y: gun.y
+ });
+ smokeParticle.alpha = 0.7;
+ smokeParticle.tint = 0x888888;
+ self.addChild(smokeParticle);
+ // Animate smoke dispersal
+ tween(smokeParticle, {
+ alpha: 0,
+ scaleX: 1.5,
+ scaleY: 1.5,
+ x: smokeParticle.x + Math.cos(self.aimAngle) * 20,
+ y: smokeParticle.y + Math.sin(self.aimAngle) * 20
+ }, {
+ duration: 500,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ if (smokeParticle.parent) {
+ smokeParticle.parent.removeChild(smokeParticle);
+ }
+ }
+ });
+ };
return self;
});
/****
@@ -234,8 +296,9 @@
bullet.startAnimation();
bullets.push(bullet);
game.addChild(bullet);
LK.getSound('shoot').play();
+ gunman.createGunSmoke();
lastShotTime = LK.ticks;
}
// Game input handlers
game.move = function (x, y, obj) {
silahla hedef alır şekilde olsun
silahla koşan terörist. In-Game asset. 2d. High contrast. No shadows
bullet. In-Game asset. 2d. High contrast. No shadows
ağır makinalı tüfek. In-Game asset. 2d. High contrast. No shadows
askeri 4 tarafı açık bir sığınak. In-Game asset. 2d. High contrast. No shadows
tank. In-Game asset. 2d. High contrast. No shadows
warplane. In-Game asset. 2d. High contrast. No shadows