Fixing Frustrating "Features"


Tales of the ball escaping bug

I thought I'd really done it in the previous release. I'd done my play-testing on the devices I have. I'd passed it to my son to try out on his phone (he's normally very good at finding weird and wonderful ways to break my games!). But after 1 hour of releasing V1.2 the ball escaped the play area again!

Motivation

I was instantly demotivated! I had already scratched my head on was to prevent this and thought of tying the debounce to the sound effect playing and also checking the Y position of the ball. In order to only run the debounce when it was most appropriate (When getting trapped between the wall and the paddle). To have this not work again was pretty frustrating.

I left it a while and went through it in my head step by step. I was over-complicating the fix. 

Leverage the Game Engine

My game dev background is more centred in writing my own game engine and less using existing solutions and I think this is the trap I fell into here. I was thinking "What code/logic do I need to do here?" instead of "Can the game engine help me here?" In this period of reflection, thankfully, I took the latter into account; I needed the logic to acted on locally to a region and those regions were easily identifying. In Penjin/PenjinTwo I would have used a CollisionRegion to do this and thankfully Godot does something similar with Area2D. I placed an Area2D on both sides of the game screen where the paddle is close to the wall. I handled the events for the paddle entering and leaving these areas to set a boolean value. This boolean could then be easily checked for if to run the debounce code or not. In the end the fix was really simple and we just have to try and think about what is available to us from the engine or framework and not try to reinvent the wheel.


Relevent Github Commit

Files

Godotoid_1_3_Html.zip Play in browser
Jul 24, 2021
Godotoid_1_3_Win64.zip 13 MB
Jul 24, 2021
Godotoid_1_3_Win32.zip 12 MB
Jul 24, 2021
Godotoid_1_3_Lin64.zip 13 MB
Jul 24, 2021
Godotoid_1_3_Lin32.zip 14 MB
Jul 24, 2021

Get Godotoid

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.