Hello world, welcome to the seventh Dev with Dave Game Progress Update. I’m happy to say that I have at least managed to get the button handling system working this time round, even if there is only one button so far!
The button handling system is a simple set of functions which can add a button to a UI page in a single command, check for button presses every frame, and also handle the response to each button press.
The system uses variables to track whether the mouse has been pressed, is being held down, or has been released. This will allow the buttons to animate eventually.
The button properties are all stored in an array the same as the other two UI element types I’ve created.
Problems I’ve faced
The biggest issue I have had whilst creating the button handling system, was the fact that the scanlines overlay was interfering with the button sprite detection. Any checks were simply returning the overlay sprite ID instead of the button below it which was the intended target.
I fixed this by simply moving the sprite offscreen which I check for button presses, then move it back before the screen updates. It’s not an elegant fix, but It will do for now.
The second problem is that I have found it very difficult to make recognisable icons using the low resolution that the game is based on.
In the next update
Over the next two weeks I’m going to spend some time creating graphics for the various UI screens, so hopefully lots more buttons and stuff for you to see (even if it’s not entirely working by the time the next update is here)
I also need to add a system to allow pickups to the gameplay, to allow the player to use powerups. Although I doubt this will make it in until the update after the next one.
See you next time 🙂