L
LunarIceCream
Guest
I was following the Shaun Spalding Platformer tutorial(part 7), and was at the part of having the game draw black bars when it restarted, but it wouldn't work, and this is what happened when I tried.
Before Pressing R, theres a 1 in the corner of the screen(debug).
After pressing R, the 1 has changed into a 0.01, and the beginning of the bars appear at the top and bottom, but the game doesn't restart, and nothing else changes if I press R again.
All the relevant code posted here.
Before Pressing R, theres a 1 in the corner of the screen(debug).
After pressing R, the 1 has changed into a 0.01, and the beginning of the bars appear at the top and bottom, but the game doesn't restart, and nothing else changes if I press R again.
All the relevant code posted here.
Code:
///@desc Key Press - R
slidetrans(TRANS_MODE.RESTART);
Code:
/// @description Draw Black Bars
if (mode != TRANS_MODE.OFF)
{
draw_set_color(c_black);
draw_rectangle(0,0,w,percent*h_half,false);
draw_rectangle(0,h,w,h-(percent*h_half),false);
}
draw_set_color(c_white)
draw_text(50,50,string(percent));
Code:
/// @desc Size variables & mode setup
w = display_get_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;