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

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +9 -8
index.html CHANGED
@@ -210,14 +210,15 @@
210
  items = [];
211
  startCountdown();
212
  }
213
- document.addEventListener('keydown', (e) => {
214
- if(e.key.toLowerCase() === 'c') {
215
- currentWeapon = currentWeapon === 'cannon' ? 'machinegun' : 'cannon';
216
- weaponInfo.textContent = `Current Weapon: ${currentWeapon.charAt(0).toUpperCase() + currentWeapon.slice(1)}`;
217
- } else if(e.key.toLowerCase() === 'r') {
218
- autoFire = !autoFire;
219
- }
220
- });
 
221
  canvas.addEventListener('mousemove', (e) => {
222
  player.angle = Math.atan2(e.clientY - player.y, e.clientX - player.x);
223
  });
 
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
  });