Set launch angle
This commit is contained in:
		@ -2,6 +2,7 @@ package com.me.brickbuster.entity;
 | 
			
		||||
 | 
			
		||||
import com.badlogic.gdx.graphics.Color;
 | 
			
		||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
 | 
			
		||||
import com.badlogic.gdx.math.MathUtils;
 | 
			
		||||
import com.badlogic.gdx.math.Vector2;
 | 
			
		||||
import com.me.brickbuster.BrickBuster;
 | 
			
		||||
 | 
			
		||||
@ -38,7 +39,8 @@ public class Ball extends Entity {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void launch() {
 | 
			
		||||
		direction = new Vector2(0, 1);
 | 
			
		||||
		float angle = MathUtils.random(MathUtils.PI/2) + MathUtils.PI/4;
 | 
			
		||||
		direction = new Vector2(MathUtils.cos(angle), MathUtils.sin(angle));
 | 
			
		||||
		speed = 5;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -23,6 +23,5 @@ public class Block extends Entity {
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public void update(float dt) {
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user