Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //////////create event
  2. g_pad = 0
  3.  
  4. oy = y
  5. c_controller = c_fuchsia
  6. c_inverse = make_colour_hsv(-colour_get_hue(c_controller),255,255)
  7.  
  8.  
  9. haxis = gamepad_axis_value(0, gp_axislh);
  10. statScroll = 0
  11. istatScroll = 0
  12. lastScroll = false;
  13.  
  14. instance_create(x,y,obj_draw_above)
  15. instance_create(x,y,obj_draw_below)
  16.  
  17. selected = -1;
  18.  
  19. ////////////////////alarm0
  20. if (haxis != 0) and (lastScroll == true)
  21. {
  22.     istatScroll += round(haxis)
  23.     //gamepad_set_vibration(g_pad,abs(-haxis)*.3,haxis*.3)
  24.     lastScroll = true
  25. }
  26. else istatScroll += keyboard_check(ord('A'))-keyboard_check(ord('D'))
  27. if lastScroll == true
  28. {
  29.     //alarm[0]=10
  30.     //lastScroll = false
  31. }
  32.  
  33. //canScroll = false
  34.  
  35. //////////////////////////step
  36. y = oy+sin(current_time*.005)*2
  37.  
  38.  
  39. if gamepad_is_connected(g_pad) == true
  40. {
  41.     c_controller = c_white
  42.     if gamepad_button_check_pressed(g_pad,gp_face1)
  43.     {
  44.         selected *= -1;
  45.         scr_screenshake(10,10,g_pad)
  46.     }
  47. }
  48. else c_controller = c_black;
  49. c_inverse = make_colour_hsv(0+sin(current_time*.01)*20,255,255)
  50. //make_colour_hsv(210+colour_get_hue(c_controller),255,255)
  51.  
  52. if gamepad_is_connected(g_pad)
  53. then haxis = -gamepad_axis_value(g_pad, gp_axislh) + -(gamepad_button_check(g_pad,gp_padr)-gamepad_button_check(g_pad,gp_padl));
  54. else haxis = keyboard_check_pressed(ord('A'))-keyboard_check_pressed(ord('D'))
  55. if (abs(haxis) > .4)
  56. {
  57.     //istatScroll += round(haxis)
  58.     if !lastScroll
  59.     {
  60.         lastScroll = true
  61.         alarm[0]=1
  62.     }
  63.     /*if (haxis != 0) and (lastScroll == true)
  64.     {
  65.         istatScroll += round(haxis)
  66.         gamepad_set_vibration(g_pad,abs(-haxis)*.3,haxis*.3)
  67.        
  68.     }*/
  69.    
  70. }
  71. else
  72. {
  73.     lastScroll = false
  74. }
  75. //if keyboard_check_released(ord('A')) or keyboard_check_released(ord('D'))
  76. //then keepScrolling = false
  77. statScroll += (degtorad(360/sprite_get_number(spr_char_test)*istatScroll)-statScroll)*.2
  78.  
  79. global.character1 = abs(istatScroll % sprite_get_number(spr_char_test))
  80.  
  81. obj_draw_above.x = x
  82. obj_draw_above.y = y
  83. obj_draw_below.x = x
  84. obj_draw_below.y = y
  85.  
  86. ////////////////////////////Draw
  87. draw_sprite_ext(sprite_index,image_index,x-2+sin(current_time*.1)*.5,y-1,1+sin(current_time*.01)*.1,1+cos(current_time*.01)*.1,0,c_inverse,1)
  88. //draw_sprite_ext(sprite_index,image_index,x-1,y,1+sin(current_time*.01)*.1,1+cos(current_time*.01)*.1,0,c_white,1)
  89. draw_sprite_ext(sprite_index,image_index,x,y,1+sin(current_time*.01)*.1,1+cos(current_time*.01)*.1,0,c_controller,1)
  90.  
  91. scr_draw_circle(x-2,y-200,10+sin(current_time*.01)*1,4,cos(current_time*.02)*4,c_inverse)
  92. if selected == 1
  93. then scr_draw_circle(x,y-200,10+sin(current_time*.01)*1,4,sin(current_time*.02)*4,c_white)
  94. else scr_draw_circle(x,y-200,10+sin(current_time*.01)*1,4,sin(current_time*.02)*4,c_black)
  95.  
  96. draw_set_font(fnt_m5x7)
  97. draw_set_halign(fa_center)
  98. draw_set_valign(fa_middle)
  99. draw_text_colour(x-1,y-201,"P1",c_inverse,c_inverse,c_inverse,c_inverse,1)
  100. draw_text_colour(x,y-200,"P1",c_white,c_white,c_white,c_white,1)
  101. //draw_text_colour(x,y-220," "+string(abs(istatScroll % sprite_get_number(spr_char_test))),c_white,c_white,c_white,c_white,1)
  102.  
  103. draw_line_colour(x-2,y,x-2,y-190,c_inverse,c_inverse)
  104. draw_line_colour(x,y,x,y-190,c_white,c_white)
  105. draw_set_colour(c_red)
  106. scr_draw_cylsprite(x,y-170,spr_char_test,100,10,statScroll)
  107. draw_set_colour(c_white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement