游戏结束房间的问题
Issue with game over room
我目前正在用 GML 制作我的第一个 Game Maker Studio 2 游戏(space 摇滚 yoyo YouTube 频道教程系列中的一个)我不知道为什么,但是当我尝试 运行 游戏没有打开,IDE 表示问题出在以下代码中:
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;
}
我查了一下,说问题出在第 48、49 和 51 行,但我绝对找不到这段代码有什么问题。
draw_text(room_width/2, 250, "FINAL SCORE: " + string(score);
末尾缺少另一个结尾 )
。
我目前正在用 GML 制作我的第一个 Game Maker Studio 2 游戏(space 摇滚 yoyo YouTube 频道教程系列中的一个)我不知道为什么,但是当我尝试 运行 游戏没有打开,IDE 表示问题出在以下代码中:
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;
}
我查了一下,说问题出在第 48、49 和 51 行,但我绝对找不到这段代码有什么问题。
draw_text(room_width/2, 250, "FINAL SCORE: " + string(score);
末尾缺少另一个结尾 )
。