Use brick.hit() as a check for whether the brick should be removed.
This commit is contained in:
		@ -61,8 +61,9 @@ public class Ball extends Entity {
 | 
			
		||||
				Vector2 nearest = Utils.nearestPoint(v1.cpy(), segment, new_pos.cpy());
 | 
			
		||||
 | 
			
		||||
				if (nearest.dst(new_pos.x, new_pos.y) <= RADIUS) {
 | 
			
		||||
					brickIterator.remove();
 | 
			
		||||
					brick.hit();
 | 
			
		||||
					if (brick.hit()) {
 | 
			
		||||
						brickIterator.remove();
 | 
			
		||||
					}
 | 
			
		||||
					Utils.reflect(direction, segment.nor());
 | 
			
		||||
					brickCollision = true;
 | 
			
		||||
					break;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user