Game
Sweet Smash Test-Build 1.03
11 years ago

How I created my games timer in Game Maker :Studio (standard edition)


Here’s a quick bit of code incase anyone was wondering how i made the timer in my game :)


In a create event:

global.seconds = 0;

global.minutes = 0;

global.hours =0;

In a step event:

if (global.count_up == true)

{

global.seconds += 1/room_speed;

}

if (global.seconds < 60 ) && (global.seconds > 59.9)

{

global.seconds = 0;

global.minutes += 1;

}

if (global.minutes ==60)

{

global.minutes = 0;

global.hours += 1;

}

In a room start event:

NOTE: This is just to set the font and the colour of the text in your game, if left will be ariel (i think)

Font = font_add_sprite(spr_font, ord(” “), 1, 1);

draw_set_color(c_white);


In the Draw Event:

draw_set_font(Font);

if (global.seconds < 10 ) && (global.minutes <10)

{

draw_text (350,32, “0” +string(global.hours) + “:0” + string(global.minutes) + “:0” + string(global.seconds));

}

if (global.seconds >= 10) && (global.minutes >=10)

{

draw_text (350,32, “0” +string(global.hours) + “:” + string(global.minutes) + “:0” +string(global.seconds));

}

else if (global.seconds < 10) && (global.minutes >=10)

{

draw_text (350,32, “0” +string(global.hours) + “:” + string(global.minutes) + “:0” + string(global.seconds));

}

else if (global.seconds >= 10) && (global.minutes < 10)

{

draw_text (350,32, “0” +string(global.hours)+ “:0” + string(global.minutes) + “:” + string(global.seconds));

}

That’s all for yesterday! I’ll keep the blog updated on current progress that i make in the next few days.



0 comments

Loading...

Next up

Bandana Dee the Dream Friend

Family band complete!

Today I tackled drawing different variations of facial expressions for one of the main characters in Eden. What do you think of it? :) Eden: https://gamejolt.com/games/Eden/592698

If you have more of an acquired taste, the restaurants in Niravasi have you covered! Maybe skip the salad bar, though.

it happens

Some time ago, we posted a screenshot of the Mexico level. A curiosity about it is that, like some other scenarios of the game, it was inspired by a real landscape, The Basaltic Prisms of Santa María Regla. It is one of the natural wonders of the country!

Here's a Fredbear sprite i made in Aseprite! I'm pretty proud of this!

(Btw, sorry for the double post! I'll try to post less)

Double Rainbow!!!

I just wanted to introduce you to my latest musical production and hear some opinions about it. Thank you very much.

NEW AWP DESIGN !