• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML [solved] turn based strategy game giving me minor problems

M

mst3kdavid

Guest
Each player can move two objects per turn.

The first object to move can not move even when it is that players turn
The second object moves just fine once that players turn comes around.
This leads me to believe that the code below is not being referenced by the first object moved and only the second but I can not figure out why. (can only one object call a global variable at a time?)

I've tested all the code that calls the variable movedthisturn and the code below seems to be the source of my problem.
Code:
if global.redturn > 2
    {
    movedthisturn=0
    global.redturn=0
    global.greenturn=1
}
Extra info:
The variable movedthisturn is changed in the code above, when it is moved to a seperate room, and moved to another tile.
If an object is moved to a separate room it behaves the same as if it were the first object mentioned above regardless of if it was moved first or second. (other objects that player owns can still move)
 
M

mst3kdavid

Guest
I just had to many instances calling my global variable which for some reason prevented some objects from working correctly
 
Top