• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

black bars during a cutscene(UNSOLVED)

F

fxokz

Guest
Basically when a cutscene starts in my game i want black bars from both top and bottom of the view to close in to cover 2 thirds of the screen (temporary) Im trying to make the black bars start at the top and bottom of the screen and slowly come down and stop when they reached a limit so i created this script which gives me an error:

Code:
//black bars
var b1, b2 start1, start2;
b1 = view_yview+view_hview/3;
b2 = view_yview+((-view_hview)/3);
start1 = view_yview;
start2 = view_yview+view_hview;
draw_set_colour(c_black);
draw_rectangle(view_xview, view_yview, view_xview+view_wview,start1, false);
draw_rectangle(view_xview, view_yview, view_xview+view_wview,start2, false);

if (start1 > b1) start1--;
if (start2 < b2) start2++;


It doesnt even tell me whats wrong in the execute code box. Is there an easier way to achieve what im trying to do, am i on the right path even?


EDIT this is the bottom half that i didnt include above. theyre both in the same script. No im not happy with what ive achieved so far xd

Code:
//sequence
if room = rm_cutscene
{
    if timer > 1
    {
        timer--;
    } else if timer <= 1
    {
        if instance_exists(obj_player)
        {
            if (obj_player.x < 300)
            {
                obj_player.x += 3;
            } else if (instance_exists(obj_player))
            {
                if obj_player.x >= 300
                {
                    if timer2 >1
                    {
                        timer2--;
                    } else if timer <= 1
                    {
                        draw_set_alpha(0.5);
                        draw_set_colour(c_white);
                        draw_rectangle((obj_player.x)+15, (obj_player.y)-20, (obj_player.x)+200, (obj_player.y)+10, false);
                        draw_set_colour(c_black);
                        draw_set_alpha(1);
                        draw_text((obj_player.x)+17, (obj_player.y)-15, "Where am I?")
                        timer3--;
                        if timer3 <=1
                        {
                            global.cutscene = false;
                            exit;
                        }
                    }
                }
            }
        }
    }
}
 
Last edited:
F

fxokz

Guest
In the second line, you missed a ','. Where you initialized your 'var' variables. ;)

edit: Thank you, here is what my code looks like now, i changed a few things but now nothing happens when i start my game. The black bars still dont stretch and fill up 2 quarters of the view... I have absolutely no idea if im even coding it efficiently

Code:
//black bars
var b1, b2, start1, start2;
b1 = view_yview+view_hview/3;
b2 = view_yview+((-view_hview)/3);
start1 = view_yview;
start2 = view_yview+view_hview;
draw_set_colour(c_black);
draw_rectangle(view_xview, view_yview, view_xview+view_wview,start1, false);
draw_rectangle(view_xview, view_yview+view_hview, view_xview+view_wview,start2, false);

if (start1 < b2) start1++;
if (start2 > b1) start2--;
 
Last edited:
Top