Ubuntu Pastebin

Paste from matty_r at Mon, 26 Oct 2015 12:20:01 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
public void turn(boolean swap){
		direction += (swap) ? turnSpeed : -turnSpeed;
		
		float velocityX;
		float velocityY;
		float directionX;
		float directionY;
		
		directionX = (float) Math.cos(Math.toRadians(Vehicle.this.direction));			
		directionY = (float) Math.sin(Math.toRadians(Vehicle.this.direction));
		
		if(!isTurret){
			if(swap){
				hardPoint.x -= directionX;
				hardPoint.y -= directionY; 
			} else {
				hardPoint.x += directionX;
				hardPoint.y += directionY;
			}
		}
		if(direction >= 360)
			direction = 0;
		else if(direction < 0)
			direction = 359;
	}
Download as text