//State.java - the parent state used by the state engine //NOTE: abstract class. must be overloaded package Core; import java.awt.Graphics2D; import java.awt.event.KeyEvent; public abstract class State { //retrieves an instance of the state public abstract State getInstance(); //actions performed when a state starts public abstract void Enter(Game g); //actions performed when this is the active state //often includes state-changing conditionals public abstract void Execute(Game g); //actions performed when the state has ended and before the next one begins public abstract void Exit(Game g); //every state handles its own key input public abstract void handleKeyPress(KeyEvent e, Game g); //handle any sort of state-specific drawing public abstract void drawStateGraphics(Graphics2D g2d); }