This_is_SG

code for color change

Nov 8th, 2020 (edited)
2,641
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //this is the code used in `update.gml`:
  2. col_time = 0
  3. with obj_stage_article {
  4.     if (get_gameplay_time() > 140) {
  5.         col_time = get_gameplay_time()
  6.         if col_time % 380 = 0 {
  7.             swapped = true;
  8.         }
  9.         if col_time % 400 = 0 {
  10.             swap += 1;
  11.             not_white = true;
  12.             if (swap == 5 or swap == 0) {
  13.                    swap = 1;
  14.             }
  15.            }
  16.            if col_time % 420 = 0 {
  17.                swapped = false;
  18.                col_time = 0;
  19.            }
  20.     }
  21. }
  22.  
  23. //and this in `article1_draw.gml`:
  24. var pan = 0;
  25. if swapped == true {
  26.     timer++;
  27.     pan = timer*100
  28.     draw_triangle_colour(get_marker_x(6), get_marker_y(6)+pan, get_marker_x(7), get_marker_y(7)+pan, get_marker_x(8), get_marker_y(8)+pan, colorf, colorf, colorf, false);
  29.     draw_triangle_colour(get_marker_x(6), get_marker_y(6)+pan, get_marker_x(9), get_marker_y(9)+pan, get_marker_x(10), get_marker_y(10)+pan, colorf, colorf, colorf, false);
  30. } else {
  31.     timer = 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment