[GAME] My Block Breaker Game!


You can play my game here:

Added lives system, 5 levels, a semi-circular paddle for better control. Custom audio track from my music band Chantage, let me know if you like the song :slight_smile:

The only bug is that the ball still sometimes enters a “boring loop”, especially near the wall colliders. Perhaps I need to somehow check if the ball is in a certain range of linear movement, and add some velocity in x or y direction accordingly. I will be glad if anyone who has already solved the problem, can leave a short comment.

Best Regards,


I upgraded to v5 and built for WebGL, and fixed the “boring loop” problem. You can play the latest version here:

The approach I used for the boring loop bug, is to check the velocity in each direction, and if it’s below 1, add 1 in that direction. The random.range approach doesn’t solve the problem. And if you add velocity in each bounce the ball speeds up too fast. You can find the actual code from the ball.cs below, it’s not very elegant but it works.

	void OnCollisionEnter2D (Collision2D collision) {
		if (hasStarted){
			if(this.GetComponent<Rigidbody2D>().velocity.x < 1 & this.GetComponent<Rigidbody2D>().velocity.x > 0){
				this.GetComponent<Rigidbody2D>().velocity += new Vector2(1f,0f);
			if(this.GetComponent<Rigidbody2D>().velocity.x < 0 & this.GetComponent<Rigidbody2D>().velocity.x > -1){
				this.GetComponent<Rigidbody2D>().velocity += new Vector2(-1f,0f);
			if(this.GetComponent<Rigidbody2D>().velocity.y < 1 & this.GetComponent<Rigidbody2D>().velocity.y > 0){
				this.GetComponent<Rigidbody2D>().velocity += new Vector2(0f,1f);
			if(this.GetComponent<Rigidbody2D>().velocity.y < 0 & this.GetComponent<Rigidbody2D>().velocity.y > -1){
				this.GetComponent<Rigidbody2D>().velocity += new Vector2(0f,-1f);

Oh, that’s a nice, simple idea. Perhaps I’ll try that for my version, too. Strange gravity behavior and boring loops are death reason No.1 for many of my players. Combined with the scoring system I implemented, some have been quite frustrated, :laughing:.

Privacy & Terms