Posted By: aslan123
level changing problems - 04/30/07 17:34
hi
I want to be able to change levels which I know how to do but when the next level loads the health, lives and others are restored to the values that are loaded in the first level. say i gain an extra life in level 1 and my health drops from 100 to 80, i want those values to be displayed in level 2
does anyone know how to do this
here is my current level changing code
*************************************************************************
bmap loading_lv = <newlevelload.bmp>; //Loading screen
panel loadingscreen
{
bmap = loading_lv; //loading screen name
flags = refresh,d3d;
}
function load_new_level()
{
/*wait(1);
if (EVENT_TYPE == event_impact)
{
*/
loadingscreen.pos_x = (screen_size.x - bmap_width(loading_lv))/2; //centers loading screen
loadingscreen.pos_y = (screen_size.y - bmap_height(loading_lv))/2;
loadingscreen.visible = on; //displays loading screen
wait(10);
my = null;
freeze_mode = 1;
loadingscreen.visible = off; //clears screen
bmap_purge(loading_lv);
load_level ("testlevel2.wmb"); //level name
wait(2);
freeze_mode = 0;
//}
}
ACTION levelchange //*assign this to a map entity blocking the way out of the level*/!!!!
{
//MY.INVISIBLE = ON; //makes entitie invisible
MY.ENABLE_IMPACT = ON; //enables player impact
MY.EVENT = load_new_level; //function name
********************************************************************
I want to be able to change levels which I know how to do but when the next level loads the health, lives and others are restored to the values that are loaded in the first level. say i gain an extra life in level 1 and my health drops from 100 to 80, i want those values to be displayed in level 2
does anyone know how to do this
here is my current level changing code
*************************************************************************
bmap loading_lv = <newlevelload.bmp>; //Loading screen
panel loadingscreen
{
bmap = loading_lv; //loading screen name
flags = refresh,d3d;
}
function load_new_level()
{
/*wait(1);
if (EVENT_TYPE == event_impact)
{
*/
loadingscreen.pos_x = (screen_size.x - bmap_width(loading_lv))/2; //centers loading screen
loadingscreen.pos_y = (screen_size.y - bmap_height(loading_lv))/2;
loadingscreen.visible = on; //displays loading screen
wait(10);
my = null;
freeze_mode = 1;
loadingscreen.visible = off; //clears screen
bmap_purge(loading_lv);
load_level ("testlevel2.wmb"); //level name
wait(2);
freeze_mode = 0;
//}
}
ACTION levelchange //*assign this to a map entity blocking the way out of the level*/!!!!
{
//MY.INVISIBLE = ON; //makes entitie invisible
MY.ENABLE_IMPACT = ON; //enables player impact
MY.EVENT = load_new_level; //function name
********************************************************************