[GAME] Brick Smash! Check out my customised version of BlockBreaker

Brick Smash!

Hi all, I’ve just completed the chapter on BlockBreaker and have spent a little bit of time customising my version - now titled Brick Smash!
I’ve added some extra customisations using what I’ve learnt so far in the course, or through my own Unity research such as:
Custom paddle and collider shape
Lives and a life counter
Level number splash screens
10 progressively harder levels
5 brick types
Custom sprites
Custom sounds
Modified play space to further reduce chances of "boring loops"
Secret cheat (autoplay - see if you can find it)
Constraining and hiding the mouse cursor (I found it distracting having it on screen near the paddle)
Esc key to exit to main menu while in game

If I had the time / knowledge:
I would have liked to add powerups like the great Arkanoid but think it’d be time consuming and hit/miss with my current basic coding knowledge - I think I’ll learn far better ways to do this later in the course.
I tried and failed resetting the ball and paddle after loss of life while keeping the destroyed brick configuration, so now you just have to start the level again instead.
Could not get a fade in / fade out level transition working, there are plenty of guides on the internet but they’re either for Unity 4.x and no longer work or they’re far more complex than I can currently implement.

I’ve not yet managed to complete all 10 levels in one sitting, so please let me know if you do - the last level has pretty cool variation and theme, and should also be pretty hard to beat!

Really enjoying the course so far, the further in I get the more my brain starts to fill in the gaps and imagine the vast possibilities of what can be accomplished in Unity.

Welcome any comments

http://gamebucket.io/game/14c6ea54-e8f1-4a80-bb69-f9ef2c753c33

Cheers!
Foundryworker

4 Likes

It’s pretty fun. How did you hide the mouse cursor in the game?

Thanks Justin, I hid the cursor with the following code in my Paddle.cs script, as this is called at a time when the cursor is no longer needed. CursorLockMode.Confined limits the cursor to the game window also.

void Start() {
ball = GameObject.FindObjectOfType(); //unrelated to cursor state
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Confined;
}

As the cursor would remain hidden from that point on, I put a prefab with script that re-enabled the cursor in each scene that needed the mouse cursor again for clicking menu buttons, e.g. Start, Win, Lose.

void Start () {
Cursor.visible = true;
Cursor.lockState = CursorLockMode.None;
}

Note this is for Unity 5.x - the code for hiding the cursor is different in 4.x and I personally had trouble with it in the older version. Works great in 5.x

I enjoyed the game but only felt slightly weird from the way the game transition from start screen, level 0 to level 1. Other than that great sound and great design.

Thank you Mr.Foundry for sharing this cursor code. I am using Unity 5 so this will work as you’ve described. Smart to add it as a prefab as well.