game-makergmlgame-maker-studio-2game-maker-language

Issue with game over room


I am currently making my first Game Maker Studio 2 game in GML (the space rocks one from the tutorial series in the yoyo YouTube channel) and I don't know why but when I tried to run the game it didn't open and the IDE says that the issue is in the following code:

switch(room){
    case rm_game:
        draw_text(20, 20, "SCORE: " + string(score));
        draw_text(20, 40, "LIVES: " + string(lives));
        break;
    
    case rm_start:
        draw_set_halign(fa_center);
        var c = c_yellow;
        draw_text_transformed_color(
            room_width/2, 100, "SPACE ROCKS",
            3, 3, 0, c, c, c, c, 1
        );
        draw_text(
            room_width/2, 200,
            @"Score 1,000 points to win!
            
UP: move
LEFT/RIGHT: change direction
SPACE: shoot
            
>> PRESS ENTER TO START <<
            "
        );
        draw_set_halign(fa_left);
        break;
    
    case rm_win:
        draw_set_halign(fa_center);
        var c = c_lime;
        draw_text_transformed_color(
            room_width/2, 200, "YOU WON!",
            3, 3, 0, c, c, c, c, 1
        );
        draw_text(
            room_width/2, 300,
            "PRESS ENTER TO RESTART"
        );
        break;
    
    case rm_gameover:
        draw_set_halign(fa_center);
            var c = c_red;
            draw_text_transformed_color(
                room_width/2, 150, "GAME OVER",
                3, 3, 0, c, c, c, c, 1
            );
            draw_text(room_width/2, 250, "FINAL SCORE: " + string(score);
            draw_text(room_width/2, 300, "PRESS ENTER TO RESTART");
        break;
}

I checked and it says that the problem is in the lines 48, 49 and 51, but I definitely can't find what's wrong in this code.


Solution

  • draw_text(room_width/2, 250, "FINAL SCORE: " + string(score); is missing another closing ) at the end.