private static void addlisteners()
	{
		frame.addMouseListener(new MouseListener()
		{
			@Override
			public void mousePressed(MouseEvent e)
			{
				int btn = e.getButton();
				if(btn == leftmouse)
					shoot = true;
			}
			@Override
			public void mouseReleased(MouseEvent e)
			{
				int btn = e.getButton();
				if(btn == leftmouse)
					shoot = false;
			}			
			@Override public void mouseClicked(MouseEvent e){}
			@Override public void mouseEntered(MouseEvent e){}
			@Override public void mouseExited(MouseEvent e){}
		});
		frame.addMouseWheelListener(new MouseWheelListener()
		{
			@Override
			public void mouseWheelMoved(MouseWheelEvent evt)
			{
				if(selectedweapon + evt.getWheelRotation()>5)
					selectedweapon = 0;
				else if(selectedweapon + evt.getWheelRotation()<0)
					selectedweapon = 5;
				else
					selectedweapon += evt.getWheelRotation();
				
				setplayerimg(selectedweapon);
			}
			
		});
		frame.addMouseMotionListener(new MouseMotionListener()
		{
			@Override
			public void mouseMoved(MouseEvent evt)
			{
				mousex = evt.getX();
				mousey = evt.getY();
			}
			@Override public void mouseDragged(MouseEvent evt)
			{
				mousex = evt.getX();
				mousey = evt.getY();
			}			
		});
		frame.addKeyListener(new KeyListener()
		{
			public void keyPressed(KeyEvent evt) 
			{
			      int key = evt.getKeyCode();
			      if(key == KeyEvent.VK_ESCAPE) System.exit(0);
			      if(key == keyup)moveup = true;
			      if(key == keydown)movedown = true;
			      if(key == keyleft)moveleft = true;
			      if(key == keyright)moveright = true;
			      if(key == KeyEvent.VK_SHIFT)sprintkey=true;			      
			      if(key == KeyEvent.VK_T)zombies.add(newzombie());
			      if(key == KeyEvent.VK_Q)pausegame();				
			}
			public void keyTyped(KeyEvent evt){}
			public void keyReleased(KeyEvent evt)
			{
			      int key = evt.getKeyCode();
			      if(key == keyup)moveup = false;
			      if(key == keydown)movedown = false;
			      if(key == keyleft)moveleft = false;
			      if(key == keyright)moveright = false;
			      if(key == KeyEvent.VK_SHIFT)sprintkey = false;			      
			}
		});
	}