GameMaker Tutorial - Create a Count-up Clock or Timer
In this tutorial I'll show you how to create a count-up clock or timer for your game. It's especially good to have in games where score is based on time survived.
Note ▶ I noticed the DRAW code isn't all it could be and needs some tweaking.
Change the first if statement from
if (seconds less than 10) && (minutes less than 10)
to
if (seconds less than or equal to 10) && (minutes less than 10)
This'll fix the split-second glitch when seconds reach 10 and it still displays an extra 0 before it.
If you wish to remove the decimals then do the following ▶
In the DRAW EVENT of the obj_countup_controller add this:
var draw_seconds;//we just want a temporary variable
draw_seconds = floor(seconds);//this'll round down the seconds counter and not display the decimals.
Then replace all instances of seconds in that draw event with the temporary variable draw_seconds.
Support This Channel ▶ https://www.patreon.com/GravityShiftGames
BTC Donations ▶ 3QysPKf3JVjXwCo2m4tXQQ1venEcamJ3dz
Follow me on Facebook ▶ http://tinyurl.com/opjtvq4
Follow me on Instagram ▶ https://instagram.com/jp_damstra
Follow me on Twitter ▶ https://twitter.com/@GShiftGames
▼ Useful Links and Resources ▼
GM 8 Project File ▶ http://tinyurl.com/jz5b969
Want to stick this timer to the view and have it follow your player? Then check out my tutorial on making a quick heads up display ▶ http://tinyurl.com/znxgkyv
Coming up next time - I'll show you how to create the more complex stopwatch ▶ http://tinyurl.com/jnqf9c5
▼ More ▼
General Game Maker Playlist ▶ http://tinyurl.com/omg4xxs
Game Maker Networking ▶ http://tinyurl.com/oauqu5y
Happy Coding :D
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «GameMaker Tutorial - Create a Count-up Clock or Timer», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.