User prompt
skor az bir şey sağ tarafta görünsün
User prompt
skor ekranın sol tarafında gözüksün
User prompt
eger herhangi bir target bullet tarafından vurulmadan yere duserse skor 3 azalsın
User prompt
25 in katlarında 15 saniye degılde 10 saniye eklensın sureye
User prompt
skor eger 200 den fazla olursa bu sefer 50 in katlarında sadace 4 saniye ekle
User prompt
background assetini ekrana ekle
User prompt
bir tane background asseti olustur
User prompt
süreyi 30 dan baslat
User prompt
skor 125 den yukarı oldugu zman 25 in katlarında 15 saniye eklemeyi 6 saniyeye dusur
User prompt
skor 25 ve katları oldugu zaman sureye 15 sanıye ekle
User prompt
time 0 oldugunda oyun biter
User prompt
sag üst koseye 25. saniyeden baslamak uzere bır sanıye sayacı ekler mısın
User prompt
bullet target assetine carpmadan ekranın alt kısmına gecerse bullets sayısı 4 er 4 er azalsın
User prompt
light asseti ekranın ortasında değil de bullet assetinin target assetine carptıgı yerde ortaya cıkmasını rıca edıyorum
User prompt
skor her arttıgında light asseti ekrana cıksın
User prompt
target bulleta carptıgında light asseti 1 saniye ortaya cıksın sonra kaybolsun
User prompt
bullet targeta carptıgında yok olmasın ekranın sonuna kadar gitsin önüne herhangi bir target cıkarsa onu da yok etsin
User prompt
bullet target assetine vurdugunda o vurdugu kısımda kucuk bır ısık efektı cıksın
User prompt
oyuncu 30 ve 30 un katları skora ulastıgında ekrana "congrulations +5 bullet " yazsın
User prompt
oyuncu 30 ve 30 un katları skora ulastıgında artı 5 mermi o anki mermi sayısına eklensin
User prompt
ekranın sadece alt kısmına basınca mermi cıksın
User prompt
bullets sayısı 0 a ulasınca oyun biter
User prompt
bullets sayısına en basta undefied yazmak yerine 5 sayısı yazsın
User prompt
en başta başlarken bulleys her zman 5 olsun
User prompt
bullets sayısı 0 oldugunda oyun biter
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
// Bullet class representing the bullets fired by the player
var Bullet = Container.expand(function () {
var self = Container.call(this);
var bulletGraphics = self.attachAsset('bullet', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = -10;
self.update = function () {
self.y += self.speed;
};
});
//<Assets used in the game will automatically appear here>
//<Write imports for supported plugins here>
// Target class representing the targets to be hit
var Target = Container.expand(function () {
var self = Container.call(this);
var targetGraphics = self.attachAsset('target', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 1;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
self.y = -targetGraphics.height;
self.x = Math.random() * 2048;
}
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000 //Init game with black background
});
/****
* Game Code
****/
// Initialize variables
var score = 0;
var bullets = [];
var targets = [];
var bulletCount = 5; // Initialize bullet count to 5
var scoreTxt = new Text2('0', {
size: 150,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Display bullet count
var bulletCountTxt = new Text2('Bullets: ' + bulletCount, {
size: 100,
fill: 0xFFFFFF
});
bulletCountTxt.anchor.set(1, 1); // Anchor to bottom right
LK.gui.bottomRight.addChild(bulletCountTxt);
// Create targets
for (var i = 0; i < 5; i++) {
var target = new Target();
target.x = Math.random() * 2048;
target.y = Math.random() * 2732;
targets.push(target);
game.addChild(target);
}
// Handle shooting
var bulletCount = 5; // Initialize bullet count to 5
game.down = function (x, y, obj) {
if (bulletCount > 0 && y > 2732 / 2) {
// Check if bullet count is greater than 0 and the touch event is in the bottom half of the screen before firing
var newBullet = new Bullet();
newBullet.x = x;
newBullet.y = 2732; // Bullets start from the bottom of the screen
bullets.push(newBullet);
game.addChild(newBullet);
bulletCount--; // Decrease bullet count by 1 each time a bullet is fired
bulletCountTxt.setText('Bullets: ' + bulletCount); // Update bullet count display
}
};
// Update game state
game.update = function () {
for (var i = bullets.length - 1; i >= 0; i--) {
bullets[i].update();
if (bullets[i].y < -50) {
bullets[i].destroy();
bullets.splice(i, 1);
}
}
for (var j = targets.length - 1; j >= 0; j--) {
targets[j].update();
for (var k = bullets.length - 1; k >= 0; k--) {
if (bullets[k].intersects(targets[j])) {
score += 1;
scoreTxt.setText(score);
targets[j].y = -targets[j].height;
targets[j].x = Math.random() * 2048;
targets[j].speed += 0.5; // Decrease the speed of the target
bulletCount += 2; // Increase bullet count by 2 when a bullet hits a target
// Check if the score is a multiple of 30
if (score % 30 === 0) {
bulletCount += 5; // Add 5 bullets to the current bullet count
}
bulletCountTxt.setText('Bullets: ' + bulletCount); // Update bullet count display
LK.effects.flashObject(targets[j], 0xff0000, 500); // Add explosion effect
// Add light effect when a bullet hits a target
var lightEffect = LK.getAsset('light', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.1,
scaleY: 0.1,
alpha: 0.8
});
lightEffect.x = targets[j].x;
lightEffect.y = targets[j].y;
game.addChild(lightEffect);
tween(lightEffect, {
scaleX: 1,
scaleY: 1,
alpha: 0
}, {
duration: 500,
onFinish: function onFinish() {
lightEffect.destroy();
}
});
}
}
}
// Check if bullet count is 0, if so, end the game
if (bulletCount === 0) {
LK.showGameOver();
}
}; ===================================================================
--- original.js
+++ change.js
@@ -101,10 +101,8 @@
for (var k = bullets.length - 1; k >= 0; k--) {
if (bullets[k].intersects(targets[j])) {
score += 1;
scoreTxt.setText(score);
- bullets[k].destroy();
- bullets.splice(k, 1);
targets[j].y = -targets[j].height;
targets[j].x = Math.random() * 2048;
targets[j].speed += 0.5; // Decrease the speed of the target
bulletCount += 2; // Increase bullet count by 2 when a bullet hits a target
merminin ucu y eksenin pozitif kısmına baksın böyle bir mermi tasarımı istiyorum. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
tekli balon resmi. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
havai fişek patlaması. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
background ıcın guzel ve yaratıcı resımler. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
taş resmi. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.