User prompt
Still, nothing add a starting page, where you can name the pilot and it will store your score using this name for normal building, or regular van, decrease points ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
The primary change needed is to move the line that updates lastKeys to the very beginning of your game.update function. Here's why and how: The Problem Currently, your code updates the lastKeys object (which stores the state of keys from the previous frame) at the end of the game.update function. This means that when you check if (keys['Digit2'] && !lastKeys['Digit2']), lastKeys['Digit2'] might already be true if you pressed and released the key quickly within the same frame. This causes the condition !lastKeys['Digit2'] to be false, and thus the weapon doesn't switch. The Solution By moving the lastKeys update to the start of the game.update function, you ensure that lastKeys always accurately reflects the state of the keys from the immediately preceding frame. This allows the !lastKeys['Digit2'] check to correctly detect when the '2' key is initially pressed down.
User prompt
flares doesnt work pressing 2 doesnt change the weapon fix the input from keyboard
User prompt
Pressing 2 or 1 doesnt change the weapon. Only firing with left click works flares still doesnt work while pressing spacebar
User prompt
Flares doesnt work. Also the bombing. Only the regular cannon work. Lets do it like this: You have 2 states. One is normal cannon, the other is bombing. You choose using pressing 1\2. bombing will be also using click. when you are on the bombing, you have a circle in front of the jet, showing the area that will damage with the bomb. cooldown of 5 seconds. and fix the flare, still doesnt work
User prompt
The flare and the bombing doesnt work, make the backround looks like a desert
User prompt
make the target building way more rare and the normal bulding rare too S-300 a little bit more rare make the bombing usable via button B, and not tighr click flares using spacebar, now the flares doesnt work
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'button')' in or related to this line: 'if (obj.event.button === 0) {' Line Number: 270
Code edit (1 edits merged)
Please save this source code
User prompt
Fighter Jet Strike
Initial prompt
An fighter jet attack game. You control a fighter jet, with the mouse. Where the mouse is where the jet. You have regular cannon that fire in strait line, that fire pressing left mouse. Bombing, that drop under the jet, using right click. There are S-300 AA on the ground sometimes, that fires to your jet. Uisng spacebar you can shoot flames that makes thr AA miss you. Its reload over time. There are regular buildings, target buldings, normal cars, army vans. Target buildings and AA the player destroy using bombing. Army cars, using normal cannon. It spawns while you fly forward. You have 3 lives, every taget you kill you get some score, after killing 5 AA you gain +1 live butno more than 3.
/**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 });
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
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