0

何か案は ?私はそれを作ろうとしました-ちょっとやりました-あなたが死んだ後、「ゲームオーバー」テキストが表示され、「再起動するにはRを押してください」と表示され、テキストは消えませんでした。

前もって感謝します

4

1 に答える 1

0

これは複数の方法で行うことができますが、基本は、オブジェクトがすべての前面にくるように十分に奥行きの浅いオブジェクトが必要であり、次に大きな長方形とその上にテキストを描画することです。

ルーズ オブジェクトを作成できます。obj_gameover - 次のイベントがあります。

キーボード R を押す: ゲームを再起動する Draw GUI イベント: コード:

draw_set_color(c_black); //The color of the screen
draw_rectangle(0, 0, display_get_gui_width(), display_get_gui_height(), 0); //Draw a big rectangle over the GUI
draw_set_color(c_white); //The color of the text
draw_set_font(fnt_myfont); //The font you want for the text
draw_set_halign(fa_center); //Align the text in the center of the screen
draw_text(display_get_gui_width()/2, display_get_gui_height()/2,  "Game over!##Press R to restart"); //Draw a text in the center of the GUI. The # sign is a newline in gamemaker.
于 2015-11-11T13:24:19.830 に答える