Ahh ok, I was doing it inproperly. (I had drawing code in the detectSelection and the handleMouse) I went ahead and fixed it up, and this is how it looks.
|5|| mx = mouse_x;|
|6|| my = mouse_y;|
|7|| if(game == 0)|
|9|| if(checkTimer(100) > 0)|
|13|| detectSelection(mx, my);|
I believe that's the correct way to do it, but I have two questions.
In handleMouse, I just pick out what action to do depending on what I have selected when I click on the left mouse button, is that considered logic?
And whenever I close the game and I'm selecting something, it occassionally crashes the game. I'm not sure why, but this is the code I have for when I close the game:
It's called right after the mainLoop is called if you wanted to know. I don't think there is anything wrong with that, but obviously something is wrong. Oh, and thanks miran.