User prompt
Arkaplanı oyunun temasına göre yarat
User prompt
Rastgele yerlerde olsun ama yolun kenarında olsun
User prompt
Biraz azalt
User prompt
Binaları büyült ve çokalt
User prompt
Arabalar yolun üstünden geçsin
User prompt
Karakterler yolun içindən geçerken arkaplandan geçen gibi oluyor onu düzelt
User prompt
Arabalar biraz kiçik olsun bizim kadar
User prompt
Arabalar büyük olsun ve yolların aldından geçemiyoz
User prompt
Yine olmadı
User prompt
Joystikte hata var yanlız düz gidiyor istediğim yere gitsin
User prompt
Karakter dokunduğumuz yere işınlanmasın yanlız joystickle hareketlene bilsin
User prompt
Kiçik daire onu nereye doğru yönlendirsek karakterde oraya doğru hareket edicek
User prompt
Yön çubuğu olsun hareket üçün
User prompt
Puan sözüde sol altda olsun
User prompt
Hedef ve sivil sözləri büyük ve gözəçarpan olsun
User prompt
Ortalıkta arabalarda olsun ve binalarda olsun ve yol izleri
User prompt
Targets too
User prompt
Adamların ölüm parıklları olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
And our character too
User prompt
Civilian and target and we must to big than normal
User prompt
Oyna ve çık sözləri büyük ve gözəçarpan olsun
User prompt
A play and quit buttons
Initial prompt
Please save this source code
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Building = Container.expand(function () {
var self = Container.call(this);
var graphics = self.attachAsset('building', {
anchorX: 0.5,
anchorY: 1
});
return self;
});
var Bullet = Container.expand(function () {
var self = Container.call(this);
var graphics = self.attachAsset('bullet', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 15;
self.direction = 0;
self.lifetime = 0;
self.maxLifetime = 60;
self.update = function () {
self.x += Math.cos(self.direction) * self.speed;
self.y += Math.sin(self.direction) * self.speed;
self.lifetime++;
if (self.lifetime > self.maxLifetime) {
self.destroy();
}
};
return self;
});
var Civilian = Container.expand(function () {
var self = Container.call(this);
var graphics = self.attachAsset('civilian', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 1;
self.direction = Math.random() * Math.PI * 2;
self.changeDirectionTimer = 0;
self.isActive = true;
self.update = function () {
if (!self.isActive) return;
// Hareket
self.x += Math.cos(self.direction) * self.speed;
self.y += Math.sin(self.direction) * self.speed;
// Sınırlar içinde tut
if (self.x < 100) {
self.x = 100;
self.direction = Math.PI - self.direction;
}
if (self.x > 1948) {
self.x = 1948;
self.direction = Math.PI - self.direction;
}
if (self.y < 100) {
self.y = 100;
self.direction = -self.direction;
}
if (self.y > 2632) {
self.y = 2632;
self.direction = -self.direction;
}
// Yön değiştirme
self.changeDirectionTimer++;
if (self.changeDirectionTimer > 180) {
self.direction += (Math.random() - 0.5) * 0.3;
self.changeDirectionTimer = 0;
}
};
return self;
});
var Target = Container.expand(function () {
var self = Container.call(this);
var graphics = self.attachAsset('target', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 2;
self.direction = Math.random() * Math.PI * 2;
self.changeDirectionTimer = 0;
self.isActive = true;
self.update = function () {
if (!self.isActive) return;
// Hareket
self.x += Math.cos(self.direction) * self.speed;
self.y += Math.sin(self.direction) * self.speed;
// Sınırlar içinde tut
if (self.x < 100) {
self.x = 100;
self.direction = Math.PI - self.direction;
}
if (self.x > 1948) {
self.x = 1948;
self.direction = Math.PI - self.direction;
}
if (self.y < 100) {
self.y = 100;
self.direction = -self.direction;
}
if (self.y > 2632) {
self.y = 2632;
self.direction = -self.direction;
}
// Yön değiştirme
self.changeDirectionTimer++;
if (self.changeDirectionTimer > 120) {
self.direction += (Math.random() - 0.5) * 0.5;
self.changeDirectionTimer = 0;
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x34495e
});
/****
* Game Code
****/
// Oyun değişkenleri
var targets = [];
var civilians = [];
var bullets = [];
var buildings = [];
var crosshair = null;
var gameTime = 0;
var maxGameTime = 3600; // 60 saniye (60 FPS * 60)
var targetsHit = 0;
var civiliansHit = 0;
var targetSpawnTimer = 0;
var civilianSpawnTimer = 0;
var gameEnded = false;
// Oyun durumu
var gameStarted = false;
// Menü UI elementleri
var menuContainer = new Container();
game.addChild(menuContainer);
var titleText = new Text2('ŞEHİR AVCISI', {
size: 120,
fill: '#ffffff'
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 1024;
titleText.y = 800;
menuContainer.addChild(titleText);
var subtitleText = new Text2('Suikast Görevi', {
size: 60,
fill: '#e74c3c'
});
subtitleText.anchor.set(0.5, 0.5);
subtitleText.x = 1024;
subtitleText.y = 950;
menuContainer.addChild(subtitleText);
var playButton = game.addChild(LK.getAsset('target', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 3,
scaleY: 3
}));
playButton.x = 1024;
playButton.y = 1200;
var playText = new Text2('OYNA', {
size: 150,
fill: '#ffffff'
});
playText.anchor.set(0.5, 0.5);
playText.x = 1024;
playText.y = 1200;
menuContainer.addChild(playText);
var quitButton = game.addChild(LK.getAsset('civilian', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 3,
scaleY: 3
}));
quitButton.x = 1024;
quitButton.y = 1400;
var quitText = new Text2('ÇIKIŞ', {
size: 150,
fill: '#ffffff'
});
quitText.anchor.set(0.5, 0.5);
quitText.x = 1024;
quitText.y = 1400;
menuContainer.addChild(quitText);
// Oyun UI elementleri
var scoreText = new Text2('Puan: 0', {
size: 60,
fill: '#ffffff'
});
scoreText.anchor.set(0, 0);
scoreText.visible = false;
LK.gui.topLeft.addChild(scoreText);
var timeText = new Text2('Süre: 60', {
size: 60,
fill: '#ffffff'
});
timeText.anchor.set(1, 0);
timeText.visible = false;
LK.gui.topRight.addChild(timeText);
var targetText = new Text2('Hedef: 0', {
size: 50,
fill: '#e74c3c'
});
targetText.anchor.set(0, 0);
targetText.x = 150;
targetText.visible = false;
LK.gui.topLeft.addChild(targetText);
var civilianText = new Text2('Sivil: 0', {
size: 50,
fill: '#3498db'
});
civilianText.anchor.set(0, 0);
civilianText.x = 300;
civilianText.visible = false;
LK.gui.topLeft.addChild(civilianText);
// Nişangah
crosshair = game.addChild(LK.getAsset('crosshair', {
anchorX: 0.5,
anchorY: 0.5
}));
crosshair.x = 1024;
crosshair.y = 1366;
crosshair.alpha = 0.7;
crosshair.visible = false;
// Buton etkileşim fonksiyonları
playButton.down = function (x, y, obj) {
startGame();
};
quitButton.down = function (x, y, obj) {
// Çıkış animasyonu
tween(menuContainer, {
alpha: 0,
scaleX: 0.5,
scaleY: 0.5
}, {
duration: 500,
onFinish: function onFinish() {
LK.showGameOver();
}
});
};
function startGame() {
gameStarted = true;
// Menü gizle
tween(menuContainer, {
alpha: 0,
scaleX: 0.1,
scaleY: 0.1
}, {
duration: 500,
onFinish: function onFinish() {
menuContainer.visible = false;
playButton.visible = false;
quitButton.visible = false;
}
});
// UI göster
scoreText.visible = true;
timeText.visible = true;
targetText.visible = true;
civilianText.visible = true;
crosshair.visible = true;
// İlk spawn
spawnTarget();
spawnCivilian();
}
// Binalar oluştur
for (var i = 0; i < 8; i++) {
var building = game.addChild(new Building());
building.x = 200 + i * 240;
building.y = 2500;
buildings.push(building);
}
for (var i = 0; i < 6; i++) {
var building = game.addChild(new Building());
building.x = 300 + i * 280;
building.y = 1800;
buildings.push(building);
}
// Fonksiyonlar
function spawnTarget() {
var target = game.addChild(new Target());
target.x = 200 + Math.random() * 1600;
target.y = 200 + Math.random() * 1800;
targets.push(target);
}
function spawnCivilian() {
var civilian = game.addChild(new Civilian());
civilian.x = 200 + Math.random() * 1600;
civilian.y = 200 + Math.random() * 1800;
civilians.push(civilian);
}
function fireBullet(targetX, targetY) {
var bullet = game.addChild(new Bullet());
bullet.x = crosshair.x;
bullet.y = crosshair.y;
var dx = targetX - crosshair.x;
var dy = targetY - crosshair.y;
bullet.direction = Math.atan2(dy, dx);
bullets.push(bullet);
LK.getSound('shoot').play();
}
function updateUI() {
scoreText.setText('Puan: ' + LK.getScore());
timeText.setText('Süre: ' + Math.ceil((maxGameTime - gameTime) / 60));
targetText.setText('Hedef: ' + targetsHit);
civilianText.setText('Sivil: ' + civiliansHit);
}
function checkCollisions() {
// Mermi - hedef çarpışması
for (var i = bullets.length - 1; i >= 0; i--) {
var bullet = bullets[i];
var bulletHit = false;
// Hedeflerle çarpışma
for (var j = targets.length - 1; j >= 0; j--) {
var target = targets[j];
if (target.isActive && bullet.intersects(target)) {
// Hedef vuruldu
targetsHit++;
LK.setScore(LK.getScore() + 100);
LK.getSound('hit').play();
// Hedef efekti
tween(target, {
alpha: 0,
scaleX: 2,
scaleY: 2
}, {
duration: 300,
onFinish: function onFinish() {
target.destroy();
}
});
target.isActive = false;
targets.splice(j, 1);
bullet.destroy();
bullets.splice(i, 1);
bulletHit = true;
break;
}
}
if (bulletHit) continue;
// Sivillerle çarpışma
for (var j = civilians.length - 1; j >= 0; j--) {
var civilian = civilians[j];
if (civilian.isActive && bullet.intersects(civilian)) {
// Sivil vuruldu (ceza)
civiliansHit++;
LK.setScore(Math.max(0, LK.getScore() - 50));
LK.getSound('miss').play();
// Sivil efekti
tween(civilian, {
alpha: 0,
scaleX: 2,
scaleY: 2
}, {
duration: 300,
onFinish: function onFinish() {
civilian.destroy();
}
});
civilian.isActive = false;
civilians.splice(j, 1);
bullet.destroy();
bullets.splice(i, 1);
bulletHit = true;
break;
}
}
// Ekran dışına çıkan mermiler
if (!bulletHit && (bullet.x < 0 || bullet.x > 2048 || bullet.y < 0 || bullet.y > 2732)) {
bullet.destroy();
bullets.splice(i, 1);
}
}
}
// Oyun olayları
game.move = function (x, y, obj) {
if (!gameStarted || gameEnded) return;
crosshair.x = x;
crosshair.y = y;
};
game.down = function (x, y, obj) {
if (!gameStarted || gameEnded) return;
fireBullet(x, y);
};
// Ana oyun döngüsü
game.update = function () {
if (!gameStarted || gameEnded) return;
gameTime++;
// Zaman kontrolü
if (gameTime >= maxGameTime) {
gameEnded = true;
if (targetsHit >= 10) {
LK.showYouWin();
} else {
LK.showGameOver();
}
return;
}
// Hedef spawn
targetSpawnTimer++;
if (targetSpawnTimer >= 120 && targets.length < 3) {
spawnTarget();
targetSpawnTimer = 0;
}
// Sivil spawn
civilianSpawnTimer++;
if (civilianSpawnTimer >= 180 && civilians.length < 4) {
spawnCivilian();
civilianSpawnTimer = 0;
}
// Çarpışma kontrolü
checkCollisions();
// UI güncelle
updateUI();
}; ===================================================================
--- original.js
+++ change.js
@@ -169,9 +169,9 @@
}));
playButton.x = 1024;
playButton.y = 1200;
var playText = new Text2('OYNA', {
- size: 80,
+ size: 150,
fill: '#ffffff'
});
playText.anchor.set(0.5, 0.5);
playText.x = 1024;
@@ -185,9 +185,9 @@
}));
quitButton.x = 1024;
quitButton.y = 1400;
var quitText = new Text2('ÇIKIŞ', {
- size: 80,
+ size: 150,
fill: '#ffffff'
});
quitText.anchor.set(0.5, 0.5);
quitText.x = 1024;
A young man's head. In-Game asset. 2d. High contrast. No shadows
A building. In-Game asset. 2d. High contrast. No shadows
A bullet. In-Game asset. 2d. High contrast. No shadows
Normal person head. In-Game asset. 2d. High contrast. No shadows
Skull head bloody. In-Game asset. 2d. High contrast. No shadows
An old car. In-Game asset. 2d. High contrast. No shadows
A road . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Bir gizli genc bir insanın kafası. In-Game asset. 2d. High contrast. No shadows