User prompt
לכל טיל שנורה לכיוון המטוס, יש מקסימום 10 שניות של חיים. אחרי 10 שניות הוא נעלם. תעשה שאם פוגעים ברכב רגיל, או בבנין רגיל, אז יורד נקודות. תעשה שהרכבים הצבאיים והרגילים יסעו בצורה רנדומלית על המגרש ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
קח בעוד 5 פיקסלים אחורה את נקודת הפגיעה של הפצצה תעשה, שכל אובייקט, שנמצא באותו מקום מעל 3 שניות, בין אם זה נורים בין אם זה טיל, שיעלם
User prompt
טילים עדיין בטעות נשארים על המסך. בדרך כלל בחלק התחתון שלו. תעשה, שאם טיל נמצא בחלק התחתון של המסך יותר מ-3 שניות, נניח 20% תחתונים שלל המסך, הוא נעלם
User prompt
עוד 5 פיקסלים אחורה
User prompt
תיקח בעוד 40 פיקסלים אחורה את נקודת הפגיעה
User prompt
אל תשנה את מיקום העיגול, רק תשנה שכאשר מפציצים, אז נקודת הפגיעה תחושב להיות בערך 10 פיקסלים אחורה מאיפה שעכשיו
User prompt
העיגול שמקדימה למטוס נחשב לחלק מהמטוס. תבטל את זה, אם טיל נגד מטוסים פוגע בעיגול הזה לא קורה כלום והכל ממשיך. רק המטוס עצמו אם הוא נפגע מהטיל אז יורד חיים
User prompt
קורה שטילים נגד המטוס פתאום נתקעים במקום באוויר. אם טיל מגלה שהוא עומד במקום יותר מ-2 שניות הוא נעלם
User prompt
תגביר את המהירות של הנורים. אם נור קיים באוויר יותר מ-4 שניות הוא נעלם לא משנה מה. ככה השחקן חייב לשחרר את הנור רק בשנייה האחרונה יחסית ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
תגביר את מהירות טעינת הנורים בקצת. תוריד את טעינת ההפצצה ל-2 שניות
User prompt
After bombing, in addition the circle damage whitch is working good, the bomb itself stay in the place and doesnt disapear ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'targetX')' in or related to this line: 'missile.targetX = fighterJet.x;' Line Number: 577
User prompt
Make the S-300 and the target building more common Something wrong with the bombing. After the explode, show the black destruction, but it will pass as the jet fly. Make the bomb land at the center of the circle, where it is when you bomb. And it doesnt always get my clicks on f or b. allways miss it, sometimes itself use it ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the flares track the AA missile and destroy them (when touch, destroy many AA missiles in radius) makes the bombing work like this: The circle should be further from the jet. Way further. When the player tap b, the circle mark on the ground and stay there. a bomb realese. It drives to the circle and makes big explosin. there is a cooldown of 3 second after hitting, and then you can bomb again make at the top: Bombing: active\disable make the S-300 and the target\regular building way rare, ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
The circle should be at the other side of the jet, and a little bit further. The keys still doesnt work. I tap f and flares doesnt go out, tap b and bombs arnt drop. After realising bomb, let if fall from the jet to the place where the circle where at the shooting ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'addEventListener')' in or related to this line: 'document.addEventListener('keydown', function (event) {' Line Number: 200
User prompt
It doesnt count nothing I type with the keybord.
User prompt
Please fix the bug: 'TypeError: LK.isKeyDown is not a function' in or related to this line: 'var bombKeyPressed = LK.isKeyDown('KeyB') || LK.isKeyDown('b') || LK.isKeyDown('B');' Line Number: 338
User prompt
Make the backround looks like desert with variety of colours The game allways looking to check where the mouse is, and doesnt consider keybord. Pressing f, should shoot flares. Pressing b should bomb. Add a circle in front of the jet when bombing, where the bomb will drop
User prompt
The game is stil working as mouse handler, fix it
User prompt
Nothing work write all from the beggining
User prompt
Nothing work the jet doesnt move, no shooting and no change of weapons
User prompt
Reduce points when destrying regular targets Remove everything with the mouse input. The controll will be using arrows, 1\2 to choose the kind of cannon, space to shoot the current cannon. Only keyboard input
User prompt
still, nothing on the start page cant read my typing, cant tap to start lets change the controll on the jet. The controll will be with arrows only. to fire, using spacebar. Nothing with the mouse, remove every controll or shooting with the mouse
User prompt
cant write my name at the starting page at the background, the jet fires when im pressing, so I cant start the game eaither
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Bomb = Container.expand(function () { var self = Container.call(this); var bombGraphics = self.attachAsset('bomb', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 8; self.update = function () { self.y += self.speed; }; return self; }); var Bullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('bullet', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -12; self.update = function () { self.y += self.speed; }; return self; }); var Explosion = Container.expand(function () { var self = Container.call(this); var explosionGraphics = self.attachAsset('explosion', { anchorX: 0.5, anchorY: 0.5 }); self.lifespan = 30; self.update = function () { self.lifespan--; self.alpha = self.lifespan / 30; if (self.lifespan <= 0) { self.destroy(); } }; return self; }); var FighterJet = Container.expand(function () { var self = Container.call(this); var jetGraphics = self.attachAsset('fighterJet', { anchorX: 0.5, anchorY: 0.5 }); self.lives = 3; self.flareCount = 3; self.maxFlares = 3; self.flareRechargeTimer = 0; self.aaSystemsDestroyed = 0; self.update = function () { // Recharge flares over time if (self.flareCount < self.maxFlares) { self.flareRechargeTimer++; if (self.flareRechargeTimer >= 300) { // 5 seconds at 60fps self.flareCount++; self.flareRechargeTimer = 0; updateFlareDisplay(); } } }; return self; }); var Flare = Container.expand(function () { var self = Container.call(this); var flareGraphics = self.attachAsset('flare', { anchorX: 0.5, anchorY: 0.5 }); self.lifespan = 180; // 3 seconds self.update = function () { self.lifespan--; if (self.lifespan <= 0) { self.destroy(); } }; return self; }); var GroundTarget = Container.expand(function (targetType) { var self = Container.call(this); var targetGraphics = self.attachAsset(targetType, { anchorX: 0.5, anchorY: 0.5 }); self.targetType = targetType; self.points = getPointsForTarget(targetType); self.canShootMissiles = targetType === 's300System'; self.missileTimer = 0; self.update = function () { self.y += scrollSpeed; // S-300 systems shoot missiles at the player if (self.canShootMissiles && self.y > 200 && self.y < 2000) { self.missileTimer++; if (self.missileTimer >= 180) { // Every 3 seconds self.fireMissile(); self.missileTimer = 0; } } }; self.fireMissile = function () { var missile = new Missile(); missile.x = self.x; missile.y = self.y; missile.targetX = fighterJet.x; missile.targetY = fighterJet.y; missiles.push(missile); game.addChild(missile); LK.getSound('missile').play(); }; return self; }); var Missile = Container.expand(function () { var self = Container.call(this); var missileGraphics = self.attachAsset('missile', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 6; self.targetX = 0; self.targetY = 0; self.update = function () { // Move towards target (fighter jet) var dx = self.targetX - self.x; var dy = self.targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { self.x += dx / distance * self.speed; self.y += dy / distance * self.speed; } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xd2b48c }); /**** * Game Code ****/ var fighterJet = game.addChild(new FighterJet()); fighterJet.x = 1024; fighterJet.y = 2200; var bullets = []; var bombs = []; var flares = []; var missiles = []; var groundTargets = []; var explosions = []; var scrollSpeed = 3; var spawnTimer = 0; var gameSpeed = 1; // UI Elements var scoreText = new Text2('Score: 0', { size: 60, fill: '#ffffff' }); scoreText.anchor.set(0, 0); scoreText.x = 150; scoreText.y = 50; LK.gui.topLeft.addChild(scoreText); var livesText = new Text2('Lives: 3', { size: 60, fill: '#ffffff' }); livesText.anchor.set(1, 0); LK.gui.topRight.addChild(livesText); var flareText = new Text2('Flares: 3', { size: 60, fill: '#ffffff' }); flareText.anchor.set(0.5, 0); LK.gui.top.addChild(flareText); var weaponText = new Text2('Weapon: Cannon (1/2)', { size: 50, fill: '#ffffff' }); weaponText.anchor.set(0.5, 0); weaponText.y = 80; LK.gui.top.addChild(weaponText); function updateWeaponDisplay() { var cooldownText = ''; if (weaponMode === 'bombing' && bombCooldownTimer > 0) { cooldownText = ' (Cooldown: ' + Math.ceil(bombCooldownTimer / 60) + 's)'; } weaponText.setText('Weapon: ' + (weaponMode === 'cannon' ? 'Cannon' : 'Bombing') + ' (1/2)' + cooldownText); } function updateScore() { scoreText.setText('Score: ' + LK.getScore()); } function updateLivesDisplay() { livesText.setText('Lives: ' + fighterJet.lives); } function updateFlareDisplay() { flareText.setText('Flares: ' + fighterJet.flareCount); } function getPointsForTarget(targetType) { switch (targetType) { case 'building': return 2; case 'targetBuilding': return 3; case 'car': return 2; case 'armyVan': return 3; case 's300System': return 5; default: return 2; } } function spawnGroundTarget() { var rand = Math.random(); var randomType; if (rand < 0.4) { randomType = 'car'; } else if (rand < 0.7) { randomType = 'armyVan'; } else if (rand < 0.85) { randomType = 's300System'; } else if (rand < 0.95) { randomType = 'building'; } else { randomType = 'targetBuilding'; } var target = new GroundTarget(randomType); target.x = Math.random() * 1800 + 124; target.y = -100; groundTargets.push(target); game.addChild(target); } function createExplosion(x, y) { var explosion = new Explosion(); explosion.x = x; explosion.y = y; explosions.push(explosion); game.addChild(explosion); LK.getSound('explosion').play(); } function checkMissileFlareCollision(missile) { for (var f = flares.length - 1; f >= 0; f--) { var flare = flares[f]; if (missile.intersects(flare)) { createExplosion(missile.x, missile.y); missile.destroy(); flare.destroy(); flares.splice(f, 1); return true; } } return false; } // Fighter jet movement speed var jetSpeed = 8; // Weapon system variables var weaponMode = 'cannon'; var bombCooldownTimer = 0; var bombCooldownTime = 300; // Initialize bomb target circle var bombTargetCircle = LK.getAsset('explosion', { anchorX: 0.5, anchorY: 0.5, alpha: 0.3 }); bombTargetCircle.visible = false; game.addChild(bombTargetCircle); // Keyboard state tracking var keyPressed = {}; var keyJustPressed = {}; LK.on('tick', function () { // Store previous key states var previousKeys = {}; for (var key in keyPressed) { previousKeys[key] = keyPressed[key]; } // Update current key states keyPressed.left = LK.keys && LK.keys[37]; keyPressed.right = LK.keys && LK.keys[39]; keyPressed.up = LK.keys && LK.keys[38]; keyPressed.down = LK.keys && LK.keys[40]; keyPressed.space = LK.keys && LK.keys[32]; keyPressed.key1 = LK.keys && LK.keys[49]; keyPressed.key2 = LK.keys && LK.keys[50]; // Calculate just pressed states for (var key in keyPressed) { keyJustPressed[key] = keyPressed[key] && !previousKeys[key]; } }); game.update = function () { // Handle weapon switching if (keyJustPressed.key1) { weaponMode = 'cannon'; bombTargetCircle.visible = false; updateWeaponDisplay(); } if (keyJustPressed.key2) { weaponMode = 'bombing'; bombTargetCircle.visible = true; updateWeaponDisplay(); } // Arrow key movement if (keyPressed.left) { fighterJet.x -= jetSpeed; if (fighterJet.x < 60) fighterJet.x = 60; } if (keyPressed.right) { fighterJet.x += jetSpeed; if (fighterJet.x > 1988) fighterJet.x = 1988; } if (keyPressed.up) { fighterJet.y -= jetSpeed; if (fighterJet.y < 100) fighterJet.y = 100; } if (keyPressed.down) { fighterJet.y += jetSpeed; if (fighterJet.y > 2632) fighterJet.y = 2632; } // Update bomb target circle position if (bombTargetCircle) { bombTargetCircle.x = fighterJet.x; bombTargetCircle.y = fighterJet.y + 100; } // Space for shooting and flares if (keyJustPressed.space) { if (weaponMode === 'cannon') { // Fire bullet var bullet = new Bullet(); bullet.x = fighterJet.x; bullet.y = fighterJet.y - 50; bullets.push(bullet); game.addChild(bullet); LK.getSound('shoot').play(); } else if (weaponMode === 'bombing' && bombCooldownTimer <= 0) { // Drop bomb var bomb = new Bomb(); bomb.x = fighterJet.x; bomb.y = fighterJet.y + 50; bombs.push(bomb); game.addChild(bomb); LK.getSound('bomb').play(); bombCooldownTimer = bombCooldownTime; } else if (fighterJet.flareCount > 0) { // Deploy flare var flare = new Flare(); flare.x = fighterJet.x; flare.y = fighterJet.y + 50; flares.push(flare); game.addChild(flare); fighterJet.flareCount--; updateFlareDisplay(); } } spawnTimer++; // Handle bomb cooldown if (bombCooldownTimer > 0) { bombCooldownTimer--; } // Update bomb target circle visibility if (bombTargetCircle) { bombTargetCircle.visible = weaponMode === 'bombing'; if (weaponMode === 'bombing' && bombCooldownTimer > 0) { bombTargetCircle.alpha = 0.1; } else if (weaponMode === 'bombing') { bombTargetCircle.alpha = 0.3; } } // Spawn new ground targets if (spawnTimer >= 60) { spawnGroundTarget(); spawnTimer = 0; } // Update bullets for (var b = bullets.length - 1; b >= 0; b--) { var bullet = bullets[b]; if (bullet.y < -50) { bullet.destroy(); bullets.splice(b, 1); continue; } for (var gt = groundTargets.length - 1; gt >= 0; gt--) { var target = groundTargets[gt]; if (bullet.intersects(target) && (target.targetType === 'car' || target.targetType === 'armyVan')) { createExplosion(target.x, target.y); LK.setScore(LK.getScore() + target.points); updateScore(); bullet.destroy(); bullets.splice(b, 1); target.destroy(); groundTargets.splice(gt, 1); break; } } } // Update bombs for (var bo = bombs.length - 1; bo >= 0; bo--) { var bomb = bombs[bo]; if (bomb.y > 2800) { bomb.destroy(); bombs.splice(bo, 1); continue; } for (var gt = groundTargets.length - 1; gt >= 0; gt--) { var target = groundTargets[gt]; if (bomb.intersects(target) && (target.targetType === 'building' || target.targetType === 'targetBuilding' || target.targetType === 's300System')) { createExplosion(target.x, target.y); LK.setScore(LK.getScore() + target.points); updateScore(); if (target.targetType === 's300System') { fighterJet.aaSystemsDestroyed++; if (fighterJet.aaSystemsDestroyed >= 5 && fighterJet.lives < 3) { fighterJet.lives++; fighterJet.aaSystemsDestroyed = 0; updateLivesDisplay(); } } bomb.destroy(); bombs.splice(bo, 1); target.destroy(); groundTargets.splice(gt, 1); break; } } } // Update missiles for (var m = missiles.length - 1; m >= 0; m--) { var missile = missiles[m]; missile.targetX = fighterJet.x; missile.targetY = fighterJet.y; if (checkMissileFlareCollision(missile)) { missiles.splice(m, 1); continue; } if (missile.intersects(fighterJet)) { createExplosion(fighterJet.x, fighterJet.y); fighterJet.lives--; updateLivesDisplay(); if (fighterJet.lives <= 0) { LK.showGameOver(); return; } missile.destroy(); missiles.splice(m, 1); continue; } if (missile.y > 2800 || missile.y < -50 || missile.x < -50 || missile.x > 2100) { missile.destroy(); missiles.splice(m, 1); } } // Update ground targets for (var gt = groundTargets.length - 1; gt >= 0; gt--) { var target = groundTargets[gt]; if (target.y > 2800) { target.destroy(); groundTargets.splice(gt, 1); } } // Update flares for (var f = flares.length - 1; f >= 0; f--) { var flare = flares[f]; if (flare.destroyed) { flares.splice(f, 1); } } // Update explosions for (var e = explosions.length - 1; e >= 0; e--) { var explosion = explosions[e]; if (explosion.destroyed) { explosions.splice(e, 1); } } updateWeaponDisplay(); };
===================================================================
--- original.js
+++ change.js
@@ -210,25 +210,24 @@
}
function getPointsForTarget(targetType) {
switch (targetType) {
case 'building':
- return 5;
+ return 2;
case 'targetBuilding':
- return 10;
+ return 3;
case 'car':
- return 5;
+ return 2;
case 'armyVan':
- return 8;
+ return 3;
case 's300System':
- return 20;
- default:
return 5;
+ default:
+ return 2;
}
}
function spawnGroundTarget() {
var rand = Math.random();
var randomType;
- // Weighted spawn system - much more rare buildings and target buildings
if (rand < 0.4) {
randomType = 'car';
} else if (rand < 0.7) {
randomType = 'armyVan';
@@ -239,9 +238,9 @@
} else {
randomType = 'targetBuilding';
}
var target = new GroundTarget(randomType);
- target.x = Math.random() * 1800 + 124; // Keep within screen bounds
+ target.x = Math.random() * 1800 + 124;
target.y = -100;
groundTargets.push(target);
game.addChild(target);
}
@@ -256,9 +255,8 @@
function checkMissileFlareCollision(missile) {
for (var f = flares.length - 1; f >= 0; f--) {
var flare = flares[f];
if (missile.intersects(flare)) {
- // Missile destroyed by flare
createExplosion(missile.x, missile.y);
missile.destroy();
flare.destroy();
flares.splice(f, 1);
@@ -269,75 +267,77 @@
}
// Fighter jet movement speed
var jetSpeed = 8;
// Weapon system variables
-var weaponMode = 'cannon'; // 'cannon' or 'bombing'
+var weaponMode = 'cannon';
var bombCooldownTimer = 0;
-var bombCooldownTime = 300; // 5 seconds at 60fps
-var bombTargetCircle = null;
+var bombCooldownTime = 300;
// Initialize bomb target circle
-bombTargetCircle = LK.getAsset('explosion', {
+var bombTargetCircle = LK.getAsset('explosion', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.3
});
bombTargetCircle.visible = false;
game.addChild(bombTargetCircle);
// Keyboard state tracking
-var keys = {};
-var lastKeys = {};
-// Key detection function
-function isKeyPressed(keyCode) {
- return LK.keys && LK.keys[keyCode];
-}
-game.update = function () {
+var keyPressed = {};
+var keyJustPressed = {};
+LK.on('tick', function () {
+ // Store previous key states
+ var previousKeys = {};
+ for (var key in keyPressed) {
+ previousKeys[key] = keyPressed[key];
+ }
// Update current key states
- keys['Digit1'] = isKeyPressed(49); // Key code for '1'
- keys['Digit2'] = isKeyPressed(50); // Key code for '2'
- keys['ArrowLeft'] = isKeyPressed(37);
- keys['ArrowRight'] = isKeyPressed(39);
- keys['ArrowUp'] = isKeyPressed(38);
- keys['ArrowDown'] = isKeyPressed(40);
- keys['Space'] = isKeyPressed(32);
- // Copy current keys to lastKeys for next frame - moved to beginning
- for (var key in keys) {
- lastKeys[key] = keys[key];
+ keyPressed.left = LK.keys && LK.keys[37];
+ keyPressed.right = LK.keys && LK.keys[39];
+ keyPressed.up = LK.keys && LK.keys[38];
+ keyPressed.down = LK.keys && LK.keys[40];
+ keyPressed.space = LK.keys && LK.keys[32];
+ keyPressed.key1 = LK.keys && LK.keys[49];
+ keyPressed.key2 = LK.keys && LK.keys[50];
+ // Calculate just pressed states
+ for (var key in keyPressed) {
+ keyJustPressed[key] = keyPressed[key] && !previousKeys[key];
}
- // Handle keyboard input
- if (keys['Digit1'] && !lastKeys['Digit1']) {
+});
+game.update = function () {
+ // Handle weapon switching
+ if (keyJustPressed.key1) {
weaponMode = 'cannon';
bombTargetCircle.visible = false;
updateWeaponDisplay();
}
- if (keys['Digit2'] && !lastKeys['Digit2']) {
+ if (keyJustPressed.key2) {
weaponMode = 'bombing';
bombTargetCircle.visible = true;
updateWeaponDisplay();
}
// Arrow key movement
- if (keys['ArrowLeft']) {
+ if (keyPressed.left) {
fighterJet.x -= jetSpeed;
if (fighterJet.x < 60) fighterJet.x = 60;
}
- if (keys['ArrowRight']) {
+ if (keyPressed.right) {
fighterJet.x += jetSpeed;
if (fighterJet.x > 1988) fighterJet.x = 1988;
}
- if (keys['ArrowUp']) {
+ if (keyPressed.up) {
fighterJet.y -= jetSpeed;
if (fighterJet.y < 100) fighterJet.y = 100;
}
- if (keys['ArrowDown']) {
+ if (keyPressed.down) {
fighterJet.y += jetSpeed;
if (fighterJet.y > 2632) fighterJet.y = 2632;
}
// Update bomb target circle position
if (bombTargetCircle) {
bombTargetCircle.x = fighterJet.x;
- bombTargetCircle.y = fighterJet.y + 100; // Position circle below jet
+ bombTargetCircle.y = fighterJet.y + 100;
}
- // Space for shooting
- if (keys['Space'] && !lastKeys['Space']) {
+ // Space for shooting and flares
+ if (keyJustPressed.space) {
if (weaponMode === 'cannon') {
// Fire bullet
var bullet = new Bullet();
bullet.x = fighterJet.x;
@@ -352,44 +352,36 @@
bomb.y = fighterJet.y + 50;
bombs.push(bomb);
game.addChild(bomb);
LK.getSound('bomb').play();
- bombCooldownTimer = bombCooldownTime; // Start cooldown
- }
- }
- // Flare deployment - missing functionality
- if (isKeyPressed(32) && fighterJet.flareCount > 0) {
- // Spacebar for flares
- if (!keys['flareDeployed']) {
+ bombCooldownTimer = bombCooldownTime;
+ } else if (fighterJet.flareCount > 0) {
+ // Deploy flare
var flare = new Flare();
flare.x = fighterJet.x;
flare.y = fighterJet.y + 50;
flares.push(flare);
game.addChild(flare);
fighterJet.flareCount--;
updateFlareDisplay();
- keys['flareDeployed'] = true;
}
- } else {
- keys['flareDeployed'] = false;
}
spawnTimer++;
// Handle bomb cooldown
if (bombCooldownTimer > 0) {
bombCooldownTimer--;
}
- // Update bomb target circle visibility based on weapon mode and cooldown
+ // Update bomb target circle visibility
if (bombTargetCircle) {
bombTargetCircle.visible = weaponMode === 'bombing';
if (weaponMode === 'bombing' && bombCooldownTimer > 0) {
- bombTargetCircle.alpha = 0.1; // Dim during cooldown
+ bombTargetCircle.alpha = 0.1;
} else if (weaponMode === 'bombing') {
- bombTargetCircle.alpha = 0.3; // Normal visibility when ready
+ bombTargetCircle.alpha = 0.3;
}
}
// Spawn new ground targets
if (spawnTimer >= 60) {
- // Every second
spawnGroundTarget();
spawnTimer = 0;
}
// Update bullets
@@ -399,9 +391,8 @@
bullet.destroy();
bullets.splice(b, 1);
continue;
}
- // Check bullet vs ground targets (only cars and army vans)
for (var gt = groundTargets.length - 1; gt >= 0; gt--) {
var target = groundTargets[gt];
if (bullet.intersects(target) && (target.targetType === 'car' || target.targetType === 'armyVan')) {
createExplosion(target.x, target.y);
@@ -422,9 +413,8 @@
bomb.destroy();
bombs.splice(bo, 1);
continue;
}
- // Check bomb vs ground targets (buildings and S-300 systems)
for (var gt = groundTargets.length - 1; gt >= 0; gt--) {
var target = groundTargets[gt];
if (bomb.intersects(target) && (target.targetType === 'building' || target.targetType === 'targetBuilding' || target.targetType === 's300System')) {
createExplosion(target.x, target.y);
@@ -448,17 +438,14 @@
}
// Update missiles
for (var m = missiles.length - 1; m >= 0; m--) {
var missile = missiles[m];
- // Update missile target to current fighter jet position
missile.targetX = fighterJet.x;
missile.targetY = fighterJet.y;
- // Check if missile was intercepted by flare
if (checkMissileFlareCollision(missile)) {
missiles.splice(m, 1);
continue;
}
- // Check missile vs fighter jet
if (missile.intersects(fighterJet)) {
createExplosion(fighterJet.x, fighterJet.y);
fighterJet.lives--;
updateLivesDisplay();
@@ -469,9 +456,8 @@
missile.destroy();
missiles.splice(m, 1);
continue;
}
- // Remove missiles that go off screen
if (missile.y > 2800 || missile.y < -50 || missile.x < -50 || missile.x > 2100) {
missile.destroy();
missiles.splice(m, 1);
}
@@ -497,11 +483,6 @@
if (explosion.destroyed) {
explosions.splice(e, 1);
}
}
- // Update weapon display
updateWeaponDisplay();
- // Update lastKeys at the end for next frame
- for (var key in keys) {
- lastKeys[key] = keys[key];
- }
};
\ No newline at end of file
B-2 bombing jet. In-Game asset. 2d. High contrast. No shadows
S-300 Anti Air system from the bird view. In-Game asset. 2d. High contrast. No shadows
Hi-Teck buikding. In-Game asset. 2d. High contrast. No shadows
Tiny missile pointing up. In-Game asset. 2d. High contrast. No shadows
Strait anti air missile. In-Game asset. 2d. High contrast. No shadows
strait flare missile. In-Game asset. 2d. High contrast. No shadows
WW2 bomb. In-Game asset. 2d. High contrast. No shadows
Army building. In-Game asset. 2d. High contrast. No shadows
רכב צבאי ארוך וגדול, כמו תובלתית, מכוסה בברזנט, מבט מהפרופיל.
Missiles storage. In-Game asset. 2d. High contrast. No shadows
מתקן ענק לשיגור טיל שעליו מוכן טיל גרעיני. In-Game asset. 2d. High contrast. No shadows