A few imperfections here and there. Sadly, I still don't have a split function ( I don't know why I keep putting that off) but It will definitely be next on my to do. Added in Game Statistics for when you reach the end of the game or cash out.
` ////////////////////////////////////////////
` /// The Game Creators DbPro Challenges ///
` /// Black Jack (MEDIALESS) ///
` /// Written by Rburke87 ///
` ////////////////////////////////////////////
Global c_width ` Card Width in pixels * Do not change
Global c_height ` Card Height in pixels * Do not change
Global cards ` DBL ARRAY -> For organizing cards Gfx
Global s_money = 1000 ` Starting funds
Global p1_Suite ` ARRAY -> Player's Suite Info
Global ai_Suite ` ARRAY -> Dealer's Suite Info
Global p1_Number ` ARRAY -> Player's card Info
Global ai_Number ` ARRAY -> Dealer's Card Info
Global p1_blackjack ` If the Player received a blackjack
Global ai_blackjack ` If the Dealer received a blackjack
Global hit ` If the player hit
Global c_out ` How many of the Player's cards are out
Global c_out_ai ` How many of the Dealer's cards are out
Global p1_total ` Player's total card value count
Global ai_total ` Dealer's total card value count
Global bet ` For end of match conditions
Global p1_Bet# ` The bet total
Global money_p1 ` Player's funds
Global money_ai ` Dealers funds
Global p1_bust ` If player busted
Global ai_bust ` If the dealer busted
Global ai_turn ` Dealers turn to manage cards
Global received_ai ` First two receieved cards for ai
Global received_p1 ` First two received cards for player
Global ins ` Insurance selection
Global ace_tracker ` Keeps track of ace number
Global max_money ` Highest amount of money possible in a game
Global double_down ` If the player chose to do a double down
REM Globals to be used in game statistics
Global num_games = 1 ` Current number of games played
Global win_games ` Number of games won
Global avg_bet# ` The average bet through out the game
Global win_bets ` Number of bets won
Global num_bets ` Total number of bets
Global hi_bet# ` Highest bet
Global most_cards ` Most cards that were out during the game
Global win_streak ` Winning streak
Global loose_streak ` Loosing streak
Global num_splits ` Total number of splits in a game
Global win_dbl ` Number of double downs won
Global num_dbl ` Total number of attempted double downs
Global num_busts ` Number of times busted
Global num_pushes ` Total number of pushes
Global num_ins ` Number of times insurance was purchased
Global streak ` A comparative tool for updating win/loose streaks
Global bet_total# ` All the previous bets added together to get the average
Global rating$ = "You didn't do anything..."
REM Arrays for storing card information and image numbers
Dim cards(5,14)
Dim p1_Suite(20)
Dim p1_Number(20)
Dim ai_Suite(20)
Dim ai_Number(20)
REM Presets for the globals
c_width = 90 ` Card Width
c_height = 120 ` Card Height
c_out = 1
money_p1 = s_money
money_ai = s_money
max_money = s_money*2
REM Initiating functions for card and gfx creation
gfx_mode()
create_bg()
c_front()
c_back()
make_cards()
` /////////////////////////////////////////////////////////
` // MAIN LOOP //
` /////////////////////////////////////////////////////////
do
cls
rem Draws the HUD and controls HUD functionality
draw_hud()
rem Gathers some information for end game statistics
update_statistics()
rem Give the player a card
if hit = 1 Then _hit()
rem Run the Dealer's artificial intellegence
if ai_turn = 1 then _ai()
rem deals cards if a bet has been placed
if bet = 1 then get_cards()
rem draw the cards currently on the table
draw_cards()
rem draw the mouse pointer
Sprite spr_mouse,mouseX(),mouseY(),mouse
` Set Sprite Priority spr_mouse,3
rem check if anyone has won the game
if money_p1 = 0 or money_ai = 0 then match_end()
rem process conditionals if anyone busted
if p1_bust = 1 or ai_bust = 1 then _bust()
rem Player has a blackjack
if p1_Number(0) = 1 and p1_Number(1) >= 10 and c_out = 1
p1_blackjack = 1
_blackjack()
endif
rem Dealer has a blackjack
if ai_Number(0) = 1 and ai_Number(1) >= 10 and c_out_ai = 1
ai_blackjack = 1
_blackjack()
endif
rem Game Over
if money_p1 = 0 then _cashout()
if money_p1 >= max_money then _cashout()
sync
loop
` /////////////////////////////////////////////////////////
` // END OF MAIN LOOP //
` /////////////////////////////////////////////////////////
function update_statistics()
rem Update the winning and loosing streaks
if streak > win_streak then win_streak = streak
if streak < loose_streak then loose_streak = streak
rem Update the highest bet
if p1_Bet# > hi_bet# then hi_bet# = p1_Bet#
rem Update the most cards statistic
if c_out > most_cards then most_cards = c_out + 1
rem Update average bet info
avg_bet# = bet_total#/num_bets
endfunction
function _cashout()
Hide Sprite spr_mouse
Hide Sprite spr_cash_on
Show Sprite spr_cash_off
Sync
bet = 0
if money_p1 = 0 then rating$ = "If I had just ONE penny, I'd be still richer than you"
if money_p1 < max_money*0.5 and money_p1 > 0 then rating$ = "You have just enough gas money for the trip home"
if money_p1 >= max_money/2 and money_p1 < max_money and num_bets > 0 then rating$ = "You didn't cheat now did you?"
if money_p1 >= max_money then rating$ = "That's more than what my 401K's worth! Well done!"
if money_p1 = s_money and num_bets < 1 then rating$ = "You haven't even started yet!"
while escapekey() = 0
draw_cards()
draw_hud()
ink rgb(25,25,25),1
box 10,50,screen width()-10,700
ink rgb(0,0,0),1
box 11,51,screen width()-11,699
_gradient(11,51,screen width()-11,100,50,50,0,3,1,1,0)
_gradient(11,100,150,699,0,0,0,0.25,1,0,0)
ink rgb(200,200,200),1
Set Text Size 45
Set Cursor 300,53 : Print "Game Statistics"
set cursor 0,110
Set Text Size 20
Set Text Font "IMPACT"
Set Cursor 0,130 : Print " Total Cash"
Set Cursor 0,200 : Print " Blackjacks received"
Set Cursor 0,240 : Print " Games Won"
Set Cursor 0,280 : Print " Average Bet"
Set Cursor 0,320 : Print " Bets Won"
Set Cursor 0,360 : Print " Highest Bet"
Set Cursor 0,400 : Print " Most Cards Out At Once"
Set Cursor 0,440 : Print " Winning Streak"
Set Cursor 0,480 : Print " Loosing Streak"
Set Cursor 0,520 : Print " Number of Double Downs Won"
Set Cursor 0,560 : Print " Number of Times Busted"
Set Cursor 0,600 : Print " Number of Pushes"
Set Cursor 0,640 : Print " Number of Splits"
Set Cursor 0,680 : Print " Rating"
Set cursor 400,130 : print money_p1
Set Text size 20
Set cursor 400,200 : Print num_blackjacks
Set cursor 400,240 : Print win_games," out of ",num_games
Set cursor 400,280 : Print avg_bet#
Set cursor 400,320 : Print win_bets," out of ",num_bets
Set cursor 400,360 : Print hi_bet#
Set cursor 400,400 : Print most_cards," Cards"
Set cursor 400,440 : Print win_streak
Set cursor 400,480 : Print loose_streak
Set cursor 400,520 : Print win_dbl," out of ",num_dbl
Set cursor 400,560 : Print num_busts
Set cursor 400,600 : Print num_pushes
Set cursor 400,640 : Print num_splits
Set cursor 400,680 : Print rating$
Sprite spr_mouse,MouseX(),MouseY(),mouse
sync
endwhile
endfunction
function match_end()
if money_p1 = max_money
bet = -9
endif
if money_p1 = 0
bet = -10
endif
endfunction
rem Insurance for plausible blackjack
function _insurance()
Show Sprite spr_yes_off
Show Sprite spr_no_off
while ins = 2
draw_hud()
draw_cards()
Sprite spr_mouse,MouseX(),MouseY(),mouse
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "WOULD YOU LIKE TO BUY INSURANCE?"
if sprite collision(spr_mouse,spr_yes_off)
Show Sprite spr_yes_on
if mouseclick() = 1
ins = 1
dec money_p1,p1_Bet#*0.5
endif
while mouseclick() = 1
endwhile
else
Hide Sprite spr_yes_on
Show Sprite spr_yes_off
endif
if sprite collision(spr_mouse,spr_no_off)
Show Sprite spr_no_on
if mouseclick() = 1
ins = -1
dec money_p1,p1_Bet#*0.5
endif
while mouseclick() = 1
endwhile
else
Hide Sprite spr_no_on
Show Sprite spr_no_off
endif
sync
endwhile
Hide Sprite spr_yes_off
Hide Sprite spr_yes_on
Hide Sprite spr_no_off
Hide Sprite spr_no_on
endfunction
function check_win() ` Check totals to determine who won the bet
if ai_total > p1_total and ai_total <= 21 and bet = 1
inc money_ai,p1_Bet#
dec money_p1,p1_Bet#
dec streak,1
if ins = 1 then inc money_ai,p1_Bet#*0.5
bet = -6
endif
if p1_total > ai_total and p1_total <= 21 and bet = 1
inc money_p1,p1_Bet#
dec money_ai,p1_Bet#
inc streak,1
inc win_bets,1
if ins = 1 then inc money_ai,p1_Bet#*0.5
if double_down = 1 then inc win_dbl,1
bet = -7
endif
rem Push
if ai_total = p1_total
bet = -8
inc num_pushes,1
if down_down = 1 then dec num_dbl,1
endif
endfunction
function _ai() ` Simple Intelligence for the Dealer to follow
Rem If ai card total is lower than 17 then hit
if ai_total < 17
inc c_out_ai,1
ai_Suite(c_out_ai) = rnd(3)+1
ai_Number(c_out_ai) = rnd(12)+1
if ai_Number(c_out_ai) >= 2 and ai_Number(c_out_ai) <= 10 then inc ai_total,ai_Number(c_out_ai)
if ai_Number(c_out_ai) > 10 then inc ai_total,10
if ai_Number(c_out_ai) = 1
if ai_total > 11 then inc ai_total,1
if ai_total <= 11 then inc ai_total,11
endif
if ai_total > 21 Then ai_bust = 1
endif
Rem If ai card total is 17 or greater then check who won
if ai_total >= 17 and ai_total <= 21 then check_win()
endfunction
function _blackjack() ` If anyone has received a blackjack
if p1_blackjack = 1 and ai_blackjack = 0 and bet = 1
inc money_p1,p1_Bet#
dec money_ai,p1_Bet#
inc num_blackjacks,1
inc streak,1
inc win_bets,1
bet = -4
endif
if ai_blackjack = 1 and p1_blackjack = 0 and bet = 1
if ins <= 0 then inc money_ai,p1_Bet# ` if no insurance
if ins <= 0 then dec money_p1,p1_Bet# ` if no insurance
if ins <= 0 then dec streak,1
if ins = 1 then inc money_p1,p1_Bet#*0.5
ai_turn = 1
bet = -5
endif
rem if both players received a blackjack then it's a push
if p1_blackjack = 1 and ai_blackjack = 1
bet = -8
inc num_pushes,1
endif
p1_blackjack = 0
ai_blackjack = 0
endfunction
function _bust() ` If anyone busted
if p1_bust = 1
dec money_p1,p1_Bet#
inc money_ai,p1_Bet#
inc num_busts,1
dec streak,1
bet = -2
endif
if ai_bust = 1
dec money_ai,p1_Bet#
inc money_p1,p1_Bet#
inc streak,1
bet = -3
endif
p1_bust = 0
ai_bust = 0
endfunction
function _hit() ` Give the player another card
hit = 0
p1_Suite(c_out) = rnd(3)+1
p1_Number(c_out) = rnd(12)+1
if p1_Number(c_out) >= 2 and p1_Number(c_out) <= 10 then inc p1_total,p1_Number(c_out)
if p1_Number(c_out) > 10 then inc p1_total,10
if p1_Number(c_out) = 1
if p1_total > 11 then inc p1_total,1
if p1_total <= 10
inc p1_total,11
inc ace_tracker,1
endif
endif
if p1_total > 21 and ace_tracker >= 1
dec p1_total,10
dec ace_tracker,1
endif
if p1_total > 21 Then p1_bust = 1
while mouseclick() = 1
endwhile
endfunction
function draw_cards() ` draws the current cards on the table
if received_p1 = 1
paste image cards(p1_Suite(0),p1_Number(0)),100,500
paste image cards(p1_Suite(1),p1_Number(1)),200,500
for a = 2 to c_out ` draws all the cards out
paste image cards(p1_Suite(a),p1_Number(a)),(a+1)*100,500
next a
endif
if received_ai = 1 and ai_turn = 0
paste image cards(ai_Suite(0),ai_Number(0)),100,100
if bet = 1 then paste image img_front,200,100
if bet < 0 then paste image cards(ai_Suite(1),ai_Number(1)),200,100
endif
if received_ai = 1 and ai_turn = 1
paste image cards(ai_Suite(0),ai_Number(0)),100,100
paste image cards(ai_Suite(1),ai_Number(1)),200,100
for b = 2 to c_out_ai ` draws all the cards out
paste image cards(ai_Suite(b),ai_Number(b)),(b+1)*100,100
next b
endif
endfunction
function get_cards() ` Deal the first two cards
if received_p1 = 0
p1_Suite(0) = rnd(3)+1 : p1_Number(0) = rnd(12)+1
p1_Suite(1) = rnd(3)+1 : p1_Number(1) = rnd(12)+1
received_p1 = 1
if p1_Number(0) = 1 and p1_Number(1) = 1 then c_scanner = 1
if p1_Number(0) >= 2 and p1_Number(0) <= 10 then inc p1_total,p1_Number(0)
if p1_Number(0) > 10 then inc p1_total,10
if p1_Number(0) = 1
if p1_total >= 11 then inc p1_total,1
if p1_total <= 10
inc p1_total,11
ace_tracker = 1
endif
endif
if p1_Number(1) >= 2 and p1_Number(1) <= 10 then inc p1_total,p1_Number(1)
if p1_Number(1) > 10 then inc p1_total,10
if p1_Number(1) = 1
if p1_total >= 11 then inc p1_total,1
if p1_total <= 10
inc p1_total,11
ace_tracker = 1
endif
endif
if p1_Number(0) = 1 and p1_Number(1) = 1
p1_total = 12
ace_tracker = 1
endif
endif
if received_ai = 0
ai_Suite(0) = rnd(3)+1 : ai_Number(0) = rnd(12)+1
ai_Suite(1) = rnd(3)+1 : ai_Number(1) = rnd(12)+1
received_ai = 1
if ai_Number(0) >= 2 and ai_Number(0) <= 10 then inc ai_total,ai_Number(0)
if ai_Number(0) > 10 then inc ai_total,10
if ai_Number(0) = 1
if ai_total > 11 then inc ai_total,1
if ai_total <= 10
inc ai_total,11
ace_tracker = 1
endif
endif
if ai_Number(1) >= 2 and ai_Number(1) <= 10 then inc ai_total,ai_Number(1)
if ai_Number(1) > 10 then inc ai_total,10
if ai_Number(1) = 1
if ai_total > 11 then inc ai_total,1
if ai_total <= 10 then inc ai_total,11
endif
if ai_Number(0) = 1 and ai_Number(1) = 1 then ai_total = 12
endif
if ai_Number(0) = 1 and ins = 0
ins = 2
_insurance()
endif
endfunction
rem Draws as well as handles HUD interaction
function draw_hud()
Set Text Font "Arial" : Set Text Size 19
paste image img_bg,0,0
rem RESTART BUTTON
if Sprite Collision (spr_mouse,spr_restart_off)
Hide Sprite spr_restart_off
Show Sprite spr_restart_on
if mouseclick() = 1
bet = 0
received_p1 = 0
received_ai = 0
c_out = 1
p1_total = 0
ai_total = 0
ai_turn = 0
c_out_ai = 1
ins = 0
c_scanner = 0
ace_tracker = 0
money_p1 = s_money
money_ai = s_money
p1_Bet# = 0
Hide Sprite spr_deal_on
Show Sprite spr_deal_off
endif
else
Show Sprite spr_restart_off
Hide Sprite spr_restart_on
endif
rem CASH OUT BUTTON
if Sprite Collision (spr_mouse,spr_cash_off)
Hide Sprite spr_cash_off
Show Sprite spr_cash_on
if mouseclick() = 1
_cashout()
endif
else
Show Sprite spr_cash_off
Hide Sprite spr_cash_on
endif
rem DEAL BUTTON
if p1_Bet# > 0 and bet <= 0 and ins < 2 then Show Sprite spr_deal_on
if Sprite Collision (spr_mouse,spr_deal_on)
if mouseclick() = 1 And bet < 1 and p1_Bet# > 0
bet = 1
received_p1 = 0
received_ai = 0
c_out = 1
p1_total = 0
ai_total = 0
ai_turn = 0
c_out_ai = 1
ins = 0
c_scanner = 0
ace_tracker = 0
inc num_bets,1
inc total_bet#,p1_Bet#
Show Sprite spr_deal_off
Hide Sprite spr_deal_on
endif
while mouseclick() = 1
endwhile
endif
rem STAY BUTTON
if bet = 1 and ins < 2
Show Sprite spr_stay_on
else
Hide Sprite spr_stay_on
Show Sprite spr_stay_off
endif
if Sprite Collision (spr_mouse,spr_stay_on)
if mouseclick() = 1 and bet = 1 and ai_turn = 0 and ins < 2
ai_turn = 1
endif
while mouseclick() = 1
endwhile
endif
rem HIT BUTTON
if bet = 1 and ins < 2
Show Sprite spr_hit_on
else
Hide Sprite spr_hit_on
Show Sprite spr_hit_off
endif
if Sprite Collision (spr_mouse,spr_hit_on)
if mouseclick() = 1 and bet = 1 and ai_turn = 0 and ins < 2
hit = 1
inc c_out,1
endif
while mouseclick() = 1
endwhile
endif
rem DOUBLE DOWN BUTTON
if bet = 1 and ins < 2 and p1_Bet#*2 <= money_p1
Show Sprite spr_dbl_on
else
Hide Sprite spr_dbl_on
Show Sprite spr_dbl_off
endif
if Sprite Collision (spr_mouse,spr_dbl_on)
if mouseclick() = 1 and bet = 1 and p1_Bet#*2 <= money_p1 and ai_turn = 0 and ins < 2
inc p1_Bet#,p1_Bet#
hit = 1
ai_turn = 1
inc num_dbl,1
double_down = 1
inc c_out
endif
while mouseclick() = 1
endwhile
endif
if mouseX() >= 605 and mouseX() <= 660
if mouseY() >= screen height()-41 and mouseY() <= screen height()-8
paste image split_on,605,screen height()-40 ` SPLIT
endif
endif
rem BET 5 BUTTON
if bet <= 0
Show Sprite spr_b5_on
else
Hide Sprite spr_b5_on
Show Sprite spr_b5_off
endif
if Sprite Collision (spr_mouse,spr_b5_on)
if mouseclick() = 1 and bet < 1
inc p1_Bet#,5
if p1_Bet# >= money_p1 then p1_Bet# = money_p1
endif
while mouseclick() = 1
endwhile
if mouseclick() = 2 and bet < 1
dec p1_Bet#,5
endif
while mouseclick() = 2
endwhile
endif
rem BET 10 BUTTON
if bet <= 0
Show Sprite spr_b10_on
else
Hide Sprite spr_b10_on
Show Sprite spr_b10_off
endif
if Sprite Collision (spr_mouse,spr_b10_on)
if mouseclick() = 1 and bet < 1
inc p1_Bet#,10
if p1_Bet# >= money_p1 then p1_Bet# = money_p1
endif
while mouseclick() = 1
endwhile
if mouseclick() = 2 and bet < 1
dec p1_Bet#,10
endif
while mouseclick() = 2
endwhile
endif
rem BET 25 BUTTON
if bet <= 0
Show Sprite spr_b25_on
else
Hide Sprite spr_b25_on
Show Sprite spr_b25_off
endif
if Sprite Collision (spr_mouse,spr_b25_on)
if mouseclick() = 1 and bet < 1
inc p1_Bet#,25
if p1_Bet# >= money_p1 then p1_Bet# = money_p1
endif
while mouseclick() = 1
endwhile
if mouseclick() = 2 and bet < 1
dec p1_Bet#,25
endif
while mouseclick() = 2
endwhile
endif
rem BET 50 BUTTON
if bet <= 0
Show Sprite spr_b50_on
else
Hide Sprite spr_b50_on
Show Sprite spr_b50_off
endif
if Sprite Collision (spr_mouse,spr_b50_on)
if mouseclick() = 1 and bet < 1
inc p1_Bet#,50
if p1_Bet# >= money_p1 then p1_Bet# = money_p1
endif
while mouseclick() = 1
endwhile
if mouseclick() = 2 and bet < 1
dec p1_Bet#,50
endif
while mouseclick() = 2
endwhile
endif
rem BET 100 BUTTON
if bet <= 0
Show Sprite spr_b100_on
else
Hide Sprite spr_b100_on
Show Sprite spr_b100_off
endif
if Sprite Collision (spr_mouse,spr_b100_on)
if mouseclick() = 1 and bet < 1
inc p1_Bet#,100
if p1_Bet# >= money_p1 then p1_Bet# = money_p1
endif
while mouseclick() = 1
endwhile
if mouseclick() = 2 and bet < 1
dec p1_Bet#,100
endif
while mouseclick() = 2
endwhile
endif
rem BET 500 BUTTON
if bet <= 0
Show Sprite spr_b500_on
else
Hide Sprite spr_b500_on
Show Sprite spr_b500_off
endif
if Sprite Collision (spr_mouse,spr_b500_on)
if mouseclick() = 1 and bet < 1
inc p1_Bet#,500
if p1_Bet# >= money_p1 then p1_Bet# = money_p1
endif
while mouseclick() = 1
endwhile
if mouseclick() = 2 and bet < 1
dec p1_Bet#,500
endif
while mouseclick() = 2
endwhile
endif
if received_p1 = 1 ` Show the player's card total
ink rgb(0,0,0),1 : box 75,500,95,520
ink rgb(255,255,255),1 : set cursor 75,500
print p1_total
endif
if received_ai = 1 and ai_turn = 1 ` Show the Dealer's card total
ink rgb(0,0,0),1 : box 75,100,95,120
ink rgb(255,255,255),1 : set cursor 75,100
print ai_total
endif
REM Display the Player's and Dealer's current funds
set cursor 10,screen height()-40 : ink RGB(25,200,0),1
Print "YOU: $ ",money_p1," DEALER: $",money_ai
REM Display the proper messages for current game conditions
if bet = 0
Set cursor screen width()/2 - 100,10 : ink rgb(255,255,255),1
print "PLEASE PLACE YOUR BET"
endif
if bet = -2
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "YOU BUSTED! DEALER WINS! PLEASE PLACE YOUR BET"
endif
if bet = -3
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "THE DEALER BUSTED! YOU WIN! PLEASE PLACE YOUR BET"
endif
if bet = -4
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "YOU RECEIVED A BLACK JACK! YOU WON!"
endif
if bet = -5
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "THE DEALER RECEIVED A BLACK JACK! YOU LOST!"
endif
if bet = -6
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "THE DEALER HAS WON! YOU LOST!"
endif
if bet = -7
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "CONGRATULATIONS YOU WIN"
endif
if bet = -8
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "IT'S A PUSH! NOBODY WINS!"
endif
if bet = -9
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "CONGRATULATIONS! YOU'VE WON ALL THE DEALERS MONEY"
endif
if bet = -10
Set cursor screen width()/2 - 200,10 : ink rgb(255,255,255),1
print "YOU HAVE LOST ALL YOUR MONEY!"
endif
REM Prevent player from betting under 0 and exceed current funds
ink RGB(255,255,255),1
if p1_Bet# < 0 then p1_Bet# = 0
if p1_Bet# > money_p1
p1_Bet# = money_p1
if p1_Bet# >= money_ai then p1_Bet# = money_ai
ink rgb(255,100,0),1
endif
set cursor 945,screen height()-40 : Print "Bet: ",p1_Bet#
endfunction
rem Creates the table and HUD buttons
function create_bg()
set cursor screen width()/2-10,screen height()/2
ink RGB(250,250,250),1 : print "LOADING..."
wait 100
sync on
rem Create the mouse graphic
cls
ink rgb(25,25,25),1
line 100,100,100,115
line 100,100,110,110
line 100,115,110,110
ink rgb(150,150,150),1 : line 101,102,101,114
ink rgb(160,160,160),1 : line 102,103,102,114
ink rgb(170,170,170),1 : line 103,104,103,113
ink rgb(180,180,180),1 : line 104,105,104,113
ink rgb(190,190,190),1 : line 105,106,105,112
ink rgb(200,200,200),1 : line 106,107,106,112
ink rgb(210,210,210),1 : line 107,108,107,111
ink rgb(220,220,220),1 : line 108,109,108,111
Global mouse
Global spr_mouse
mouse = free_image()
spr_mouse = free_sprite()
get image mouse,99,99,111,116
Sprite spr_mouse,mouseX(),mouseY(),mouse
Set Sprite Priority spr_mouse,3
cls
ink rgb(50,50,50),1
box 400,screen height()-41,476,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,475,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print "CASH OUT"
Global cash_off
Global spr_cash_off
cash_off = free_image()
spr_cash_off = free_sprite()
Get image cash_off,400,screen height()-41,476,screen height()-8
Sprite spr_cash_off,10,10,cash_off
Set Sprite Priority spr_cash_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,476,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,475,screen height()-9,75,50,0,5,1,1,0)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print "CASH OUT"
Global cash_on
Global spr_cash_on
cash_on = free_image()
spr_cash_on = free_sprite()
Get image cash_on,400,screen height()-41,476,screen height()-8
Sprite spr_cash_on,10,10,cash_on
Hide Sprite spr_cash_on
Set Sprite Priority spr_cash_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,471,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,470,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print "RESTART"
Global restart_off
Global spr_restart_off
restart_off = free_image()
spr_restart_off = free_sprite()
Get image restart_off,400,screen height()-41,471,screen height()-8
Sprite spr_restart_off,950,10,restart_off
Set Sprite Priority spr_restart_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,471,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,470,screen height()-9,0,45,75,5,1,1,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print "RESTART"
Global restart_on
Global spr_restart_on
restart_on = free_image()
spr_restart_on = free_sprite()
Get image restart_on,400,screen height()-41,471,screen height()-8
Sprite spr_restart_on,950,10,restart_on
Hide Sprite spr_restart_on
Set Sprite Priority spr_restart_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print " YES"
Global yes_off
Global spr_yes_off
yes_off = free_image()
spr_yes_off = free_sprite()
Get image yes_off,400,screen height()-41,445,screen height()-8
Sprite spr_yes_off,650,10,spr_yes_off
Hide Sprite spr_yes_off
Set Sprite Priority spr_yes_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,100,5,0,1,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print " YES"
Global yes_on
Global spr_yes_on
yes_on = free_image()
spr_yes_on = free_sprite()
Get image yes_on,400,screen height()-41,445,screen height()-8
Sprite spr_yes_on,650,10,yes_on
Hide Sprite spr_yes_on
Set Sprite Priority spr_yes_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print " NO"
Global no_off
Global spr_no_off
no_off = free_image()
spr_no_off = free_sprite()
Get image no_off,400,screen height()-41,445,screen height()-8
Sprite spr_no_off,700,10,no_off
Hide Sprite spr_no_off
Set Sprite Priority spr_no_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,100,5,0,1,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print " NO"
Global no_on
Global spr_no_on
no_on = free_image()
spr_no_on = free_sprite()
Get image no_on,400,screen height()-41,445,screen height()-8
Sprite spr_no_on,700,10,no_on
Hide Sprite spr_no_on
Set Sprite Priority spr_no_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print "STAY"
Global stay_off
Global spr_stay_off
stay_off = free_image()
spr_stay_off = free_sprite()
Get image stay_off,400,screen height()-41,445,screen height()-8
Sprite spr_stay_off,400,screen height()-40,stay_off
Set Sprite Priority spr_stay_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,0,1,1,0,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print "STAY"
Global stay_on
Global spr_stay_on
stay_on = free_image()
spr_stay_on = free_sprite()
Get image stay_on,400,screen height()-41,445,screen height()-8
Sprite spr_stay_on,400,screen height()-40,stay_on
Hide Sprite spr_stay_on
Set Sprite Priority spr_stay_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print " HIT"
Global hit_off
Global spr_hit_off
hit_off = free_image()
spr_hit_off = free_sprite()
Get image hit_off,400,screen height()-41,445,screen height()-8
Sprite spr_hit_off,450,screen height()-40,hit_off
Set Sprite Priority spr_hit_off,2
cls
ink rgb(200,200,200),1
ink rgb(50,50,50),1
box 400,screen height()-41,445,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,444,screen height()-9,0,0,0,1,1,0,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print " HIT"
Global hit_on
Global spr_hit_on
hit_on = free_image()
spr_hit_on = free_sprite()
Get image hit_on,400,screen height()-41,445,screen height()-8
Sprite spr_hit_on,450,screen height()-40,hit_on
Hide Sprite spr_hit_on
Set Sprite Priority spr_hit_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,500,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,499,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print "DOUBLE DOWN"
Global dbl_off
Global spr_dbl_off
dbl_off = free_image()
spr_dbl_off = free_sprite()
Get image dbl_off,400,screen height()-41,500,screen height()-8
Sprite spr_dbl_off,500,screen height()-40,dbl_off
Set Sprite Priority spr_dbl_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,500,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,499,screen height()-9,0,0,0,1,1,0,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print "DOUBLE DOWN"
Global dbl_on
Global spr_dbl_on
dbl_on = free_image()
spr_dbl_on = free_sprite()
Get image dbl_on,400,screen height()-41,500,screen height()-8
Sprite spr_dbl_on,500,screen height()-40,dbl_on
Hide Sprite spr_dbl_on
Set Sprite Priority spr_dbl_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,450,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,449,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print "SPLIT"
Global split_off
Global spr_split_off
split_off = free_image()
spr_split_off = free_sprite()
Get image split_off,400,screen height()-41,450,screen height()-8
Sprite spr_split_off,605,screen height()-40,split_off
Set Sprite Priority spr_split_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,450,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,449,screen height()-9,0,0,0,1,1,0,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print "SPLIT"
Global split_on
Global spr_split_on
split_on = free_image()
spr_split_on = free_sprite()
Get image split_on,400,screen height()-41,450,screen height()-8
Sprite spr_split_on,605,screen height()-40,split_on
Hide Sprite spr_split_on
Set Sprite Priority spr_dbl_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,1,0,0)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print " 5"
Global b5_off
Global spr_b5_off
b5_off = free_image()
spr_b5_off = free_sprite()
Get image b5_off,400,screen height()-41,435,screen height()-8
Sprite spr_b5_off,700,screen height()-40,b5_off
Set Sprite Priority spr_b5_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(100,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,1,0,0)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print " 5"
Global b5_on
Global spr_b5_on
b5_on = free_image()
spr_b5_on = free_sprite()
Get image b5_on,400,screen height()-41,435,screen height()-8
Sprite spr_b5_on,700,screen height()-40,b5_on
Hide Sprite spr_b5_on
Set Sprite Priority spr_b5_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,0,1,0)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print "1 0"
Global b10_off
Global spr_b10_off
b10_off = free_image()
spr_b10_off = free_sprite()
Get image b10_off,400,screen height()-41,435,screen height()-8
Sprite spr_b10_off,740,screen height()-40,b10_off
Set Sprite Priority spr_b10_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,100,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,0,1,0)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print "1 0"
Global b10_on
Global spr_b10_on
b10_on = free_image()
spr_b10_on = free_sprite()
Get image b10_on,400,screen height()-41,435,screen height()-8
Sprite spr_b10_on,740,screen height()-40,b10_on
Hide Sprite spr_b10_on
Set Sprite Priority spr_b10_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,0,0,1)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print "2 5"
Global b25_off
Global spr_b25_off
b25_off = free_image()
spr_b25_off = free_sprite()
Get image b25_off,400,screen height()-41,435,screen height()-8
Sprite spr_b25_off,780,screen height()-40,b25_off
Set Sprite Priority spr_b25_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,100,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,0,0,1)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print "2 5"
Global b25_on
Global spr_b25_on
b25_on = free_image()
spr_b25_on = free_sprite()
Get image b25_on,400,screen height()-41,435,screen height()-8
Sprite spr_b25_on,780,screen height()-40,b25_on
Hide Sprite spr_b25_on
Set Sprite Priority spr_b25_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,1,1,0)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print "5 0"
Global b50_off
Global spr_b50_off
b50_off = free_image()
spr_b50_off = free_sprite()
Get image b50_off,400,screen height()-41,435,screen height()-8
Sprite spr_b50_off,820,screen height()-40,b50_off
Set Sprite Priority spr_b50_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,100,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,1,1,0)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print "5 0"
Global b50_on
Global spr_b50_on
b50_on = free_image()
spr_b50_on = free_sprite()
Get image b50_on,400,screen height()-41,435,screen height()-8
Sprite spr_b50_on,820,screen height()-40,b50_on
Hide Sprite spr_b50_on
Set Sprite Priority spr_b50_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,1,0,1)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print "100"
Global b100_off
Global spr_b100_off
b100_off = free_image()
spr_b100_off = free_sprite()
Get image b100_off,400,screen height()-41,435,screen height()-8
Sprite spr_b100_off,860,screen height()-40,b100_off
Set Sprite Priority spr_b100_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,100,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,1,0,1)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print "100"
Global b100_on
Global spr_b100_on
b100_on = free_image()
spr_b100_on = free_sprite()
Get image b100_on,400,screen height()-41,435,screen height()-8
Sprite spr_b100_on,860,screen height()-40,b100_on
Hide Sprite spr_b100_on
Set Sprite Priority spr_b100_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,0.5,0,0,1)
ink rgb(100,100,100),1
set cursor 405,screen height()-33 : print "500"
Global b500_off
Global spr_b500_off
b500_off = free_image()
spr_b500_off = free_sprite()
Get image b500_off,400,screen height()-41,435,screen height()-8
Sprite spr_b500_off,900,screen height()-40,b500_off
Set Sprite Priority spr_b500_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,435,screen height()-8
ink rgb(0,100,0),1
_gradient(401,screen height()-40,434,screen height()-9,0,0,0,5,10,1,1)
ink rgb(255,255,255),1
set cursor 405,screen height()-33 : print "500"
Global b500_on
Global spr_b500_on
b500_on = free_image()
spr_b500_on = free_sprite()
Get image b500_on,400,screen height()-41,435,screen height()-8
Sprite spr_b500_on,900,screen height()-40,b500_on
Hide Sprite spr_b500_on
Set Sprite Priority spr_b500_on,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,450,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,449,screen height()-9,0,0,0,1,1,1,1)
ink rgb(50,50,50),1
set cursor 405,screen height()-33 : print "DEAL"
Global deal_off
Global spr_deal_off
deal_off = free_image()
spr_deal_off = free_sprite()
Get image deal_off,400,screen height()-41,450,screen height()-8
Sprite spr_deal_off,345,screen height()-40,deal_off
Set Sprite Priority spr_deal_off,2
cls
ink rgb(50,50,50),1
box 400,screen height()-41,450,screen height()-8
ink rgb(0,0,0),1
_gradient(401,screen height()-40,449,screen height()-9,25,25,25,5,1,1,1)
ink rgb(200,200,50),1
set cursor 405,screen height()-33 : print "DEAL"
Global deal_on
Global spr_deal_on
deal_on = free_image()
spr_deal_on = free_sprite()
Get image deal_on,400,screen height()-41,450,screen height()-8
Sprite spr_deal_on,345,screen height()-40,deal_on
Hide Sprite spr_deal_on
Set Sprite Priority spr_deal_on,2
rem Create the background
_gradient(0,0,screen width(),screen height(),0,10,0,0.05,0,1,0)
_gradient(0,0,screen width(),50,0,0,0,0.25,1,1,1)
_gradient(0,screen height()-50,screen width(),screen height(),0,0,0,0.25,1,1,1)
Global img_bg
Global spr_bg
img_bg = free_image()
spr_bg = free_sprite()
get image img_bg,0,0,screen width(),screen height()
`Sprite spr_bg,0,0,img_bg
`Set Sprite Priority spr_bg,1
endfunction
rem Front graphic of a card
function c_front()
ink rgb(255,255,255),1
box 0,0,screen width(),screen height()
ink rgb(0,0,0),1
box c_width,c_height,c_width*2,c_height*2
ink rgb(255,255,255),1
_gradient(c_width+1,c_height+1,c_width*2-1,c_height*2-1,225,225,200,0.25,1,1,1)
ink rgb(25,25,100),1
box c_width+5,c_height+5,c_width*2-5,c_height*2-5
ink rgb(255,255,255),1
box c_width+7,c_height+7,c_width*2-7,c_height*2-7
ink rgb(25,25,100),1
box c_width+8,c_height+8,c_width*2-8,c_height*2-8
ink rgb(255,255,255),1
box c_width+10,c_height+10,c_width*2-10,c_height*2-10
ink rgb(25,25,100),1
_gradient(c_width+11,c_height+11,c_width*2-11,c_height*2-11,25,25,100,1,0,0,1)
Global img_front
img_front = free_image()
Get Image img_front,c_width,c_height,c_width+90,c_height+120
cls
endfunction
rem The back graphic of a card
function c_back()
ink rgb(255,255,255),1
box 0,0,screen width(),screen height()
ink rgb(0,0,0),1
box c_width,c_height,c_width*2,c_height*2
ink rgb(255,255,255),1
_gradient(c_width+1,c_height+1,c_width*2-1,c_height*2-1,225,225,200,0.25,1,1,1)
Global img_back
img_back = free_image()
Get image img_back,c_width,c_height,c_width*2,c_height*2
cls
endfunction
rem Create all the cards
function make_cards()
for suite = 167 to 170
for number = 1 to 13
cls
paste image img_back,10,10
align_font(suite,number)
align_symbols(suite,number)
cards(n+1,number) = free_image()
Get Image cards(n+1,number),10,10,c_width+10,c_height+10
next b
inc n,1
next a
endfunction
` Will properly position the symbols and numbers before
` grabbing the images
function align_symbols(suite,number)
ink RGB(255,0,0),1
if suite = 167 then ink RGB(0,0,0),1
if suite = 170 then ink RGB(0,0,0),1
if number = 1 and suite = 170
set text size 125
set cursor 25,10 : print chr$(suite)
endif
if number = 1 and suite < 170
set text size 35
set cursor 47,47 : print chr$(suite)
endif
if number = 2
set text size 35
set cursor 47,15 : print chr$(suite)
set cursor 47,80 : print chr$(suite)
endif
if number = 3
set text size 35
set cursor 47,15 : print chr$(suite)
set cursor 47,80 : print chr$(suite)
set cursor 47,47 : print chr$(suite)
endif
if number = 4
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
endif
if number = 5
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 47,47 : print chr$(suite)
endif
if number = 6
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 25,47 : print chr$(suite)
set cursor 68,47 : print chr$(suite)
endif
if number = 7
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 25,47 : print chr$(suite)
set cursor 68,47 : print chr$(suite)
set cursor 47,30 : print chr$(suite)
endif
if number = 8
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 25,47 : print chr$(suite)
set cursor 68,47 : print chr$(suite)
set cursor 47,30 : print chr$(suite)
set cursor 47,65 : print chr$(suite)
endif
if number = 9
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 25,38 : print chr$(suite)
set cursor 25,60 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,38 : print chr$(suite)
set cursor 68,60 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 47,47 : print chr$(suite)
endif
if number = 10
set text size 35
set cursor 25,15 : print chr$(suite)
set cursor 25,38 : print chr$(suite)
set cursor 25,60 : print chr$(suite)
set cursor 25,80 : print chr$(suite)
set cursor 68,15 : print chr$(suite)
set cursor 68,38 : print chr$(suite)
set cursor 68,60 : print chr$(suite)
set cursor 68,80 : print chr$(suite)
set cursor 47,30 : print chr$(suite)
set cursor 47,65 : print chr$(suite)
endif
endfunction
` Set text font and size as well as the position
` in which the numbers are displayed before grabbing
` the card image
function align_font(suite,number)
ink RGB(255,0,0),1
if suite = 167 then ink RGB(0,0,0),1
if suite = 170 then ink RGB(0,0,0),1
set text font "Impact"
set text size 20
if number >= 2 And number <= 9
set cursor 15,12
print number
endif
if number = 1
set cursor 15,12
print "A"
endif
if number = 10
set cursor 15,12
print number
endif
if number = 11
set cursor 15,12
print "J"
endif
if number = 12
set cursor 15,12
print "Q"
endif
if number = 13
set cursor 15,12
print "K"
endif
REM Lower-Right Corner
if number >= 2 And number <= 9
set cursor 87,107
print number
endif
if number = 1
set cursor 87,107
print "A"
endif
if number = 10
set cursor 83,107
print number
endif
if number = 11
set cursor 87,107
print "J"
endif
if number = 12
set cursor 87,107
print "Q"
endif
if number = 13
set cursor 87,107
print "K"
endif
set text font "symbol"
set text size 20
set cursor 14,25 : print chr$(suite)
set cursor 85,92 : print chr$(suite)
endfunction
REM X1,Y1,X2,Y2 is the area which will be filled
REM r#,g#,b# are color presets that will alter the beginning gradient color
REM blend# is the amount at which the color values are incremented
REM ri,gi,bi if all set to 1 will increment corresponding #blend
function _gradient(X1,Y1,X2,Y2,r#,g#,b#,blend#,ri,gi,bi)
for y = Y1 to Y2 - 1
ink RGB(r#,g#,b#),1
line X1,y,X2,y
if ri AND r# < 255 then inc r#,blend#
if gi AND g# < 255 then inc g#,blend#
if bi AND b# < 255 then inc b#,blend#
next y
endfunction
` Will return an image number not currently being used
function free_image()
repeat
inc n,1
until image exist (n) = 0
endfunction n
rem Will return an sprite number not currently being used
function free_sprite()
repeat
inc n,1
until sprite exist (n) = 0
endfunction n
` Set up the display mode
function gfx_mode()
HIDE MOUSE
Set Display Mode 1024,768,32
endfunction