@Override
	public void render(float delta) {
		
		if(Gdx.input.isTouched()){
				currentSelection = -1;
				Vector3 touchPos = new Vector3();
			    touchPos.set(Gdx.input.getX(), Gdx.input.getY(), 0);
			    camera.unproject(touchPos);
			    
			    selector.x = touchPos.x;
			    selector.y = touchPos.y;
		}
		if(!Gdx.input.isTouched()){
			if (selector.overlaps(nextWaveRect))main.setScreen(main.gameScreen);
			if (selector.overlaps(shipRect))main.setScreen(main.shipScreen);
			if (selector.overlaps(fireRect))main.setScreen(main.fireScreen);
			if (selector.overlaps(lightningRect))main.setScreen(main.lightningScreen);
			if (selector.overlaps(saveGameRect))if(!Space.player.gameSaved)Space.player.saveGame();//main.setScreen(main.saveGameScreen);
			if (selector.overlaps(mainMenuRect))main.setScreen(main.mainMenu);
			if (selector.overlaps(upgrade1Rect)){
				//Upgrade Fire Form Duration
				Space.player.upgradeWindDuration();
				selector.x = -400;
				selector.y = -240;
			}
			if (selector.overlaps(upgrade2Rect)){
				//Upgrade Fireball Damage
				Space.player.upgradeWindBladeDamage();
				selector.x = -400;
				selector.y = -240;
			}
			if (selector.overlaps(upgrade3Rect)){
				//Upgrade FireRate
				Space.player.upgradeWindBladeFireRate();
				selector.x = -400;
				selector.y = -240;
			}
			if (selector.overlaps(upgrade4Rect)){
				//Upgrade Health
				Space.player.upgradeWindFormVelocity();
				selector.x = -400;
				selector.y = -240;
			}
		}
		
		if(Gdx.input.isKeyPressed(Keys.ENTER)){
			if(!stillPressed){
			if (currentSelection == 6)main.setScreen(main.gameScreen);
			if (currentSelection == 0)main.setScreen(main.shipScreen);
			if (currentSelection == 1)main.setScreen(main.fireScreen);
			if (currentSelection == 2)main.setScreen(main.lightningScreen);
			if (currentSelection == 5)Space.player.saveGame();//main.setScreen(main.saveGameScreen);
			if (currentSelection == 4)main.setScreen(main.mainMenu);
			}
		}
		if(Gdx.input.isKeyPressed(Keys.UP)){
			if(!stillPressed)currentSelection = (currentSelection-1);
			if (currentSelection <= -1)currentSelection = 6;
			stillPressed = true;
			
			selector.x = -400;
			selector.y = -240;
		}
		if(Gdx.input.isKeyPressed(Keys.DOWN)){
			if(!stillPressed)currentSelection = (currentSelection+1);
			if (currentSelection >= 7)currentSelection = 0;
			stillPressed = true;
			
			selector.x = -400;
			selector.y = -240;
		}
		if(!Gdx.input.isKeyPressed(Keys.DOWN)&&!Gdx.input.isKeyPressed(Keys.UP)&&!Gdx.input.isKeyPressed(Keys.ENTER)){stillPressed = false;}
		
		batch.begin();
		batch.draw(windScreenImg,0,0);
		if (currentSelection == 0||selector.overlaps(shipRect)){
			batch.draw(smallGlowImg, 3, 302 );
		}
		if (currentSelection == 1||selector.overlaps(fireRect)){
			batch.draw(smallGlowImg, 3, 300-55);
		}
		if (currentSelection == 2||selector.overlaps(lightningRect)){
			batch.draw(smallGlowImg, 3, 300 - 111);
		}
		if (currentSelection == 3||selector.overlaps(windRect)){
			batch.draw(smallGlowImg, 3, 300 - 167);
		}
		if (currentSelection == 4||selector.overlaps(mainMenuRect)){
			batch.draw(glowImg, 570, 165);
		}
		if (currentSelection == 5||selector.overlaps(saveGameRect)){
			batch.draw(glowImg,  570, 165-71);
		}
		if (currentSelection == 6||selector.overlaps(nextWaveRect)){
			batch.draw(glowImg,  570, 165-140);
		}
		if (currentSelection == 4||selector.overlaps(upgrade1Rect)){
			batch.draw(upgradeSelectionImg,  167, 336);
		}
		if (currentSelection == 5||selector.overlaps(upgrade2Rect)){
			batch.draw(upgradeSelectionImg,  167+190, 336);
		}
		if (currentSelection == 6||selector.overlaps(upgrade3Rect)){
			batch.draw(upgradeSelectionImg,  167, 336-138);
		}
		if (currentSelection == 7||selector.overlaps(upgrade4Rect)){
			batch.draw(upgradeSelectionImg,  167+190, 336-138);
		}
		main.font.draw(batch, Integer.toString(Space.player.windFormLvl), 690, 392);
		main.font.draw(batch, Integer.toString(Space.player.windFormXp), 690, 392 - 32);
		main.font.draw(batch, Integer.toString((Space.player.windFormLvl*50+Space.player.windFormLvl*Space.player.windFormLvl*Space.player.windFormLvl)-Space.player.windFormXp), 690, 392 - 64);

		//Adjust position of the orbs display based upon how many digits it has. Goes up to 999
		if(Space.player.genericOrbs<10)main.font.draw(batch, Integer.toString(Space.player.genericOrbs), 700, 422);
		else if(Space.player.genericOrbs<100)main.font.draw(batch, Integer.toString(Space.player.genericOrbs), 700-10, 422);
		else main.font.draw(batch, Integer.toString(Space.player.genericOrbs), 700-20, 422);

		
		main.font.draw(batch, Integer.toString(Space.player.windFormDurationCost), 220, 335); //Top Left
		main.font.draw(batch, Integer.toString(Space.player.windBladeDamageCost), 220+190, 335);//Top Right
		main.font.draw(batch, Integer.toString(Space.player.windBladeFireRateCost), 220, 335-138); //Bottom Left
		main.font.draw(batch, Integer.toString(Space.player.windFormVelocityCost), 220+190, 335-138);//Bottom Right
		//batch.draw(glowImg, 0, 240);
		
		batch.end();
	}