Just a start! More problems than I could find with a quick look
- but maybe the ones I did find/suspect will give you a place to start.
One problem is that you haven't made sure what the mouse clicks on is one of the grid squares (based on a quick test, it often isn't) - see the Zeus example in Dunn, et al for more on this. A question for the forum
- am I correct that if there are two or three objects at the point the mouse clicks, the one whose center is closest to the point will be the one selected?
Second, although it's legal (since the full names are different?) the fact that you have two "squares" is confusing for debug - I'd suggest changing one or both names. (I got quite a few error messages in the brief time I played with the game - suspect there may be a deeper error here but didn't find it.)
Third, I suspect that there is something wrong with the "If Square = = Item from Grid1" statement in the hit detection method. I haven't personally used the "Item from ---" command outside of a "For All Together" or "For All In Order" block so not sure what the restrictions are (again - can anyone else help
) but this particular command gave me a lot of trouble (and crashes) when I messed with it.
Finally, try to develop this type of program incrementally. While it's a good idea to have the overall program outline in hand (like you do) before you start - trying to then debug everything at the same time is difficult. My suggestion is to get the outline together like you have - then break it into pieces and get each working individually.