Class VersusController

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.KeyListener, java.util.EventListener

    public class VersusController
    extends java.lang.Object
    implements java.awt.event.ActionListener, java.awt.event.KeyListener
    • Field Detail

      • timerCounterA

        private long timerCounterA
        The main game timer ticks every 10 ms but to set adjustable times we increment the variable timerCounter by 10 and can then compare it with model.fallSpeed to seed if we should do something
      • timerCounterB

        private long timerCounterB
    • Method Detail

      • setVue

        public void setVue​(VersusVue vue)
      • timerTicked

        void timerTicked()
      • keyTyped

        public void keyTyped​(java.awt.event.KeyEvent e)
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
      • keyReleased

        public void keyReleased​(java.awt.event.KeyEvent e)
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent e)
        Listen for key presses and do action according to the keys in the config file
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
        Parameters:
        e - the event
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        Listen for incoming event and do some action accordingly
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        e - the event