• 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!

put in goto next room in main menu and broke my code

i dont know where to begin with this. making an othello game and its mostly functional with a few bugs i cant figureout that whould make it smoother but i tried to put a main menu as a separate room and a button to go to the game board.
it is important to note that if i start the game from the game board room everything works fine and as intended.

so first code break is the animation for tokens flipping wont run. which doesn't make sense cause its in the same code that places the pieces which is in a script but pieces are placed just fine.
second code break is my ending conditions wont run. which is a series of array checkers to see if there are playable moves. whitch doesn't make sense cause i have a code that constantly checks to see if a move is placable otherwise you cant put tokens down and flip the opponents pieces, as well as i have a helper checker that i press a button and it shows me all the possible moves i can make, which is also how my primitive AI works.
the last bug code break i have is i cant get my end game GUI to work or come up, like at all. besides the end game conditions not bringing it up anymore i also have it mapped to the "P" key so i can end the game and have the score tally posted on my endgame GUI whenever i want. the key doesnt work but other keys do work like the show playable moves button or the turn AI on or off toggle, and also my reset button still works.

so no idea why changing rooms just breaks so much. a lot of my code is in scripts. i have tried restarting my computer cause game maker glitches have been known to be fixed sometimes if i do that but these bugs make no gigidy dang sense.
 

TailBit

Member
There is a broom icon, try press it and run the project again. info (quick buttons section)

In short, the quick load chache with all your resources can get corrupt, that button is to clean it up.
 
Last edited:
tried the broom just now. didn't work. tried to make the main object persistent before posting and that didn't help but made the board follow to the main menu.

here is the main step for the board
Code:
if(AI=false||PlayerOneControl==true)
    scrMousePosCheck();
 
scrChecker();

hasMoves=false;
for(i=0;i<8;i++)
    for(j=0;j<8;j++)
        if(board[i,j]==0)
            hasMoves=true;


scrCheckerEnd();                           //the main checker for ending conditions
if(hasMoves==false){
    if(!instance_exists(objGameEnd))
        instance_create_layer(room_width/2,room_height/2,0,objGameEnd);
 
}
and also here is the key that creates a GUI object when the "P" button is pressed
Code:
if(!instance_exists(objGameEnd))
    instance_create_layer(room_width/2,room_height/2,0,objGameEnd);
the objGameEnd just has create, Draw GUI, Draw GUI Begin, and key press R (for reset game).

(edit) tried to change layer depth for instance_create_layer for my animation and got no change and the draw GUI has no layer mask to change depth that I see off-hand.
(edit update) from what I can tell it seems that for some reason changing rooms is inhibiting instance_create_layers for two of my objects.
 
Last edited:
Top