cutechicken commited on
Commit
9e9c255
·
verified ·
1 Parent(s): 6c525f2

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +9 -18
index.html CHANGED
@@ -210,28 +210,19 @@
210
  items = [];
211
  startCountdown();
212
  }
213
- document.addEventListener('keydown', e => {
214
- keys[e.key] = true;
215
- if(e.key.toLowerCase() === 'c') {
216
- currentWeapon = currentWeapon === 'cannon' ? 'machinegun' : 'cannon';
217
- weaponInfo.textContent = `Current Weapon: ${currentWeapon.charAt(0).toUpperCase() + currentWeapon.slice(1)}`;
218
- } else if(e.key.toLowerCase() === 'r') {
219
- autoFire = !autoFire;
220
- }
221
- });
222
  canvas.addEventListener('mousemove', (e) => {
223
  player.angle = Math.atan2(e.clientY - player.y, e.clientX - player.x);
224
  });
225
  const keys = {};
226
- document.addEventListener('keydown', e => keys[e.key] = true);
227
- document.addEventListener('keydown', (e) => {
228
- if(e.key.toLowerCase() === 'c') {
229
- currentWeapon = currentWeapon === 'cannon' ? 'machinegun' : 'cannon';
230
- weaponInfo.textContent = `Current Weapon: ${currentWeapon.charAt(0).toUpperCase() + currentWeapon.slice(1)}`;
231
- } else if(e.key.toLowerCase() === 'r') {
232
- autoFire = !autoFire;
233
- }
234
- });
235
  document.addEventListener('keyup', e => keys[e.key] = false);
236
  function fireBullet() {
237
  if(isCountingDown) return;
 
210
  items = [];
211
  startCountdown();
212
  }
 
 
 
 
 
 
 
 
 
213
  canvas.addEventListener('mousemove', (e) => {
214
  player.angle = Math.atan2(e.clientY - player.y, e.clientX - player.x);
215
  });
216
  const keys = {};
217
+ document.addEventListener('keydown', e => {
218
+ keys[e.key] = true;
219
+ if(e.key.toLowerCase() === 'c') {
220
+ currentWeapon = currentWeapon === 'cannon' ? 'machinegun' : 'cannon';
221
+ weaponInfo.textContent = `Current Weapon: ${currentWeapon.charAt(0).toUpperCase() + currentWeapon.slice(1)}`;
222
+ } else if(e.key.toLowerCase() === 'r') {
223
+ autoFire = !autoFire;
224
+ }
225
+ });
226
  document.addEventListener('keyup', e => keys[e.key] = false);
227
  function fireBullet() {
228
  if(isCountingDown) return;