SurWeaver

[GML] Chaotic analog clock

Feb 8th, 2020
392
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ////CREATE EVENT
  2. x = room_width/2;
  3. y = room_height/2;
  4. numbers = makeList(0, 59); //script that makes a ds_list with certain range of numbers
  5. ds_list_shuffle(numbers);
  6. hLength = 100;
  7. mLength = 200;
  8. sLength = 200;
  9.  
  10. divBegin = 210;
  11. divEnd = 250;
  12. textDist = 270;
  13.  
  14.  
  15. ////DRAW GUI EVENT
  16. var h = current_hour;
  17. var m = current_minute;
  18. var s = current_second;
  19. draw_set_color(c_white);
  20. setText(fa_center, fa_center, fnMain);
  21. for (var i = 0; i < 12; i++)
  22. {
  23.     draw_line_width(x + lengthdir_x(divBegin, i*30), y + lengthdir_y(divBegin, i*30),
  24.                     x + lengthdir_x(divEnd, i*30), y + lengthdir_y(divEnd, i*30), 4);
  25. }
  26.  
  27. for (var i = 0; i < 60; i++)
  28. {
  29.     draw_set_color(c_white);
  30.     draw_text(x + lengthdir_x(textDist, i*6), y + lengthdir_y(textDist, i*6), numbers[| i]);
  31.     if (numbers[|i] == h)
  32.         draw_line_width(x, y, x + lengthdir_x(hLength, i*6), y + lengthdir_y(hLength, i*6), 6);
  33.     if (numbers[|i] == m)
  34.         draw_line_width(x, y, x + lengthdir_x(mLength, i*6), y + lengthdir_y(mLength, i*6), 3);
  35.     if (numbers[|i] == s)
  36.     {
  37.         draw_set_color(c_red);
  38.         draw_line(x, y, x + lengthdir_x(sLength, i*6), y + lengthdir_y(sLength, i*6));
  39.     }
  40. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×