Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sangpham2710

Pages: [1]
1
I'm coding a minesweeper game, and in the game, there are 2 types of buttons: the cells of the board and the utility buttons like restart and save game.
I coded the game in a procedural programming style, I wanna know how do I check which kind of button is pressed and thereby trigger different actions for those buttons elegantly. Because since we only have the mouse X and Y coordinates from the mouse event, the way I tended to do it is to check whether a button has the mouse cursor in it or not when the mouse is being pressed. But this way of doing it is very clumsy and it starts being tedious when I have to do it for each of the scenes in the game.
I know you can use OOP and check every type of "clickable" object every scene but I coded mine in console in a procedural style and I don't wanna waste time changing it into OOP style.

Pages: [1]
anything