We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 115e4a1 commit bc87304Copy full SHA for bc87304
1 file changed
navigation/Minigames/pacman.md
@@ -497,7 +497,24 @@ Author: Aarush
497
case 'd':
498
currentDirection = { dx: 1, dy: 0, dir: 'right' };
499
break;
500
- }
+ }
501
+
502
+ // Shoot bullet with Shift key (either left or right shift)
503
+ if (e.key === 'Shift') {
504
+ if (pacman.dx !== 0 || pacman.dy !== 0) {
505
+ const exists = bullets.some(
506
+ b => b.x === pacman.x && b.y === pacman.y && b.dx === pacman.dx && b.dy === pacman.dy
507
+ );
508
+ if (!exists) {
509
+ bullets.push({
510
+ x: pacman.x,
511
+ y: pacman.y,
512
+ dx: pacman.dx,
513
+ dy: pacman.dy
514
+ });
515
516
517
518
});
519
520
function updatePacman(force) {
0 commit comments