User prompt
silah assetini ekrandan kaldır
User prompt
sadece silah assetine dokundugum zman bullet asseti cıksın
User prompt
silah asseti saga ve sola hareket edbılsın
User prompt
silah assetini ekranın alt kısmına yerlestır
User prompt
bullet ekranın bıraz daha altından atılmaya baslasın
User prompt
biraz fazla hızlı oldu hızını bıraz dusurelım
User prompt
bullet target hedefini vurdugu zman target ekranın asagısına yavas yavas hızını artırark gelsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
bullet target a carptıgında kucuk bır patlama efektı verılsın
User prompt
bullet assetinin sayısını ekranın sağ alt kosesınde gostersın
User prompt
bullet asseti target assetine carptıgı zaman mermi sayısı 2 artsın
User prompt
bullet asseti ekranın alt kısmına gelsin
User prompt
bullet asseti 5 den baslasın ve atıldıgında bır eksılsın
User prompt
biraz yavaslatlım target assetini
User prompt
target asseti ekranın alt kısmına daha hzılı gelsin
User prompt
ekranın alt kısmına dokundugunda mermı assetı cıksın
User prompt
target assetine dokundugun zaman yok olmasın sadece mermi isabet ettigınde yok olsun
Initial prompt
silahla hedef vurma
/****
* 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 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 (y > 2732 * 0.9 && bulletCount > 0) {
// Check if bullet count is greater than 0 before firing
var newBullet = new Bullet();
newBullet.x = x;
newBullet.y = 2732 * 0.9; // Move bullet asset to start from a lower position on 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);
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
bulletCountTxt.setText('Bullets: ' + bulletCount); // Update bullet count display
LK.effects.flashObject(targets[j], 0xff0000, 500); // Add explosion effect
}
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -74,13 +74,13 @@
}
// Handle shooting
var bulletCount = 5; // Initialize bullet count to 5
game.down = function (x, y, obj) {
- if (y > 2732 * 0.8 && bulletCount > 0) {
+ if (y > 2732 * 0.9 && bulletCount > 0) {
// Check if bullet count is greater than 0 before firing
var newBullet = new Bullet();
newBullet.x = x;
- newBullet.y = 2732 * 0.8; // Move bullet asset to the bottom of the screen
+ newBullet.y = 2732 * 0.9; // Move bullet asset to start from a lower position on 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
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.