Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////create event
- g_pad = 0
- oy = y
- c_controller = c_fuchsia
- c_inverse = make_colour_hsv(-colour_get_hue(c_controller),255,255)
- haxis = gamepad_axis_value(0, gp_axislh);
- statScroll = 0
- istatScroll = 0
- lastScroll = false;
- instance_create(x,y,obj_draw_above)
- instance_create(x,y,obj_draw_below)
- selected = -1;
- ////////////////////alarm0
- if (haxis != 0) and (lastScroll == true)
- {
- istatScroll += round(haxis)
- //gamepad_set_vibration(g_pad,abs(-haxis)*.3,haxis*.3)
- lastScroll = true
- }
- else istatScroll += keyboard_check(ord('A'))-keyboard_check(ord('D'))
- if lastScroll == true
- {
- //alarm[0]=10
- //lastScroll = false
- }
- //canScroll = false
- //////////////////////////step
- y = oy+sin(current_time*.005)*2
- if gamepad_is_connected(g_pad) == true
- {
- c_controller = c_white
- if gamepad_button_check_pressed(g_pad,gp_face1)
- {
- selected *= -1;
- scr_screenshake(10,10,g_pad)
- }
- }
- else c_controller = c_black;
- c_inverse = make_colour_hsv(0+sin(current_time*.01)*20,255,255)
- //make_colour_hsv(210+colour_get_hue(c_controller),255,255)
- if gamepad_is_connected(g_pad)
- then haxis = -gamepad_axis_value(g_pad, gp_axislh) + -(gamepad_button_check(g_pad,gp_padr)-gamepad_button_check(g_pad,gp_padl));
- else haxis = keyboard_check_pressed(ord('A'))-keyboard_check_pressed(ord('D'))
- if (abs(haxis) > .4)
- {
- //istatScroll += round(haxis)
- if !lastScroll
- {
- lastScroll = true
- alarm[0]=1
- }
- /*if (haxis != 0) and (lastScroll == true)
- {
- istatScroll += round(haxis)
- gamepad_set_vibration(g_pad,abs(-haxis)*.3,haxis*.3)
- }*/
- }
- else
- {
- lastScroll = false
- }
- //if keyboard_check_released(ord('A')) or keyboard_check_released(ord('D'))
- //then keepScrolling = false
- statScroll += (degtorad(360/sprite_get_number(spr_char_test)*istatScroll)-statScroll)*.2
- global.character1 = abs(istatScroll % sprite_get_number(spr_char_test))
- obj_draw_above.x = x
- obj_draw_above.y = y
- obj_draw_below.x = x
- obj_draw_below.y = y
- ////////////////////////////Draw
- 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)
- //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)
- 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)
- scr_draw_circle(x-2,y-200,10+sin(current_time*.01)*1,4,cos(current_time*.02)*4,c_inverse)
- if selected == 1
- then scr_draw_circle(x,y-200,10+sin(current_time*.01)*1,4,sin(current_time*.02)*4,c_white)
- else scr_draw_circle(x,y-200,10+sin(current_time*.01)*1,4,sin(current_time*.02)*4,c_black)
- draw_set_font(fnt_m5x7)
- draw_set_halign(fa_center)
- draw_set_valign(fa_middle)
- draw_text_colour(x-1,y-201,"P1",c_inverse,c_inverse,c_inverse,c_inverse,1)
- draw_text_colour(x,y-200,"P1",c_white,c_white,c_white,c_white,1)
- //draw_text_colour(x,y-220," "+string(abs(istatScroll % sprite_get_number(spr_char_test))),c_white,c_white,c_white,c_white,1)
- draw_line_colour(x-2,y,x-2,y-190,c_inverse,c_inverse)
- draw_line_colour(x,y,x,y-190,c_white,c_white)
- draw_set_colour(c_red)
- scr_draw_cylsprite(x,y-170,spr_char_test,100,10,statScroll)
- draw_set_colour(c_white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement