C
chaslinux
Guest
My game starts in full screen mode. When the player runs out of lives it seems to switch from full screen to windowed mode. I also think there's some kind of error since I get a white screen for a second before it switches to windowed mode.
Death happens when they player collides with another object. I have a few objects that have collision events (with instance_destroy() self and other). After 3 lives are loss the obj_deadplayer object gets called. Obj_deadplayer just changes the angle.
The collision event for each object contains the following snippet of code:
At the end of the object (that the player collides with) I have an asynchronous dialog with the following code:
I can't seem to find where it's switching from full screen to windowed mode, but I suspect this asynchronous dialog is what's causing the switch. There's nothing in rm_highscores Creation Code and it doesn't really even get that far since it asks for the player name first.
Cheers and thanks!
Death happens when they player collides with another object. I have a few objects that have collision events (with instance_destroy() self and other). After 3 lives are loss the obj_deadplayer object gets called. Obj_deadplayer just changes the angle.
The collision event for each object contains the following snippet of code:
Code:
else // this is game over
{
instance_create(0,0,obj_gameover);
// the next line is a bug because it doesn't check to see if player actually
// got a high score ...
global.name = get_string_async("Enter your name (10 characters max): ", "");
// get_name = false;
}
Code:
// listen for async dialog even from obj_player (else) where player game over is triggered
var ident = ds_map_find_value(async_load, "id");
if ident == global.name
{
if ds_map_find_value(async_load, "status") // if ok is click on dialog box
{
global.name = ds_map_find_value(async_load, "result"); //get player's name
// trim the player's name to 10 characters
if string_length(global.name) > 10
{
global.name = string_copy(global.name, 1, 10);
}
// open scores.ini from fasteroids game directory
ini_open("scores.ini")
for (i = 0; i < 10; i++)
{
// populate the scores array with values from the ini file.
global.score_array[i, 0] = ini_read_string(string(i), "Name", "Mr. Fast");
global.score_array[i, 1] = ini_read_real(string(i), "Score", 0);
}
ini_close();
// Look through the array to assign the player spot
for (i = 0; i < 10; i++)
{
if (global.points > global.score_array[i, 1]) // score should be player score
{
// Start at the last element of the array, set each to one before it
for (tscores = 9; tscores > i; tscores--)
{
global.score_array[tscores, 0] = global.score_array[tscores-1, 0];
global.score_array[tscores, 1] = global.score_array[tscores-1, 1];
}
// now set the player score in its spot
global.score_array[i, 0] = global.name;
global.score_array[i, 1] = global.points;
break;
}
}
// Now update the score.ini file with updated info
ini_open("scores.ini");
for (i = 0; i < 10; i++)
{
ini_write_string(string(i), "Name", global.score_array[i, 0]);
ini_write_real(string(i), "Score", global.score_array[i, 1]);
}
ini_close(); // close the file
room_goto(rm_highscores);
}
}
Cheers and thanks!