Game Maker : Scrolling credits

Action: scrolling credits then the game ends.

I was searching for this coding for so long, so I really need to do a record.
Hope someone who need this will find it.
I will try my best to explain.

Pre-work

create a obj_credits, put into the room gonna show the credits.

 

Create event

Create event:https://hastebin.com/evaraqeguz.scala
this coding is quite straight forward, so I just write the explanation in the coding.

 

Draw event

Draw event:https://hastebin.com/qojamowuju.lisp

if (y < -string_height(credits)) y = room_height;

i still don’t understand this coding, but it seems like avoiding something about y axis.

 

if (alarm[0] = -1) alarm = 5850;    

I was so happy when I saw this coding.
I tried to figure out the alarm while making The Re:tired Hero, but couldn’t find out until today.

Need to be aware of  the alarm need to be active for using it, so you need to give an action to make it start working.

Usually, alarm is using like:

if (place_meeting (x,y+10,obj_message)
{
   with (obj_message)
   {
      alarm[0] = 180;
   |
|

I find out that most of alarm are using in collision, so again I was so excited to see this coding.

if (alarm[0] = -1)

This line is for checking that is the alarm working or not.
so in this line I wrote, if the alarm[0] is not working.
then the coding next to the bracket is the result of the alarm is not working.

so I set  alarm = 5850;
which means : if the alarm[0] is not working, then set the alarm = 5850 frames.

In the result,  the alarm is active and after 5850 frames,  game maker will trace the coding in the alarm event.

 

Alarm event

Once understand how to make the alarm be active, then alarm is not hard any more (I think XD)

game_end();

The coding in alarm event is usually straight forward, just some basic codes.
( I mean…..in my game :P)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s