pacman.controllers.KeyBoardInput Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pacman-main Show documentation
Show all versions of pacman-main Show documentation
The main code for Ms. Pac-Man Vs Ghosts
package pacman.controllers;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
/*
* A simple key adapter used by the HumanController to play the game.
*/
public class KeyBoardInput extends KeyAdapter {
private int key;
public int getKey() {
return key;
}
public void keyPressed(KeyEvent e) {
key = e.getKeyCode();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy