This is my first StackExchange post, so forgive me if I make a silly mistake.
Getting to the point, I've made a simple Mario-esque platformer where whenever you die, game over text is printed to the middle of wherever you are on the screen. Dying is an Instance Destroy event triggered by various objects, while the Draw GUI event is triggered by a separate object placed in each room.
The third and final "level" room is where text doesn't appear no matter where you die. I've made multiple attempts to fix this, but nothing appears. I believe part of it involves the room's layout; the other levels were simple "go to the right" styled rooms. The third room goes vertically and is much taller.
The issue also likely involves the camera. I'm using viewport[0]
. Room properties are as follows:
Room settings - Width: 3000, Height: 3000
Clear Viewport Background: ON
Camera - X Pos: 0, Y Pos: 2250, Width: 1080, Height: 768
Viewport - X Pos: 0, Y Pos: 0, Width: 1080, Height: 768
Following object:
obj_playercube
(player object) (Hor. border: 400, Vert. border: 400, Hor. speed: 200, Vert. speed: 200)
This is the code for obj_gameover
's Draw GUI event:
draw_set_font(fnt_dead);
draw_set_halign(fa_center);
draw_set_valign(fa_middle);
draw_set_color(c_white);
// (x, y) coordinates of the center of the view
var center_x = view_xview[0] + view_wview[0]/2;
var center_y = view_yview[0] + view_hview[0]/2;
if (!instance_exists(obj_playercube))
{
draw_text(center_x, center_y, "Game Over\n Press Enter to restart from current room.");
show_debug_message("Game over has printed");
}
I'm sure it's a matter of adding more variables to account for the room's differing properties compared to the others. I'll try to figure it out myself in the meantime.