Advertisement
Guest User

Untitled

a guest
Jun 9th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // CREATE EVENT
  2.  
  3. s_x = ds_list_create()
  4. s_y = ds_list_create()
  5. s_a = ds_list_create()
  6. s_d = ds_list_create()
  7. s_s = ds_list_create()
  8.  
  9. slot_1 = ds_list_create()
  10. slot_2 = ds_list_create()
  11. slot_3 = ds_list_create()
  12. slot_4 = ds_list_create()
  13. slot_5 = ds_list_create()
  14. slot_6 = ds_list_create()
  15.  
  16. slot_1_s = 0
  17. slot_2_s = 0
  18. slot_3_s = 0
  19. slot_4_s = 0
  20. slot_5_s = 0
  21. slot_6_s = 0
  22.  
  23. slot_1_e = 0
  24. slot_2_e = 0
  25. slot_3_e = 0
  26. slot_4_e = 0
  27. slot_5_e = 0
  28. slot_6_e = 0
  29.  
  30. slot_1_d = 0
  31. slot_2_d = 0
  32. slot_3_d = 0
  33. slot_4_d = 0
  34. slot_5_d = 0
  35. slot_6_d = 0
  36.  
  37. slot_max = 2
  38.  
  39. slot_speed = 32
  40.  
  41.  
  42. slot_sync_speed = 8
  43.  
  44. mode = 0
  45.  
  46. repeat( ( room_height / 128 ) * 2 )
  47.     {
  48.    
  49.     ds_list_add( slot_1 , scr_slotid( slot_max ) )
  50.     ds_list_add( slot_2 , scr_slotid( slot_max ) )
  51.     ds_list_add( slot_3 , scr_slotid( slot_max ) )
  52.     ds_list_add( slot_4 , scr_slotid( slot_max ) )
  53.     ds_list_add( slot_5 , scr_slotid( slot_max ) )
  54.     ds_list_add( slot_6 , scr_slotid( slot_max ) )
  55.    
  56.     }
  57.    
  58. slot_append = 6
  59.  
  60. draw_set_font( font_slots )
  61.  
  62. credit = 10.00
  63. bet = 0.25
  64. win = 0.00
  65.  
  66. // STEP EVENT
  67.  
  68. var a = 0
  69.  
  70. repeat( 32 )
  71.     {
  72.  
  73.     ds_list_add( s_x , random( room_width ) )
  74.     ds_list_add( s_y , random( room_width ) )
  75.     ds_list_add( s_a , 0 )
  76.     ds_list_add( s_d , random( 360 ) )
  77.     ds_list_add( s_s , random( 1 ) )
  78.  
  79.     }
  80.  
  81. for ( a = 0 ; a < ds_list_size( s_x ) ; a++ )
  82.     {
  83.    
  84.     s_a[| a] += 2
  85.    
  86.     s_x[| a] += lengthdir_x( s_s[| a] , s_d[| a] )
  87.     s_y[| a] += lengthdir_y( s_s[| a] , s_d[| a] )
  88.    
  89.     if s_a[| a] >= 180
  90.         {
  91.        
  92.         ds_list_delete( s_x , a )
  93.         ds_list_delete( s_y , a )
  94.         ds_list_delete( s_a , a )
  95.         ds_list_delete( s_d , a )
  96.         ds_list_delete( s_s , a )
  97.        
  98.         a--
  99.        
  100.         }
  101.    
  102.     }
  103.    
  104. if keyboard_check_pressed( vk_control )
  105.     credit += bet * 10
  106.    
  107. if keyboard_check_pressed( vk_space )
  108.     {
  109.    
  110.     switch( mode )
  111.         {
  112.        
  113.         case 0:
  114.        
  115.             mode = 1
  116.            
  117.             credit -= bet
  118.            
  119.             repeat( 8 )
  120.                 ds_list_add( slot_1 , scr_slotid( slot_max ) )
  121.                
  122.             repeat( 8 + slot_sync_speed )
  123.                 ds_list_add( slot_2 , scr_slotid( slot_max ) )
  124.                
  125.             repeat( 8 + ( slot_sync_speed * 2 ) )
  126.                 ds_list_add( slot_3 , scr_slotid( slot_max ) )
  127.                
  128.             repeat( 8 + ( slot_sync_speed * 3 ) )
  129.                 ds_list_add( slot_4 , scr_slotid( slot_max ) )
  130.                
  131.             repeat( 8 + ( slot_sync_speed * 4 ) )
  132.                 ds_list_add( slot_5 , scr_slotid( slot_max ) )
  133.                
  134.             repeat( 8 + ( slot_sync_speed * 5 ) )
  135.                 ds_list_add( slot_6 , scr_slotid( slot_max ) )
  136.                
  137.             // scripted game logic goes here, address this some other time.. if ever :\
  138.        
  139.         break;
  140.        
  141.         case 1:
  142.        
  143.             // nada
  144.        
  145.         break;
  146.        
  147.         case 2:
  148.        
  149.             mode = 0
  150.            
  151.             ds_list_clear( slot_1 )
  152.             ds_list_clear( slot_2 )
  153.             ds_list_clear( slot_3 )
  154.             ds_list_clear( slot_4 )
  155.             ds_list_clear( slot_5 )
  156.             ds_list_clear( slot_6 )
  157.            
  158.             repeat( ( room_height / 128 ) * 2 )
  159.                 {
  160.                
  161.                 ds_list_add( slot_1 , scr_slotid( slot_max ) )
  162.                 ds_list_add( slot_2 , scr_slotid( slot_max ) )
  163.                 ds_list_add( slot_3 , scr_slotid( slot_max ) )
  164.                 ds_list_add( slot_4 , scr_slotid( slot_max ) )
  165.                 ds_list_add( slot_5 , scr_slotid( slot_max ) )
  166.                 ds_list_add( slot_6 , scr_slotid( slot_max ) )
  167.                
  168.                 }
  169.                
  170.             slot_1_s = 0
  171.             slot_2_s = 0
  172.             slot_3_s = 0
  173.             slot_4_s = 0
  174.             slot_5_s = 0
  175.             slot_6_s = 0
  176.                
  177.             slot_1_e = 0
  178.             slot_2_e = 0
  179.             slot_3_e = 0
  180.             slot_4_e = 0
  181.             slot_5_e = 0
  182.             slot_6_e = 0
  183.            
  184.             slot_1_d = 0
  185.             slot_2_d = 0
  186.             slot_3_d = 0
  187.             slot_4_d = 0
  188.             slot_5_d = 0
  189.             slot_6_d = 0
  190.            
  191.             mode = 1
  192.            
  193.             //
  194.            
  195.             credit -= bet
  196.            
  197.             repeat( 8 )
  198.                 ds_list_add( slot_1 , scr_slotid( slot_max ) )
  199.                
  200.             repeat( 8 + slot_sync_speed )
  201.                 ds_list_add( slot_2 , scr_slotid( slot_max ) )
  202.                
  203.             repeat( 8 + ( slot_sync_speed * 2 ) )
  204.                 ds_list_add( slot_3 , scr_slotid( slot_max ) )
  205.                
  206.             repeat( 8 + ( slot_sync_speed * 3 ) )
  207.                 ds_list_add( slot_4 , scr_slotid( slot_max ) )
  208.                
  209.             repeat( 8 + ( slot_sync_speed * 4 ) )
  210.                 ds_list_add( slot_5 , scr_slotid( slot_max ) )
  211.                
  212.             repeat( 8 + ( slot_sync_speed * 5 ) )
  213.                 ds_list_add( slot_6 , scr_slotid( slot_max ) )
  214.                
  215.             //
  216.        
  217.         break;
  218.        
  219.         }
  220.    
  221.     }
  222.    
  223. switch( mode )
  224.     {
  225.    
  226.     case 0:
  227.    
  228.         slot_1_s += slot_speed
  229.         slot_2_s += slot_speed
  230.         slot_3_s += slot_speed
  231.         slot_4_s += slot_speed
  232.         slot_5_s += slot_speed
  233.         slot_6_s += slot_speed
  234.        
  235.         if slot_1_s = 128 * slot_append
  236.             {
  237.            
  238.             repeat( slot_append )
  239.                 {
  240.                
  241.                 ds_list_delete( slot_1 , 0 )
  242.                 ds_list_delete( slot_2 , 0 )
  243.                 ds_list_delete( slot_3 , 0 )
  244.                 ds_list_delete( slot_4 , 0 )
  245.                 ds_list_delete( slot_5 , 0 )
  246.                 ds_list_delete( slot_6 , 0 )
  247.                
  248.                 ds_list_add( slot_1 , scr_slotid( slot_max ) )
  249.                 ds_list_add( slot_2 , scr_slotid( slot_max ) )
  250.                 ds_list_add( slot_3 , scr_slotid( slot_max ) )
  251.                 ds_list_add( slot_4 , scr_slotid( slot_max ) )
  252.                 ds_list_add( slot_5 , scr_slotid( slot_max ) )
  253.                 ds_list_add( slot_6 , scr_slotid( slot_max ) )
  254.                
  255.                 }
  256.                
  257.             slot_1_s = 0
  258.             slot_2_s = 0
  259.             slot_3_s = 0
  260.             slot_4_s = 0
  261.             slot_5_s = 0
  262.             slot_6_s = 0
  263.            
  264.             }
  265.    
  266.     break;
  267.    
  268.     case 1:
  269.    
  270.         if slot_1_e = false
  271.             slot_1_s += slot_speed
  272.            
  273.         if slot_2_e = false
  274.             slot_2_s += slot_speed
  275.        
  276.         if slot_3_e = false
  277.             slot_3_s += slot_speed
  278.        
  279.         if slot_4_e = false
  280.             slot_4_s += slot_speed
  281.        
  282.         if slot_5_e = false
  283.             slot_5_s += slot_speed
  284.        
  285.         if slot_6_e = false
  286.             slot_6_s += slot_speed
  287.            
  288.         //
  289.        
  290.         if slot_1_s = ( ds_list_size( slot_1 ) * 128 ) - ( 256 * slot_append )
  291.             slot_1_e = true
  292.            
  293.         if slot_2_s = ( ds_list_size( slot_2 ) * 128 ) - ( 256 * slot_append )
  294.             slot_2_e = true
  295.            
  296.         if slot_3_s = ( ds_list_size( slot_3 ) * 128 ) - ( 256 * slot_append )
  297.             slot_3_e = true
  298.            
  299.         if slot_4_s = ( ds_list_size( slot_4 ) * 128 ) - ( 256 * slot_append )
  300.             slot_4_e = true
  301.            
  302.         if slot_5_s = ( ds_list_size( slot_5 ) * 128 ) - ( 256 * slot_append )
  303.             slot_5_e = true
  304.            
  305.         if slot_6_s = ( ds_list_size( slot_6 ) * 128 ) - ( 256 * slot_append )
  306.             slot_6_e = true
  307.            
  308.         //
  309.            
  310.         if slot_1_e = true
  311.             {
  312.            
  313.             if slot_1_d < 180
  314.                 slot_1_d += slot_tension
  315.            
  316.             slot_1_s = ( ( ds_list_size( slot_1 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_1_d )
  317.            
  318.             }
  319.            
  320.         if slot_2_e = true
  321.             {
  322.            
  323.             if slot_2_d < 180
  324.                 slot_2_d += slot_tension
  325.            
  326.             slot_2_s = ( ( ds_list_size( slot_2 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_2_d )
  327.            
  328.             }
  329.        
  330.         if slot_3_e = true
  331.             {
  332.            
  333.             if slot_3_d < 180
  334.                 slot_3_d += slot_tension
  335.            
  336.             slot_3_s = ( ( ds_list_size( slot_3 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_3_d )
  337.            
  338.             }
  339.        
  340.         if slot_4_e = true
  341.             {
  342.            
  343.             if slot_4_d < 180
  344.                 slot_4_d += slot_tension
  345.            
  346.             slot_4_s = ( ( ds_list_size( slot_4 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_4_d )
  347.            
  348.             }
  349.        
  350.         if slot_5_e = true
  351.             {
  352.            
  353.             if slot_5_d < 180
  354.                 slot_5_d += slot_tension
  355.            
  356.             slot_5_s = ( ( ds_list_size( slot_5 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_5_d )
  357.            
  358.             }
  359.        
  360.         if slot_6_e = true
  361.             {
  362.            
  363.             if slot_6_d < 180
  364.                 slot_6_d += slot_tension
  365.            
  366.             slot_6_s = ( ( ds_list_size( slot_6 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_6_d )
  367.            
  368.             if slot_6_d = 180
  369.                 mode = 2
  370.            
  371.             }
  372.    
  373.     break;
  374.    
  375.     }
  376.  
  377. // DRAW EVENT
  378.  
  379. draw_set_alpha( 1 )
  380.  
  381. draw_set_colour( c_black )
  382.  
  383. draw_rectangle( 0 , 0 , room_width , room_height , 0 )
  384.  
  385. draw_set_colour( c_white )
  386.  
  387. // draw stars
  388.  
  389. var a = 0
  390.  
  391. for ( a = 0 ; a < ds_list_size( s_x ) ; a++ )
  392.     {
  393.    
  394.     draw_set_alpha( abs( lengthdir_y( 1 , s_a[| a] ) ) )
  395.    
  396.     draw_point( s_x[| a] , s_y[| a] )
  397.    
  398.     }
  399.    
  400.     // shadow
  401.    
  402. for ( a = 0 ; a < ds_list_size( slot_1 ) ; a++ )
  403.     draw_sprite_ext( spr_slotcons , slot_1[| a] , ( room_width / 2 ) - 320 , ( ( 128 + ( a * 128 ) ) - slot_1_s ) + ( ( !slot_1_e ) * 16 ) , 1 , 1 , 0 , c_white , .5 )
  404.    
  405. for ( a = 0 ; a < ds_list_size( slot_2 ) ; a++ )
  406.     draw_sprite_ext( spr_slotcons , slot_2[| a] , ( room_width / 2 ) - 192 , ( ( 128 + ( a * 128 ) ) - slot_2_s ) + ( ( !slot_2_e ) * 16 ) , 1 , 1 , 0 , c_white , .5 )
  407.    
  408. for ( a = 0 ; a < ds_list_size( slot_3 ) ; a++ )
  409.     draw_sprite_ext( spr_slotcons , slot_3[| a] , ( room_width / 2 ) - 64 , ( ( 128 + ( a * 128 ) ) - slot_3_s ) + ( ( !slot_3_e ) * 16 ) , 1 , 1 , 0 , c_white , .5 )
  410.    
  411. for ( a = 0 ; a < ds_list_size( slot_4 ) ; a++ )
  412.     draw_sprite_ext( spr_slotcons , slot_4[| a] , ( room_width / 2 ) + 64 , ( ( 128 + ( a * 128 ) ) - slot_4_s ) + ( ( !slot_4_e ) * 16 ) , 1 , 1 , 0 , c_white , .5 )
  413.    
  414. for ( a = 0 ; a < ds_list_size( slot_5 ) ; a++ )
  415.     draw_sprite_ext( spr_slotcons , slot_5[| a] , ( room_width / 2 ) + 192 , ( ( 128 + ( a * 128 ) ) - slot_5_s ) + ( ( !slot_5_e ) * 16 ) , 1 , 1 , 0 , c_white , .5 )
  416.    
  417. for ( a = 0 ; a < ds_list_size( slot_6 ) ; a++ )
  418.     draw_sprite_ext( spr_slotcons , slot_6[| a] , ( room_width / 2 ) + 320 , ( ( 128 + ( a * 128 ) ) - slot_6_s ) + ( ( !slot_6_e ) * 16 ) , 1 , 1 , 0 , c_white , .5 )
  419.    
  420.     // real
  421.    
  422. for ( a = 0 ; a < ds_list_size( slot_1 ) ; a++ )
  423.     draw_sprite_ext( spr_slotcons , slot_1[| a] , ( room_width / 2 ) - 320 , ( 128 + ( a * 128 ) ) - slot_1_s , 1 , 1 , 0 , c_white , 1 )
  424.    
  425. for ( a = 0 ; a < ds_list_size( slot_2 ) ; a++ )
  426.     draw_sprite_ext( spr_slotcons , slot_2[| a] , ( room_width / 2 ) - 192 , ( 128 + ( a * 128 ) ) - slot_2_s , 1 , 1 , 0 , c_white , 1 )
  427.    
  428. for ( a = 0 ; a < ds_list_size( slot_3 ) ; a++ )
  429.     draw_sprite_ext( spr_slotcons , slot_3[| a] , ( room_width / 2 ) - 64 , ( 128 + ( a * 128 ) ) - slot_3_s , 1 , 1 , 0 , c_white , 1 )
  430.    
  431. for ( a = 0 ; a < ds_list_size( slot_4 ) ; a++ )
  432.     draw_sprite_ext( spr_slotcons , slot_4[| a] , ( room_width / 2 ) + 64 , ( 128 + ( a * 128 ) ) - slot_4_s , 1 , 1 , 0 , c_white , 1 )
  433.    
  434. for ( a = 0 ; a < ds_list_size( slot_5 ) ; a++ )
  435.     draw_sprite_ext( spr_slotcons , slot_5[| a] , ( room_width / 2 ) + 192 , ( 128 + ( a * 128 ) ) - slot_5_s , 1 , 1 , 0 , c_white , 1 )
  436.    
  437. for ( a = 0 ; a < ds_list_size( slot_6 ) ; a++ )
  438.     draw_sprite_ext( spr_slotcons , slot_6[| a] , ( room_width / 2 ) + 320 , ( 128 + ( a * 128 ) ) - slot_6_s , 1 , 1 , 0 , c_white , 1 )
  439.    
  440. draw_set_alpha( 1 )
  441.  
  442. draw_set_colour( c_dkgray )
  443.  
  444. draw_rectangle( 0 , 0 , room_width , 48 , 0 )
  445.  
  446. draw_set_colour( c_white )
  447.  
  448. draw_set_valign( fa_middle )
  449.    
  450. draw_set_halign( fa_left )
  451.  
  452. draw_text( 32 , 32 , "Bet Amount: $" + string( string_format( bet , 1 , 2 ) ) )
  453.  
  454. draw_set_halign( fa_center )
  455.  
  456. draw_text( room_width / 2 , 32 , "Credit: $" + string( string_format( credit , 1 , 2 ) ) )
  457.  
  458. draw_set_halign( fa_right )
  459.  
  460. draw_text( room_width - 32 , 32 , "Win Amount: $" + string( string_format( win , 1 , 2 ) ) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement