L
Lerchprinz
Guest
hey, i am watching the Plattformer Tutorial from shaun and one thing never worked at my code...
The TRANS.MODE restart, next, intro etc. allways worked. except the GOTO event. when i make this the screen just gets black all the time. any ideas?
code:
Create:
step:
and here is my transition script
with(obj_transition){
mode = argument[0];
if(argument_count > 1) target = argument[1];
}
Thanks
The TRANS.MODE restart, next, intro etc. allways worked. except the GOTO event. when i make this the screen just gets black all the time. any ideas?
code:
Create:
Code:
/// @description Size Variables and mode setup
w = display_get_gui_width();
h = display_get_gui_height();
h_half = h*0.5;
enum TRANS_MODE{
OFF,
NEXT,
GOTO,
RESTART,
INTRO
}
mode = TRANS_MODE.INTRO;
percent = 1;
target = room;
Code:
/// @description Progress the transition
if(mode != TRANS_MODE.OFF){
if(mode == TRANS_MODE.INTRO){
percent = max(0,percent - max((percent/10),0.005));
}else{
percent = min(1.2,percent + max(((1.2 - percent)/10),0.005));
}
}
if(percent == 1.2) || (percent == 0){
switch(mode){
case TRANS_MODE.INTRO:
{
mode = TRANS_MODE.OFF;
break;
}
case TRANS_MODE.NEXT:
{
mode = TRANS_MODE.INTRO;
room_goto_next();
break;
}
case TRANS_MODE.GOTO:
{
room_goto(target);
break;
}
case TRANS_MODE.RESTART:
{
game_restart();
break;
}
}
}
and here is my transition script
with(obj_transition){
mode = argument[0];
if(argument_count > 1) target = argument[1];
}
Thanks
Last edited by a moderator: