Эта игра имитирует типичный фруктовый (игровой) автомат, доставляя вам все то же удовольствие - но без риска потерять свои кровно заработанные деньги!
Инструкции:
При первом запуске в автомат будет предварительно загружено 100 кредитов - этого хватит как минимум на 10 игр. Вы можете в любое время пополнить автомат дополнительными 100 кредитами, просто нажав на слот "insert coin". Игра завершится, если вы позволите автомату исчерпать кредит. Чтобы запустить вращение барабанов, щелкните указателем мыши по кнопке "START". Когда мигают кнопки "HOLD", каждый из барабанов можно удерживать, нажав на выбранную кнопку.
Те же кнопки можно использовать для нажатия, когда кнопки горят, но не мигают. Индикатор справа от барабанов показывает количество доступных нажатий. Нежелательные удержания можно отменить, нажав на желтую кнопку "C". Нажмите клавишу "B" на клавиатуре, чтобы включить или выключить звуковые сигналы. Эта игра предназначена только для развлечения и не подходит для использования в каких-либо реальных азартных играх вообще.
Автор: Alan Steelbat Dec 2012 (Yabasic v2.763)
Инструкции:
При первом запуске в автомат будет предварительно загружено 100 кредитов - этого хватит как минимум на 10 игр. Вы можете в любое время пополнить автомат дополнительными 100 кредитами, просто нажав на слот "insert coin". Игра завершится, если вы позволите автомату исчерпать кредит. Чтобы запустить вращение барабанов, щелкните указателем мыши по кнопке "START". Когда мигают кнопки "HOLD", каждый из барабанов можно удерживать, нажав на выбранную кнопку.
Те же кнопки можно использовать для нажатия, когда кнопки горят, но не мигают. Индикатор справа от барабанов показывает количество доступных нажатий. Нежелательные удержания можно отменить, нажав на желтую кнопку "C". Нажмите клавишу "B" на клавиатуре, чтобы включить или выключить звуковые сигналы. Эта игра предназначена только для развлечения и не подходит для использования в каких-либо реальных азартных играх вообще.
Автор: Alan Steelbat Dec 2012 (Yabasic v2.763)
Код: Выделить всё
# ======================================================================================================================================================= #
documentation
doc Yabasic v2.763 Alan Steelbat.Dec.2012
doc
doc FRUITS
doc This game simulates a typical fruit (slot) machine giving you all
doc the same fun - but without the risk of losing your hard-earned cash!
doc
doc Instructions:
doc When first starting, the machine will be pre-loaded with 100 credit
doc - enough for at least 10 plays.
doc You may feed the machine an extra 100 credit at any time simply by
doc clicking on the "insert coin" slot.
doc The game will finish if you allow the machine to run out of credit.
doc
doc To start the reels spinning click with the mouse pointer held over
doc the "START" button.
doc When the "HOLD" buttons are flashing each of the reels may be held
doc by clicking on the chosen button.
doc The same buttons may be used for nudging when the buttons are lit
doc but not flashing. An indicator to the right of the reels shows the
doc number of nudges available.
doc Unwanted holds may be cleared by clicking on the yellow "C" button.
doc Press key "B" on the keyboard to toggle beep sounds on or off.
doc
doc This game is intended For Amusement Only
doc and is NOT suitable to be used for any form of real gambling whatsoever.
docu
clear screen : for a=1 to arraysize(docu$(),1) : print docu$(a) : next a
# ======================================================================================================================================================= #
label Setting_Up
open window 590,720
dim rl$(3), hold(3), c(3) , key(18,4), top(18,3) , bas(18,3) , chance(3)
credit=100 : n=1
Fascia() : Creditbox() : Shapes() : Reels(): Holdbuttons() // Initialisation call for subroutines
for i=0 to 6 : read x,y : putbit dt$,x,y,"t" : putbit db$,x,y+49,"t" : next i // facia coinpile ... has to be after Shapes()
for r=1 to 3 : c(r)= int(ran(15)+1) : RollandShow(r) :next r // put some random fruits in view to start
noise(n) // beep
# ===================================================================================================================================================== #
# ===================================================================================================================================================== #
label Main
repeat
repeat
Flashbuttons()
m$= inkey$ (0.2) // player input
until (m$<>"")
mx= mousex : my= mousey // set mouse variables
color 1,1,1 : fill box 230,635,300,650 // remove 'win xx' from tray
// -------------------------------------------------------------------------------------------------------------------
if (m$="b" and n=1) then :n=0 // beep off
elseif (m$="b" and n=0) let n=1 // beep on
endif // toggled by pressing B on keyboard
// -------------------------------------------------------------------------------------------------------------------
if mx>535 and mx<565 and my<100 and my>21 then // test for 'coin inserted' click
for i=10 to 100 step 10
credit=credit+10 : if credit>99990 let credit=99990 // add the credit
wait 0.1 : Creditbox() // display it
noise(n)
next i
endif
// ----------------------------------------------------------------------------------------------------------------------
if (mx>450 and mx<520 and my>525 and my<595) then // test 'start' button pressed
for b=1 to 3 : if hold(b)=2 let hold(b)=0 : nudge=0 // turn unused nudges off
next b : Flash=0 : Holdbuttons() // and dims unused hold buttons
credit=credit-10 : Creditbox() // pay for this go
SpinReels() // Roll 'Em!
Set_Holds_and_Nudges() // what it says
endif
Holds() // do any holds
Nudges() // do any nudges
until (credit<=0 and nudge<=0) // ya forgot to put a coin in....
clear fill box 150,635,430,650
text 165,650,"You Are Now Broke! .. Game Over .."
wait 5 : EXIT
# ===================================================================================================================================================== #
# ============================================================= Subroutines ====================================================================== #
sub Flashbuttons()
if sbc<>220 then :sbc=220 : elseif sbc=220 then :sbc=150 : endif // toggle variable for START button flashing
color sbc,0,0 : fill circle 485,560,40 : color 1,1,1 : circle 485,560,35 : text 464,566,"START" // display flashing START button
if hold=1 then // set if HOLD buttons require flashing
if flash=0 then :flash=9 // flash on
elseif flash=9 then :flash=0 // flash off
endif
Holdbuttons()
endif
Vary() // update the variable reel counters
end sub
# ======================================================================================================================================================= #
sub Holdbuttons()
for btn=1 to 3 : j=btn*100
if hold(btn)=0 or (hold=1 and flash=0) putbit hbdim$,j+13,526 // dim
if hold(btn)>0 or (hold=1 and flash=9) putbit hblit$,j+13,526 // lit
next btn
end sub
# ======================================================================================================================================================= #
sub Vary() // each reel has a different variable factor to reduce the likelyhood of sequences being repeated
v1=v1+1: if v1>15 let v1=1 // each sub call increments counter up to 15
chance(1)=v1+int(ran(18)+3) // plus random up to 18 plus 3 to make a minimum roll
// ----------------------------------------------------------
v2=val(mid$(time$,7,2)) : v2=int(v2/4)+1 // seconds past the minute of time divided to 15 max
chance(2)=v2+int(ran(18)+3) // plus random up to 18 plus 3 to make a minimum roll
// ----------------------------------------------------------
chance(3)=int(ran(18)+5) // last reel just relies on random plus 5 for minimum roll
end sub
# ======================================================================================================================================================= #
sub SpinReels()
hold=0 : flash=0 : Holdbuttons()
for r=1 to 3
if hold(r)=0 then // test for reel NOT held
for spin=1 to chance(r) // spin random no.fruits
RollandShow(r)
next spin : noise(n)
endif
next r
Win_test() // did we win ?
for b=1 to 3 : hold(b)=0 : next b : Holdbuttons() // clear all holds
end sub
# ======================================================================================================================================================= #
sub RollandShow(r)
oc=c(r) : c(r)=c(r)-1 : if (c(r)<1) let c(r)=18 // decrement counter array ready to show next fruit
putbit mid$(rl$(r),top(oc,r),half),r*100+15,450,"s" // top of old fruit leaving
putbit mid$(rl$(r),bas(c(r),r),half),r*100+15,401,"s" // bottom of new fruit appearing
putbit mid$(rl$(r),bas(c(r),r),half),r*100+15,450,"s"
putbit mid$(rl$(r),top(c(r),r),half),r*100+15,401,"s" // both halfs of new fruit in position
end sub
# ======================================================================================================================================================== #
sub Set_Holds_and_Nudges()
hn= int(ran(30)+1) // hn = hold/nudge variable
if win>0 then :win=0 :hn=10 : endif // no hold or nudge after win
if hn>17 let hold=1 // random holds for (about) 2/5 of plays
if hn>6 then : hn=0 : nudge=0 // no more than 6 nudges
else let nudge=hn // yay! we have nudges!
endif
n$=str$(nudge) : clear fill box 436,421,454,439 : text 440,438+int(ran(3)),n$ // update number in nudge reel
end sub
# ===================================================================================================================================================== #
sub Holds()
if hold=1 then // test holds flag
for btn=1 to 3 : j=btn*100
if (mx>j+14 and mx<j+85 and my>525 and my<568) let hold(btn)=1 // find if a hold button pressed and hold reel
next btn
endif
// -----------------------------------------------------------------------------------------------------------------------
if (mx>56 and mx<80 and my>536 and my<559) then // test for cancel-holds button pushed
for btn=1 to 3 : hold(btn)=0 : next btn // reset
endif
end sub
# ===================================================================================================================================================== #
sub Nudges()
if (nudge>0) then // test nudge flag
for btn=1 to 3 : hold(btn)=2 : next btn : Holdbuttons() // solid-light hold/nudge buttons
for b=1 to 3 : j=b*100
if (mx>j+14 and mx<j+85 and my>525 and my<568) then // test for button push
hold(b)=0 : Holdbuttons() : r=b : RollandShow(r) // turn off light of pushed button and nudge selected reel
nudge=nudge-1 : hold(b)=2 : Holdbuttons() : noise(n) // decrement counter and turn button light back on
Win_test() // any win ends nudging
if nudge<=0 or win>0 then // test for end of nudges and no nudge after win
nudge=0 : win=0 // reset flags
for btn=1 to 3 : hold(btn)=0 : next btn : Holdbuttons() // turn off button lights
endif
n$=str$(nudge) : clear fill box 436,421,454,439 : text 440,439,n$ // update number in nudge reel
endif
next b
endif
end sub
# ===================================================================================================================================================== #
sub Win_test()
win=0 // start with nil then make it so highest win pays
if key(c(1),1)=1 let win=10 // cherry in reel 1
if key(c(1),1)=key(c(2),2) then // 2 reels the same
if key(c(1),1)>0 let win=20 // 2 cherries/plums/lemons
if key(c(1),1)>3 let win=30 // 2 apples/oranges/melons
if key(c(1),1)>6 let win=40 // 2 bars
if key(c(1),1)=8 let win=50 // 2 dollars
if key(c(1),1)=9 let win=0 // Nothing for only 2 sevens!!
endif
if key(c(1),1)=key(c(2),2) and key(c(1),1)=key(c(3),3) then // 3 reels the same
if key(c(1),1)>0 let win=30 // 3 cherries/plums/lemons
if key(c(1),1)>3 let win=40 // 3 apples/oranges/melons
if key(c(1),1)>6 let win=50 // 3 bars
if key(c(1),1)>7 let win=100 // 3 dollars
if key(c(1),1)=9 let win=200 // 3 sevens ...yay!!
endif
Creditbox() // credit any winnings
end sub
# ======================================================================================================================================================== #
sub Creditbox()
local w,w$ : w=win : w$=str$(win) : wait 0.1 // w=win because variable 'win' is used during nudges
repeat
if w>0 then // test if there's been a win
clear fill box 230,635,300,648 : text 240,650,"WIN " : text 275,650,w$ // note in win tray.
credit=credit+10 : if (credit>99990) let credit=99990 : w=0 // add winnings
w=w-10 : wait 0.2 : noise(n)
endif
clear fill box 527,161,569,179 : if (credit<20) color 255,90,90 :fill box 527,161,569,179
cr$=str$(credit/100000,".#####") : text 524,179,cr$ // display credit
color 160,160,160: box 525,159,571,181 : color 1,1,1 : box 524,158,572,182 : box 526,160,570,180
until (w<1)
end sub
# ======================================================================================================================================================== #
sub Fascia() // Drawing routines all scrunged up
color 210,0,70: fill box 0,0,590,140 // Title panel
color 190,170,50 : fill box 20,10,40,120 : fill box 40,10,90,30 : fill box 40,50,65,70 // F
fill circle 115,70,30 : fill box 80,40,100,120 : for x=113 to 133 : line x,92 to x+17,120 : next x // R
fill circle 180,93,30 : fill box 150,40,170,93 : fill box 190,40,210,93 // U
fill box 220,50,240,120 : fill circle 230,27,10 // I
fill box 250,40,310,60 : fill box 270,60,290,120 // T
fill circle 350,43,30 : fill circle 350,90,35 // S
color 210,0,70 // filling-in
fill circle 350,41,12 : fill circle 348,90,16 : fill circle 115,70,14 : fill circle 180,93,10 : fill box 170,40,190,93
fill triangle 351,53,397,75,380,20 : fill triangle 349,75,315,58,315,97
# ------------------------------------------------------------------------------------------------ #
text 531,20,"insert" : text 536,116,"coin"
color 230,230,230 : fill box 532,20,568,101 : color 200,200,200 : fill box 541,25,559,96
color 140,140,140 : line 541,25,548,27 : line 559,25,552,27 : line 541,96,548,94 : line 559,96,552,94
box 533,21,567,100: color 1,1,1 : box 532,20,568,101 : fill box 548,27,552,94
# ------------------------------------------------------------------------------------------------ #
color 210,210,70: fill box 0,141,590,335 // wins panel
color 0,190,50 // minicherry
triangle 5,170,20,155,20,170: triangle 6,170,19,157,19,170: color 200,0,0 : fill circle 9,166,6: fill circle 19,169,6
ct$=getbit$(3,155,26,175)
color 0,173,40 : fill box 35,160,45,165: fill box 53,160,63,165: text 73,172,"10"
putbit ct$,3,180: putbit ct$,25,180: fill box 53,185,63,190: text 73,197,"20"
putbit ct$,3,205: putbit ct$,25,205: putbit ct$,47,205: : text 73,222,"30"
color 135,10,185 // miniplum
fellipse(12,240,9,6): color 0,173,40 : fill triangle 18,238,22,235,23,237
pt$=getbit$(3,233,26,248): putbit pt$,26,233: fill box 53,235,63,240: text 73,247,"20"
putbit pt$,3,257 : putbit pt$,26,257 : putbit pt$,49,257 : text 73,272,"30"
color 0,190,50 // minilemon
fill box 53,285,63,290: ellipse(12,290,10,5): ellipse(12,290,8,7): color 230,230,0
fellipse(12,290,9,4): fellipse(12,290,7,6)
lt$=getbit$(3,282,26,298): putbit lt$,26,282: text 73,297,"20"
putbit lt$,3,305 : putbit lt$,26,305 : putbit lt$,49,305 : text 73,322,"30"
color 0,190,50 // miniapple
fill triangle 123,155,126,155,125,160 : fill box 166,160,176,165
color 200,0,70: fellipse(120,165,4,7): fellipse(125,165,7,6): fellipse(130,165,4,7)
at$=getbit$(116,154,134,173) : putbit at$,138,154 : text 186,172,"30"
putbit at$,116,180: putbit at$,138,180 : putbit at$,160,180 : text 186,197,"40"
color 230,130,0 // miniorange
fill circle 125,220,9: color 0,190,50: fill circle 128,217,2 : fill box 166,217,176,222
ot$=getbit$(116,210,134,230) : putbit ot$,138,210 : text 186,229,"30"
putbit ot$,116,235: putbit ot$,138,235 : putbit ot$,160,235 : text 186,254,"40"
// minimelon
color 20,130,30 : fellipse(126,275,10,8) : color 210,210,73: fill box 128,265,135,285
color 220,20,20 : fellipse(129,275,4,7)
mt$=getbit$(116,265,135,285) : putbit mt$,138,265 : color 0,190,50 : fill box 166,272,176,277: text 186,284,"30"
putbit mt$,116,289: putbit mt$,138,289 : putbit mt$,160,289 : text 186,306,"40"
color 80,80,50 // minibar
box 229,157,251,170 : box 229,158,251,169: clear fill box 230,159,250,168 : text 230,171,"bar"
bt$=getbit$(229,157,251,170): putbit bt$,257,157 : color 0,190,50 : fill box 290,160,300,165 : text 312,171,"40"
putbit bt$,229,182: putbit bt$,255,182 : putbit bt$,281,182 : text 312,197,"50"
// minidollar == draw in reel slot to get blank backcolor
color 50,50,50 : fill circle 250,450,10 : color 200,180,20 : fill circle 250,450,9 : text 246,457,"$"
dt$=getbit$(239,439,261,461) : putbit dt$,104,59,"t" // (in R of title)
putbit dt$,229,207,"t" : putbit dt$,255,207,"t" : color 0,190,50 : fill box 290,217,300,222 : text 312,229,"50"
putbit dt$,229,235,"t": putbit dt$,255,235,"t" : putbit dt$,281,235,"t" : text 308,254,"100"
color 250,0,0 // miniseven
fill box 232,273,250,278 : for x=234 to 240: line x,293 to x+10,278 : next x
color 200,200,0 : line 236,275 to 246,275 : line 239,289 to 246,278
st$=getbit$(230,272,251,298) : putbit st$,255,272: putbit st$,281,272 : text 308,295,"200"
# ---------------------------------------------------------------------------------------------------------------------------------------- #
cl=210: for l=330 to 630: cl=int(cl-0.1): color 210,cl,70: line 0,l to 590,l: next l // merge face colors
color 1,1,1 : fill circle 485,560,41 // base for start button
color 200,200,200 : fill box 76,376,424,524 :color 230,230,230 : fill box 80,380,420,520 : clear fill box 100,400,400,499 // reels window
color 1,1,1: box 100,400,400,499 : box 80,380,420,520 : box 76,376,424,524 // and ferrule for reels window
line 80,380,76,376 : line 420,520,424,524 : line 80,520,76,524 : line 420,380,424,376 // ferrule corners
box 199,400,201,499 : box 299,400,301,499 // reel dividers
color 200,200,200: fill box 433,418,457,442 : clear fill box 435,420,455,440 // nudgebox
color 1,1,1 : box 435,420,455,440 : box 433,418,457,442
text 475,432, "nudges" : text 470,446, "available" : text 440,438,"0"
color 200,200,50 : fill box 56,536,80,559 : color 1,1,1 : box 56,536,80,559 : box 60,540,76,555 : text 64,556,"C" // cancel button
color 30,30,30 : fill box 0,630,590,720 : color 1,1,1 : fill box 50,630,540,650 // bottom (wins) tray
fill triangle 0,630,49,630,49,650 : fill triangle 541,630,541,650,590,630
text 530,158,"credit" : text 230,325,"highest win pays" : text 200,710,"For Amusement Only"
end sub
# ======================================================================================================================================================= #
sub Shapes()
label Cherry
color 40,175,100 : fellipse(149,427,17,8) : fellipse(169,437,7,13) : color 1,1,1 : ellipse(149,427,17,8) : ellipse(169,437,7,13) // leaves
color 40,200,70 : y1=454 : x2=162 : y2=425 : for x1=156 to 161 : x2=x2+1.2 : line x1,y1,int(x2),y2 : next x1 // stalk
color 20,250,70 : y1=455 : x2=165 : y2=420 : for x1=133 to 138 : x2=x2+0.6 : y2=y2+0.6 : line x1,y1,int(x2),int(y2) : next x1 // stalk
color 250,20,60 : fill circle 135,453,14 : fill circle 158,466,14 : color 255,150,150 : fill circle 131,445,4 : fill circle 155,458,4 // fruit
color 1,1,1 : circle 135,453,14 : circle 158,466,14
line 165,420,170,422 : line 142,443,165,420 : line 145,447,170,422 : line 156,454,162,428 : line 161,454,168,422 // outlines
ct$=getbit$(114,401,184,449) : cb$=getbit$(114,450,184,498) : clear fill box 114,414,184,484
putbit ct$,430,21,"t" : putbit cb$,430,70,"t" // cherry in title panel
# ------------------------------------------------------------------------------------------------------------------------------------------------------- #
label Plum
color 140,10,190 : fellipse(147,450,27,18) : color 140,90,200 : fellipse(146,442,21,10) : color 140,10,190 : fellipse(150,448,19,10) :color 1,1,1
ellipse(147,450,27,18) : color 20,250,70 : fill triangle 166,448,180,438,183,443 : color 1,1,1 :triangle 165,448,180,438,183,443 : circle 181,441,3
pt$=getbit$(114,401,184,449) : pb$=getbit$(114,450,184,498) : clear fill box 114,414,184,484
# ------------------------------------------------------------------------------------------------------------------------------------------------------- #
label Lemon
color 1,1,1 : ellipse(147,449,25,19) : ellipse(149,450,30,10) : color 230,230,0 : fellipse(149,450,29,9) : fellipse(147,449,23,18)
fill circle 130,450,9 : color 54,175,100 : fill circle 174,449,4 : color 1,1,1 : circle 174,449,3
lt$=getbit$(114,401,184,449) : lb$=getbit$(114,450,184,498) : clear fill box 114,414,184,484
# ------------------------------------------------------------------------------------------------------------------------------------------------------- #
label Apple
color 1,1,1 : fellipse(233,455,12,20) : fellipse(250,455,21,20) : fellipse(268,455,12,20) : color 200,0,70 : fellipse(233,455,11,19)
fellipse(250,455,20,19) : fellipse(268,455,11,19) : color 40,175,100 : fellipse(238,425,12,5) : color 1,1,1 : ellipse(238,425,12,5) // leaf
color 20,250,70 : fill triangle 252,418,256,418,250,438 : color 1,1,1 : triangle 252,418,256,418,250,438 // stalk
at$=getbit$(214,401,284,449) : ab$=getbit$(214,450,284,498) : clear fill box 214,414,284,484
# ------------------------------------------------------------------------------------------------------------------------------------------------------- #
label Orange
color 230,130,0 : fill circle 250,450,26 : color 250,150,50 : fill circle 246,444,18 : color 230,130,0 : fill circle 252,451,21
color 40,175,100 : fill box 258,434,264,440 : color 1,1,1 : circle 250,450,26 : circle 262,437,3
ot$=getbit$(214,401,284,449) : ob$=getbit$(214,450,284,498) : clear fill box 214,414,284,484
# ------------------------------------------------------------------------------------------------------------------------------------------------------- #
label Melon
color 20,170,30 : fellipse(251,449,33,23) : color 10,50,10 : fellipse(251,449,29,16) : color 20,170,30 : fellipse(251,449,30,11) : color 10,50,10
fellipse(251,449,26,3) : color 1,1,1 : ellipse(251,449,33,24) : clear fill box 261,413,284,484 : color 210,210,180 : fellipse(261,449,16,23)
color 220,20,20 : fellipse(261,449,10,17) : color 1,1,1 : ellipse(261,449,16,23) : color 10,50,10 : fill circle 261,440,2 : fill circle 257,445,2
fill circle 257,453,2 : fill circle 265,445,2 : fill circle 265,453,2 : fill circle 261,458,2
mt$=getbit$(214,401,284,449) : mb$=getbit$(214,450,284,498) : clear fill box 214,414,284,484
# ------------------------------------------------------------------------------------------------------------------------------------------------------- #
label Bar
color 50,50,50 : fill box 314,425,383,466 : color 250,250,250 : fill box 320,438,377,453 : box 313,428,384,463 : color 1,1,1 : text 323,454,"= BAR ="
bt$=getbit$(314,401,384,449) : bb$=getbit$(314,450,384,498) : clear fill box 314,414,384,484
# -------------------------------------------------------------------------------------------------------------------------------------------------------- #
label Dollar
x=350 : y=450:xr=27 : yr=27 : new curve : for a=0 to 2*pi step 0.2 : nx=x+xr*cos(a) : ny=y+yr*sin(a)
color 200,180,20 : fill circle nx,ny,4 : color 1,1,1 : circle nx,ny,4 : next a : close curve
color 200,180,20 : fill circle 350,450,28 : color 1,1,1 : circle 350,450,27 : text 338,440,"one" : text 342,455,"$1" : text 332,468,"dollar"
dt$=getbit$(314,401,384,449) : db$=getbit$(314,450,384,498) : clear fill box 314,414,384,484
# -------------------------------------------------------------------------------------------------------------------------------------------------------- #
label Seven
color 250,0,0 : fill box 323,421,332,442 : fill box 365,421,375,442 : fill box 333,422,365,437 : fill box 322,468,346,478
for l=322 to 341 : line l,472 to l+30,435 : next l : color 200,180,20 : fill box 327,425,330,435 : fill box 367,425,370,435 : fill box 327,427,370,432
fill box 327,470,340,474 : for l=326 to 333 : line l,474 to l+36,430 : next l
st$=getbit$(314,401,384,449) : sb$=getbit$(314,450,384,498) : clear fill box 314,414,384,484
# -------------------------------------------------------------------------------------------------------------------------------------------------------- #
label Holdbuttons
color 150,0,0 : fill box 114,527,183,568 : color 1,1,1 : box 113,526,184,569 : box 118,531,179,563
text 129,549,"HOLD" : text 124,563,"NUDGE" : hbdim$=getbit$(113,526,184,569)
color 250,50,0 : fellipse(149,547,32,21) : color 1,1,1 : box 113,526,184,569 : box 118,531,179,563
text 129,549,"HOLD" : text 124,563,"NUDGE" : hblit$=getbit$(113,526,184,569)
end sub
# ======================================================================================================================================================= #
sub ellipse(x,y,xr,yr) // ellipse .. routine from DOCU ..
new curve : local a
for a=0 to 2*pi step 0.2
line to x+xr*cos(a),y+yr*sin(a)
next a
close curve
end sub
# ======================================================================================================================================================= #
sub fellipse(x,y,xr,yr) // filled ellipse
new curve : local a,yf
for yf=0 to yr : for a=0 to 2*pi step 0.2
line to x+xr*cos(a),y+yf*sin(a)
next a : next yf
close curve
end sub
# ======================================================================================================================================================= #
sub noise(n)
if (n=1) beep
end sub
# ======================================================================================================================================================= #
sub Reels()
for r=1 to 3
for i=1 to 18 : read k : key(i,r)=k // read data and load info into reel key and indexing arrays and strings.
switch k
case 1 : top(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+ct$ : bas(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+cb$ : break // cherry
case 2 : top(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+pt$ : bas(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+pb$ : break // plum
case 3 : top(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+lt$ : bas(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+lb$ : break // lemon
case 4 : top(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+at$ : bas(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+ab$ : break // apple
case 5 : top(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+ot$ : bas(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+ob$ : break // orange
case 6 : top(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+mt$ : bas(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+mb$ : break // melon
case 7 : top(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+bt$ : bas(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+bb$ : break // bar
case 8 : top(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+dt$ : bas(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+db$ : break // dollar
case 9 : top(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+st$ : bas(i,r)=len(rl$(r))+1 : rl$(r)=rl$(r)+sb$ : break // seven
end switch
next i
half=len(ct$) : rl$(r)=rl$(r)+left$(rl$(r),half) // add overlap to make reels circular
next r
end sub
# ======================================================================================================================================================= #
label reeldata
// reel1 c,p,a,l,o,c,m,b,d,p,s,c,o,l,a,p,m,s
data 1,2,4,3,5,1,6,7,8,2,9,1,5,3,4,2,6,9
// reel2 m,o,c,l,d,a,p,l,m,c,s,p,a,b,l,o,a,p
data 6,5,1,3,8,4,2,3,6,1,9,2,4,7,3,5,4,2
// reel3 a,o,s,p,c,d,l,p,b,c,a,o,m,l,b,p,c,d
data 4,5,9,2,1,8,3,2,7,1,4,5,6,3,7,2,1,8
label coinpile
data 525,275,515,290,465,280,505,245,485,260,495,300,505,280
# ========================================= End Of Program Statements ================================================================================= #
# C:\Users\home\Documents\Yabasic_files\FruitMachine.yab