Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CREATE EVENT
- s_x = ds_list_create()
- s_y = ds_list_create()
- s_a = ds_list_create()
- s_d = ds_list_create()
- s_s = ds_list_create()
- slot_1 = ds_list_create()
- slot_2 = ds_list_create()
- slot_3 = ds_list_create()
- slot_4 = ds_list_create()
- slot_5 = ds_list_create()
- slot_6 = ds_list_create()
- slot_1_s = 0
- slot_2_s = 0
- slot_3_s = 0
- slot_4_s = 0
- slot_5_s = 0
- slot_6_s = 0
- slot_1_e = 0
- slot_2_e = 0
- slot_3_e = 0
- slot_4_e = 0
- slot_5_e = 0
- slot_6_e = 0
- slot_1_d = 0
- slot_2_d = 0
- slot_3_d = 0
- slot_4_d = 0
- slot_5_d = 0
- slot_6_d = 0
- slot_max = 2
- slot_speed = 32
- slot_sync_speed = 8
- mode = 0
- repeat( ( room_height / 128 ) * 2 )
- {
- ds_list_add( slot_1 , scr_slotid( slot_max ) )
- ds_list_add( slot_2 , scr_slotid( slot_max ) )
- ds_list_add( slot_3 , scr_slotid( slot_max ) )
- ds_list_add( slot_4 , scr_slotid( slot_max ) )
- ds_list_add( slot_5 , scr_slotid( slot_max ) )
- ds_list_add( slot_6 , scr_slotid( slot_max ) )
- }
- slot_append = 6
- draw_set_font( font_slots )
- credit = 10.00
- bet = 0.25
- win = 0.00
- // STEP EVENT
- var a = 0
- repeat( 32 )
- {
- ds_list_add( s_x , random( room_width ) )
- ds_list_add( s_y , random( room_width ) )
- ds_list_add( s_a , 0 )
- ds_list_add( s_d , random( 360 ) )
- ds_list_add( s_s , random( 1 ) )
- }
- for ( a = 0 ; a < ds_list_size( s_x ) ; a++ )
- {
- s_a[| a] += 2
- s_x[| a] += lengthdir_x( s_s[| a] , s_d[| a] )
- s_y[| a] += lengthdir_y( s_s[| a] , s_d[| a] )
- if s_a[| a] >= 180
- {
- ds_list_delete( s_x , a )
- ds_list_delete( s_y , a )
- ds_list_delete( s_a , a )
- ds_list_delete( s_d , a )
- ds_list_delete( s_s , a )
- a--
- }
- }
- if keyboard_check_pressed( vk_control )
- credit += bet * 10
- if keyboard_check_pressed( vk_space )
- {
- switch( mode )
- {
- case 0:
- mode = 1
- credit -= bet
- repeat( 8 )
- ds_list_add( slot_1 , scr_slotid( slot_max ) )
- repeat( 8 + slot_sync_speed )
- ds_list_add( slot_2 , scr_slotid( slot_max ) )
- repeat( 8 + ( slot_sync_speed * 2 ) )
- ds_list_add( slot_3 , scr_slotid( slot_max ) )
- repeat( 8 + ( slot_sync_speed * 3 ) )
- ds_list_add( slot_4 , scr_slotid( slot_max ) )
- repeat( 8 + ( slot_sync_speed * 4 ) )
- ds_list_add( slot_5 , scr_slotid( slot_max ) )
- repeat( 8 + ( slot_sync_speed * 5 ) )
- ds_list_add( slot_6 , scr_slotid( slot_max ) )
- // scripted game logic goes here, address this some other time.. if ever :\
- break;
- case 1:
- // nada
- break;
- case 2:
- mode = 0
- ds_list_clear( slot_1 )
- ds_list_clear( slot_2 )
- ds_list_clear( slot_3 )
- ds_list_clear( slot_4 )
- ds_list_clear( slot_5 )
- ds_list_clear( slot_6 )
- repeat( ( room_height / 128 ) * 2 )
- {
- ds_list_add( slot_1 , scr_slotid( slot_max ) )
- ds_list_add( slot_2 , scr_slotid( slot_max ) )
- ds_list_add( slot_3 , scr_slotid( slot_max ) )
- ds_list_add( slot_4 , scr_slotid( slot_max ) )
- ds_list_add( slot_5 , scr_slotid( slot_max ) )
- ds_list_add( slot_6 , scr_slotid( slot_max ) )
- }
- slot_1_s = 0
- slot_2_s = 0
- slot_3_s = 0
- slot_4_s = 0
- slot_5_s = 0
- slot_6_s = 0
- slot_1_e = 0
- slot_2_e = 0
- slot_3_e = 0
- slot_4_e = 0
- slot_5_e = 0
- slot_6_e = 0
- slot_1_d = 0
- slot_2_d = 0
- slot_3_d = 0
- slot_4_d = 0
- slot_5_d = 0
- slot_6_d = 0
- mode = 1
- //
- credit -= bet
- repeat( 8 )
- ds_list_add( slot_1 , scr_slotid( slot_max ) )
- repeat( 8 + slot_sync_speed )
- ds_list_add( slot_2 , scr_slotid( slot_max ) )
- repeat( 8 + ( slot_sync_speed * 2 ) )
- ds_list_add( slot_3 , scr_slotid( slot_max ) )
- repeat( 8 + ( slot_sync_speed * 3 ) )
- ds_list_add( slot_4 , scr_slotid( slot_max ) )
- repeat( 8 + ( slot_sync_speed * 4 ) )
- ds_list_add( slot_5 , scr_slotid( slot_max ) )
- repeat( 8 + ( slot_sync_speed * 5 ) )
- ds_list_add( slot_6 , scr_slotid( slot_max ) )
- //
- break;
- }
- }
- switch( mode )
- {
- case 0:
- slot_1_s += slot_speed
- slot_2_s += slot_speed
- slot_3_s += slot_speed
- slot_4_s += slot_speed
- slot_5_s += slot_speed
- slot_6_s += slot_speed
- if slot_1_s = 128 * slot_append
- {
- repeat( slot_append )
- {
- ds_list_delete( slot_1 , 0 )
- ds_list_delete( slot_2 , 0 )
- ds_list_delete( slot_3 , 0 )
- ds_list_delete( slot_4 , 0 )
- ds_list_delete( slot_5 , 0 )
- ds_list_delete( slot_6 , 0 )
- ds_list_add( slot_1 , scr_slotid( slot_max ) )
- ds_list_add( slot_2 , scr_slotid( slot_max ) )
- ds_list_add( slot_3 , scr_slotid( slot_max ) )
- ds_list_add( slot_4 , scr_slotid( slot_max ) )
- ds_list_add( slot_5 , scr_slotid( slot_max ) )
- ds_list_add( slot_6 , scr_slotid( slot_max ) )
- }
- slot_1_s = 0
- slot_2_s = 0
- slot_3_s = 0
- slot_4_s = 0
- slot_5_s = 0
- slot_6_s = 0
- }
- break;
- case 1:
- if slot_1_e = false
- slot_1_s += slot_speed
- if slot_2_e = false
- slot_2_s += slot_speed
- if slot_3_e = false
- slot_3_s += slot_speed
- if slot_4_e = false
- slot_4_s += slot_speed
- if slot_5_e = false
- slot_5_s += slot_speed
- if slot_6_e = false
- slot_6_s += slot_speed
- //
- if slot_1_s = ( ds_list_size( slot_1 ) * 128 ) - ( 256 * slot_append )
- slot_1_e = true
- if slot_2_s = ( ds_list_size( slot_2 ) * 128 ) - ( 256 * slot_append )
- slot_2_e = true
- if slot_3_s = ( ds_list_size( slot_3 ) * 128 ) - ( 256 * slot_append )
- slot_3_e = true
- if slot_4_s = ( ds_list_size( slot_4 ) * 128 ) - ( 256 * slot_append )
- slot_4_e = true
- if slot_5_s = ( ds_list_size( slot_5 ) * 128 ) - ( 256 * slot_append )
- slot_5_e = true
- if slot_6_s = ( ds_list_size( slot_6 ) * 128 ) - ( 256 * slot_append )
- slot_6_e = true
- //
- if slot_1_e = true
- {
- if slot_1_d < 180
- slot_1_d += slot_tension
- slot_1_s = ( ( ds_list_size( slot_1 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_1_d )
- }
- if slot_2_e = true
- {
- if slot_2_d < 180
- slot_2_d += slot_tension
- slot_2_s = ( ( ds_list_size( slot_2 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_2_d )
- }
- if slot_3_e = true
- {
- if slot_3_d < 180
- slot_3_d += slot_tension
- slot_3_s = ( ( ds_list_size( slot_3 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_3_d )
- }
- if slot_4_e = true
- {
- if slot_4_d < 180
- slot_4_d += slot_tension
- slot_4_s = ( ( ds_list_size( slot_4 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_4_d )
- }
- if slot_5_e = true
- {
- if slot_5_d < 180
- slot_5_d += slot_tension
- slot_5_s = ( ( ds_list_size( slot_5 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_5_d )
- }
- if slot_6_e = true
- {
- if slot_6_d < 180
- slot_6_d += slot_tension
- slot_6_s = ( ( ds_list_size( slot_6 ) * 128 ) - ( 256 * slot_append ) ) - lengthdir_y( slot_ease , slot_6_d )
- if slot_6_d = 180
- mode = 2
- }
- break;
- }
- // DRAW EVENT
- draw_set_alpha( 1 )
- draw_set_colour( c_black )
- draw_rectangle( 0 , 0 , room_width , room_height , 0 )
- draw_set_colour( c_white )
- // draw stars
- var a = 0
- for ( a = 0 ; a < ds_list_size( s_x ) ; a++ )
- {
- draw_set_alpha( abs( lengthdir_y( 1 , s_a[| a] ) ) )
- draw_point( s_x[| a] , s_y[| a] )
- }
- // shadow
- for ( a = 0 ; a < ds_list_size( slot_1 ) ; a++ )
- 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 )
- for ( a = 0 ; a < ds_list_size( slot_2 ) ; a++ )
- 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 )
- for ( a = 0 ; a < ds_list_size( slot_3 ) ; a++ )
- 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 )
- for ( a = 0 ; a < ds_list_size( slot_4 ) ; a++ )
- 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 )
- for ( a = 0 ; a < ds_list_size( slot_5 ) ; a++ )
- 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 )
- for ( a = 0 ; a < ds_list_size( slot_6 ) ; a++ )
- 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 )
- // real
- for ( a = 0 ; a < ds_list_size( slot_1 ) ; a++ )
- draw_sprite_ext( spr_slotcons , slot_1[| a] , ( room_width / 2 ) - 320 , ( 128 + ( a * 128 ) ) - slot_1_s , 1 , 1 , 0 , c_white , 1 )
- for ( a = 0 ; a < ds_list_size( slot_2 ) ; a++ )
- draw_sprite_ext( spr_slotcons , slot_2[| a] , ( room_width / 2 ) - 192 , ( 128 + ( a * 128 ) ) - slot_2_s , 1 , 1 , 0 , c_white , 1 )
- for ( a = 0 ; a < ds_list_size( slot_3 ) ; a++ )
- draw_sprite_ext( spr_slotcons , slot_3[| a] , ( room_width / 2 ) - 64 , ( 128 + ( a * 128 ) ) - slot_3_s , 1 , 1 , 0 , c_white , 1 )
- for ( a = 0 ; a < ds_list_size( slot_4 ) ; a++ )
- draw_sprite_ext( spr_slotcons , slot_4[| a] , ( room_width / 2 ) + 64 , ( 128 + ( a * 128 ) ) - slot_4_s , 1 , 1 , 0 , c_white , 1 )
- for ( a = 0 ; a < ds_list_size( slot_5 ) ; a++ )
- draw_sprite_ext( spr_slotcons , slot_5[| a] , ( room_width / 2 ) + 192 , ( 128 + ( a * 128 ) ) - slot_5_s , 1 , 1 , 0 , c_white , 1 )
- for ( a = 0 ; a < ds_list_size( slot_6 ) ; a++ )
- draw_sprite_ext( spr_slotcons , slot_6[| a] , ( room_width / 2 ) + 320 , ( 128 + ( a * 128 ) ) - slot_6_s , 1 , 1 , 0 , c_white , 1 )
- draw_set_alpha( 1 )
- draw_set_colour( c_dkgray )
- draw_rectangle( 0 , 0 , room_width , 48 , 0 )
- draw_set_colour( c_white )
- draw_set_valign( fa_middle )
- draw_set_halign( fa_left )
- draw_text( 32 , 32 , "Bet Amount: $" + string( string_format( bet , 1 , 2 ) ) )
- draw_set_halign( fa_center )
- draw_text( room_width / 2 , 32 , "Credit: $" + string( string_format( credit , 1 , 2 ) ) )
- draw_set_halign( fa_right )
- draw_text( room_width - 32 , 32 , "Win Amount: $" + string( string_format( win , 1 , 2 ) ) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement