// Path: jastroblast-desktop/src/org/doublelong/tests/controller/ShipController.java
// public class ShipController extends InputAdapter
// {
// 	private final static float MAX_VELOCITY = 100f;
// 	private final Ship ship;
// 	private float stillTime = 0f;
// 
// 	public ShipController(Ship ship)
// 	{
// 		this.ship = ship;
// 		Gdx.input.setInputProcessor(this);
// 	}
// 
// 
// 	public void processControls()
// 	{
// 		Vector2 vel = this.ship.getBody().getLinearVelocity();
// 		Vector2 pos = this.ship.getBody().getPosition();
// 
// 		// cap max velocity on x
// 		if(Math.abs(vel.x) > MAX_VELOCITY)
// 		{
// 			vel.x = Math.signum(vel.x) * MAX_VELOCITY;
// 			vel.y = Math.signum(vel.y) * MAX_VELOCITY;
// 			this.ship.getBody().setLinearVelocity(vel.x, vel.y);
// 		}
// 
// 		// calculate stilltime & damp
// 		if(!Gdx.input.isKeyPressed(Keys.LEFT) && !Gdx.input.isKeyPressed(Keys.RIGHT)
// 				&& !Gdx.input.isKeyPressed(Keys.UP) && !Gdx.input.isKeyPressed(Keys.DOWN))
// 		{
// 			this.stillTime += Gdx.graphics.getDeltaTime();
// 			this.ship.getBody().setLinearVelocity(vel.x * 0.99f, vel.y * 0.99f);
// 			this.ship.getBody().setAngularDamping(2f);
// 		}
// 		else
// 		{
// 			this.stillTime = 0;
// 		}
// 
// 		if(!Gdx.input.isKeyPressed(Keys.LEFT) && !Gdx.input.isKeyPressed(Keys.RIGHT) && this.stillTime > 0.2)
// 		{
// 			this.ship.getFixture().setFriction(100f);
// 			//			this.ship.getFixture().setFriction(100f);
// 		}
// 		else
// 		{
// 			this.ship.getFixture().setFriction(0.2f);
// 			//			this.ship.getFixture().setFriction(0.2f);
// 		}
// 
// 
// 		// apply left impulse, but only if max velocity is not reached yet
// 		if(Gdx.input.isKeyPressed(Keys.LEFT) && vel.x > -MAX_VELOCITY)
// 		{
// 			this.ship.getBody().applyAngularImpulse(20f, false);
// 			//this.ship.getBody().applyLinearImpulse(-2f, 0, pos.x, pos.y);
// 		}
// 
// 		// apply UP impulse
// 		if (Gdx.input.isKeyPressed(Keys.UP) && vel.y > -MAX_VELOCITY)
// 		{
// 			this.ship.getBody().applyLinearImpulse(0, 2f, pos.x, pos.y, true);
// 		}
// 
// 		// apply UP impulse
// 		if (Gdx.input.isKeyPressed(Keys.DOWN) && vel.y < MAX_VELOCITY)
// 		{
// 			this.ship.getBody().applyLinearImpulse(0, -2f, pos.x, pos.y, true);
// 		}
// 
// 		// apply right impulse, but only if max velocity is not reached yet
// 		if(Gdx.input.isKeyPressed(Keys.RIGHT) && vel.x < MAX_VELOCITY)
// 		{
// 			this.ship.getBody().applyLinearImpulse(2f, 0, pos.x, pos.y, true);
// 		}
// 	}
// }


import org.doublelong.tests.controller.ShipController;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.Fixture;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
package org.doublelong.tests.entities;



public class Ship
{
	private final World world;

// Path: jastroblast-desktop/src/org/doublelong/tests/controller/ShipController.java
// public class ShipController extends InputAdapter
// {
// 	private final static float MAX_VELOCITY = 100f;
// 	private final Ship ship;
// 	private float stillTime = 0f;
// 
// 	public ShipController(Ship ship)
// 	{
// 		this.ship = ship;
// 		Gdx.input.setInputProcessor(this);
// 	}
// 
// 
// 	public void processControls()
// 	{
// 		Vector2 vel = this.ship.getBody().getLinearVelocity();
// 		Vector2 pos = this.ship.getBody().getPosition();
// 
// 		// cap max velocity on x
// 		if(Math.abs(vel.x) > MAX_VELOCITY)
// 		{
// 			vel.x = Math.signum(vel.x) * MAX_VELOCITY;
// 			vel.y = Math.signum(vel.y) * MAX_VELOCITY;
// 			this.ship.getBody().setLinearVelocity(vel.x, vel.y);
// 		}
// 
// 		// calculate stilltime & damp
// 		if(!Gdx.input.isKeyPressed(Keys.LEFT) && !Gdx.input.isKeyPressed(Keys.RIGHT)
// 				&& !Gdx.input.isKeyPressed(Keys.UP) && !Gdx.input.isKeyPressed(Keys.DOWN))
// 		{
// 			this.stillTime += Gdx.graphics.getDeltaTime();
// 			this.ship.getBody().setLinearVelocity(vel.x * 0.99f, vel.y * 0.99f);
// 			this.ship.getBody().setAngularDamping(2f);
// 		}
// 		else
// 		{
// 			this.stillTime = 0;
// 		}
// 
// 		if(!Gdx.input.isKeyPressed(Keys.LEFT) && !Gdx.input.isKeyPressed(Keys.RIGHT) && this.stillTime > 0.2)
// 		{
// 			this.ship.getFixture().setFriction(100f);
// 			//			this.ship.getFixture().setFriction(100f);
// 		}
// 		else
// 		{
// 			this.ship.getFixture().setFriction(0.2f);
// 			//			this.ship.getFixture().setFriction(0.2f);
// 		}
// 
// 
// 		// apply left impulse, but only if max velocity is not reached yet
// 		if(Gdx.input.isKeyPressed(Keys.LEFT) && vel.x > -MAX_VELOCITY)
// 		{
// 			this.ship.getBody().applyAngularImpulse(20f, false);
// 			//this.ship.getBody().applyLinearImpulse(-2f, 0, pos.x, pos.y);
// 		}
// 
// 		// apply UP impulse
// 		if (Gdx.input.isKeyPressed(Keys.UP) && vel.y > -MAX_VELOCITY)
// 		{
// 			this.ship.getBody().applyLinearImpulse(0, 2f, pos.x, pos.y, true);
// 		}
// 
// 		// apply UP impulse
// 		if (Gdx.input.isKeyPressed(Keys.DOWN) && vel.y < MAX_VELOCITY)
// 		{
// 			this.ship.getBody().applyLinearImpulse(0, -2f, pos.x, pos.y, true);
// 		}
// 
// 		// apply right impulse, but only if max velocity is not reached yet
// 		if(Gdx.input.isKeyPressed(Keys.RIGHT) && vel.x < MAX_VELOCITY)
// 		{
// 			this.ship.getBody().applyLinearImpulse(2f, 0, pos.x, pos.y, true);
// 		}
// 	}
// }


// Path: jastroblast-desktop/src/org/doublelong/tests/entities/Ship.java
import org.doublelong.tests.controller.ShipController;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.Fixture;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;

package org.doublelong.tests.entities;



public class Ship
{
	private final World world;

	public ShipController controller;