public void startGame(){
		gameInProgress = true;

		long currentTime;

		int lastTick = GAME_TIME_IN_TICKS;
		long startTime = System.currentTimeMillis();

		while(gameInProgress == true){
			currentTime = System.currentTimeMillis();

			//take action
			List<Integer> otherActionsTaken = kbm.getOtherPressedKeys();
			List<Integer> movementActionsTaken = kbm.getPressedMovementKeys();

			//update objects
			try {
				this.handleKeysPressed(otherActionsTaken, movementActionsTaken);
				for(Entity e: gmap.getContainedEntities()){
					e.tick();
				}
				for(Animation a: gmap.getContainedAnimations()){
					a.update();
				}
			} catch (Exception e1) {
				e1.printStackTrace();
			}

			//render objects
			//			gameUI.paintComponents(gameUI.getGraphics());
			//			gameUI.repaint();
			SwingUtilities.invokeLater(new Runnable(){

				@Override
				public void run() {
					// TODO Auto-generated method stub
					gameUI.repaint();
				}

			});


			//check game state
			//TODO: check for victory conditions and end game if needed



			//keep the game cycle consistent
			GAME_TIME_IN_TICKS++;
			if((System.currentTimeMillis()-currentTime) < TICK_RATE){
				try {
					Thread.sleep(TICK_RATE - (System.currentTimeMillis()-currentTime));
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			//Print performance stats.
			long cycleTime = System.currentTimeMillis()-startTime;
			if(cycleTime > 1000){
				//				System.out.println(GAME_TIME_IN_TICKS-lastTick+" ticks per seccond with "+kbm.getEventsSinceLastCall()+" events with cycle time "+cycleTime+"ms.");
				lastTick = GAME_TIME_IN_TICKS;
				startTime = System.currentTimeMillis();
			}
		}
	}