@Override
	public void update(){
		
		if(getLives() <= 0){
			dead = true;
			this.fire.dead = true;
		}
		
		if(newBorn){
			--counter;
		}
		if(counter == 0){
			newBorn = false;
			counter = Constants.INVINSIBLE;
		}
		action = control.action(game);
		
		if(action.thrust == 1){
			thrusting = true;
			showFire();
		}
		else{
			image = Constants.SHIP;
			thrusting = false;
			removeFire();
		}
		
		if(action.shoot && timeShotLeft <= 0){
			shootBullet();
			timeShotLeft = timeShot;
		}
		
		--timeShotLeft;
		
		direction.rotate((Constants.SHIP_STEER_RATE * action.turn) % Constants.SHIP_MAX_STEER_RATE);
		rotate = direction.theta() + Math.PI / 2;
		//double acceleration = action.thrust;
		//if(acceleration > Constants.SHIP_MAG_ACC) acceleration = Constants.SHIP_MAG_ACC;
		
		velocity.add(direction, Constants.SHIP_MAG_ACC * action.thrust * Constants.DT);
		velocity.mult(Constants.SHIP_LOSS);
		
		position.add(velocity, Constants.DT);
		position.wrap(Constants.FRAME_WIDTH, Constants.FRAME_HEIGHT);
	}