public void update(int delta) {
		//After the player is updated, update viewport changes
		if(em.getPlayer()!=null){
			lastPlayerX = em.getPlayer().x;
			lastPlayerY = em.getPlayer().y;
		}
		if(lastPlayerX+MAP_OFFSET_X >= DISPLAY_WIDTH-MAP_EDGE_BUFFER){
			addToMapOffsetX(-1);
		}
		if(lastPlayerY+MAP_OFFSET_Y >= DISPLAY_HEIGHT-MAP_EDGE_BUFFER){
			addToMapOffsetY(-1);
		}

		if(lastPlayerX+MAP_OFFSET_X <= MAP_EDGE_BUFFER){
			addToMapOffsetX(1);
		}
		if(lastPlayerY+MAP_OFFSET_Y <= MAP_EDGE_BUFFER){
			addToMapOffsetY(1);
		}

		input();
		em.update(delta);
		//Bouncing
		bounceOffsetDelta += delta;
		bounceOffset = Math.sin(bounceOffsetDelta/300)*4;
		if(bounceOffsetDelta >= 10000){
			bounceOffsetDelta = 0;
		}
		danceRotation += delta;
		//DEATH
		if(em.getPlayer()==null){
			death = true;
			respawnDelta-=delta;
		}else{
			death = false;
		}

		if(death && respawnDelta <= 1000){ 
			MapData spawn = Molybdenum.getWorldIO().getSpawnMapData();
			respawnDelta = respawnWaitTime;
			spawnPlayer(spawn);
		}
	}