package Game;

import java.awt.event.*;
import java.util.Arrays;

/**
 * Created by Damien on 28/8/2014.
 */
public class Input implements KeyListener, MouseListener, MouseMotionListener
{

    private final int MOUSE_LEFT = 1;
    private final int MOUSE_RIGHT = 2;

    private boolean[] m_keyInput = new boolean[65536];
    private boolean[] m_mouseButtons = new boolean[4];
    private float m_mouseX = 0.0f;
    private float m_mouseY = 0.0f;
    private int halfWidth;
    private int halfHeight;

    public Input(int displayWidth, int displayHeight)
    {
        Arrays.fill(m_keyInput, false);
        Arrays.fill(m_mouseButtons, false);

        halfWidth = displayWidth / 2;
        halfHeight = displayHeight / 2;
    }

    @Override
    public void keyTyped(KeyEvent keyEvent) {

    }

    public void keyPressed(KeyEvent event)
    {
        try
        {
            m_keyInput[event.getKeyCode()] = true;
        }
        catch (ArrayIndexOutOfBoundsException e)
        {
            System.exit(-1);
        }
    }

    public void keyReleased(KeyEvent event)
    {
        m_keyInput[event.getKeyCode()] = false;
    }

    public boolean[] getKeyInput()
    {
        return  m_keyInput;
    }

    public boolean[] getMouseButtons() {
        return m_mouseButtons;
    }

    public float getMouseX() {
        return m_mouseX;
    }

    public float getMouseY() {
        return m_mouseY;
    }

    @Override
    public void mouseClicked(MouseEvent mouseEvent){

    }

    @Override
    public void mousePressed(MouseEvent mouseEvent)
    {
        m_mouseButtons[mouseEvent.getButton()] = true;
    }

    @Override
    public void mouseReleased(MouseEvent mouseEvent)
    {
        m_mouseButtons[mouseEvent.getButton()] = false;
    }

    @Override
    public void mouseEntered(MouseEvent mouseEvent) {

    }

    @Override
    public void mouseExited(MouseEvent mouseEvent){

    }

    @Override
    public void mouseDragged(MouseEvent mouseEvent)
    {
        m_mouseX = ((float)mouseEvent.getX() - (float)halfWidth  )/ (float) halfWidth  ;
        m_mouseY = ((float)mouseEvent.getY() - (float)halfHeight )/ (float)-halfHeight ;
    }

    @Override
    public void mouseMoved(MouseEvent mouseEvent)
    {
        m_mouseX = ((float)mouseEvent.getX() - (float)halfWidth  )/ (float) halfWidth  ;
        m_mouseY = ((float)mouseEvent.getY() - (float)halfHeight )/ (float)-halfHeight ;
    }
}

@@ -283,18 +283,16 @@
 olean%5B%5D 
-m_
 keyInput
@@ -336,18 +336,16 @@
 olean%5B%5D 
-m_
 mouseBut
@@ -381,26 +381,24 @@
 ivate float 
-m_
 mouseX = 0.0
@@ -418,18 +418,16 @@
 e float 
-m_
 mouseY =
@@ -569,18 +569,16 @@
 ys.fill(
-m_
 keyInput
@@ -607,18 +607,16 @@
 ys.fill(
-m_
 mouseBut
@@ -858,34 +858,32 @@
   %7B%0A            
-m_
 keyInput%5Bevent.g
@@ -1076,18 +1076,16 @@
         
-m_
 keyInput
@@ -1177,19 +1177,16 @@
  return 
- m_
 keyInput
@@ -1246,26 +1246,24 @@
      return 
-m_
 mouseButtons
@@ -1313,26 +1313,24 @@
      return 
-m_
 mouseX;%0A    
@@ -1378,18 +1378,16 @@
  return 
-m_
 mouseY;%0A
@@ -1540,34 +1540,32 @@
 )%0A    %7B%0A        
-m_
 mouseButtons%5Bmou
@@ -1677,26 +1677,24 @@
   %7B%0A        
-m_
 mouseButtons
@@ -1956,34 +1956,32 @@
 )%0A    %7B%0A        
-m_
 mouseX = ((float
@@ -2043,34 +2043,32 @@
 idth  ;%0A        
-m_
 mouseY = ((float
@@ -2211,26 +2211,24 @@
   %7B%0A        
-m_
 mouseX = ((f
@@ -2306,10 +2306,8 @@
     
-m_
 mous

Changed all the names