Breakin

By Jake Meinershagen

Back again for game 2 of the 20 Games Challenge. I decided to do a clone of breakout since part of the purpose of game 2 was to reuse assets from game 1. This one took a bit longer since I was working in small bits between other life stuff. In total, I don't think it took signigicantly longer than the first game.

I was able to reuse a fair bit. I needed to shift a bit of stuff when copying from Ping, since the paddle is the other way. The ball code was pretty reusable. I had to change the calculation for the angle around so that it worked for a horizontal paddle instead of a vertical one.

There are a couple of workarounds I did. I don't think any of them are too egregious. The most interesting one is when the ball goes behind the paddle and a life is removed. I have a signal from the bounds area to remove a life. I originally had the signal connected to both the bounds.gd script and the ui.gd script. The bounds script would remove the life on the GameState autoload and the ui script would update the lives label. The only problem is that Godot doesn't seem to execute the signals in any order that can be changed in the editor. So, I moved the remove life call to the UI. I just call the remove life to lower the number of lives and then update the text right after. I don't love having the function call in the ui script, but I like it better than the other option I came up with. My other idea had been to do the remove life call in the bounds script and then just update the lives text in the process function on the ui script. However, the way I did it is less resource intensive, so I went that way.

The Game is here
The Source Code is here



Previous TOC