QB64 Phoenix Edition
Find the ball - classic shell game - Printable Version

+- QB64 Phoenix Edition (https://staging.qb64phoenix.com)
+-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3)
+---- Forum: Programs (https://staging.qb64phoenix.com/forumdisplay.php?fid=7)
+---- Thread: Find the ball - classic shell game (/showthread.php?tid=380)

Pages: 1 2 3


RE: Find the ball - classic shell game - bplus - 05-10-2022

"Sorry I didn't get to work on this today."

Please don't be, that simple little fix for your game made my day Smile Thumbs up again for your games!


RE: Find the ball - classic shell game - johnno56 - 05-10-2022

Thanks, Dav.


RE: Find the ball - classic shell game - Dav - 05-11-2022

Hey @bplus, I had a little time to code today (very little) and added a 'shadow' when the cups raise off the table.  Small addition but believe it adds a lot visually.  First I thought to use the filled eclipse routine you posted on the old forum for a shadow, but realized RotoZoom3 can do it as image x & y can be scaled.  Used a copy of the ball image since it is round, and used _SETALPHA.  Worked out pretty well for a shadow I think.  

- Dav

Code: (Select All)
_TITLE "Shell Game $5" 'b+ mod 2022-05-09
'Dav added shadow on 2022-05-10
'============
'FINDBALL.BAS
'============
'Classic Cups & Ball game (shell game)
'Coded by Dav, MAY/2022

'Cups will shuffle.  Click the cup with the ball.
'If selected correctly, screen flashes green.  If not,
'screen will flash red.  This could be turned into a
'game easy, with score keeping and speed changes.
'For now it just loops over and over.

RANDOMIZE TIMER

SCREEN _NEWIMAGE(1000, 600, 32)
_SCREENMOVE 200, 60
cup& = BASIMAGE1& 'decode cup image to use
ball& = BASIMAGE2& 'decode ball image to use
shadow& = _COPYIMAGE(ball&) 'use ball shape for shadow
_SETALPHA 35, 1 TO -1, shadow& 'set alpha for shadow&

'=== draw background
CLS , _RGB(232, 232, 255)
LINE (0, 350)-(_WIDTH, _HEIGHT), _RGB(128, 255, 128), BF

'=== grab background image
back& = _COPYIMAGE(_DISPLAY)

speed = 75 'speed for _LIMIT
moves = 15 'how many shuffle moves to do

COLOR &HFF000000
_PRINTMODE _KEEPBACKGROUND
DIM winnings AS LONG
DO

    _PUTIMAGE , back&, 0
    LOCATE 2, 2: PRINT "Winnings: $"; winnings
    LOCATE 10, 39: INPUT "Enter to Pay $5 to Play Shell Game, any other quits "; yes$
    IF LEN(yes$) THEN END

    cupball = INT(RND * 3) + 1 'make random cupball number (1,2,or 3)

    GOSUB ShowBall 'show where ball is first

    'shuffle the cups
    FOR m = 1 TO moves
        SELECT CASE INT(RND * 6) + 1 'random move
            CASE 1: GOSUB move1to2
            CASE 2: GOSUB move1to3
            CASE 3: GOSUB move2to1
            CASE 4: GOSUB move2to3
            CASE 5: GOSUB move3to1
            CASE 6: GOSUB move3to2
        END SELECT
    NEXT

    GOSUB PlaceCups 'make sure they are placed right

    selected = 0 'not selected yet

    DO
        WHILE _MOUSEINPUT: WEND
        IF _MOUSEBUTTON(1) THEN
            mx = _MOUSEX: my = _MOUSEY
            'clicked cup 1
            IF mx > 114 AND mx < 316 AND my > 146 AND my < 439 THEN
                IF cupball = 1 THEN selected = 1
                EXIT DO
            END IF
            'clicked cup 2
            IF mx > 378 AND mx < 600 AND my > 146 AND my < 439 THEN
                IF cupball = 2 THEN selected = 1
                EXIT DO
            END IF
            'clicked cup 3
            IF mx > 694 AND mx < 911 AND my > 146 AND my < 439 THEN
                IF cupball = 3 THEN selected = 1
                EXIT DO
            END IF
        END IF
    LOOP

    'make sure mouse button up to continue
    DO UNTIL _MOUSEBUTTON(1) = 0: m = _MOUSEINPUT: LOOP

    'flash screen based on selection
    IF selected = 0 THEN
        'flash red - wrong one
        LINE (0, 0)-(_WIDTH, _HEIGHT), _RGBA(255, 0, 0, 100), BF
        winnings = winnings - 5
        _DISPLAY
        _DELAY 1
    ELSE
        'flash green - selected right
        LINE (0, 0)-(_WIDTH, _HEIGHT), _RGBA(0, 255, 0, 100), BF
        winnings = winnings + 5
        _DISPLAY
        _DELAY 1
    END IF

    GOSUB ShowBall 'show where ball is
    IF winnings > 50 THEN speed = speed + 5
LOOP

END

'===================================================================
PlaceCups: 'shows all cups in place
'=========
'Place all cups first
_PUTIMAGE (0, 0), back&
RotoZoom3 200, 300, cup&, 1, 1, 0
RotoZoom3 500, 300, cup&, 1, 1, 0
RotoZoom3 800, 300, cup&, 1, 1, 0
_DISPLAY
RETURN
'=====

'===================================================================
ShowBall: 'Raises cup to show ball
'=======

'make sure showing all cups first
GOSUB PlaceCups

_DISPLAY: _DELAY 1

shadowgrow = 0

'raise a cup based on cupball number
SELECT CASE cupball
    CASE IS = 1 'raise cup 1
        _PUTIMAGE (0, 0), back&
        FOR y = 300 TO 175 STEP -7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 210, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 210, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 200, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _DISPLAY
            _LIMIT 50
        NEXT
    CASE IS = 2 'raise cup 2
        _PUTIMAGE (0, 0), back&
        FOR y = 300 TO 175 STEP -7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 510, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 510, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 500, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _DISPLAY
            _LIMIT 50
        NEXT
    CASE IS = 3 'raise cup 3
        _PUTIMAGE (0, 0), back&
        FOR y = 300 TO 175 STEP -7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 810, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 810, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 800, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _DISPLAY
            _LIMIT 50
        NEXT
END SELECT

_DELAY 1 'pause to see ball

'now lower the same a cup
SELECT CASE cupball
    CASE IS = 1 'lower cup 1
        _PUTIMAGE (0, 0), back&
        FOR y = 175 TO 300 STEP 7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 210, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 210, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 200, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _DISPLAY
            _LIMIT 50
        NEXT
    CASE IS = 2 'lower cup 2
        _PUTIMAGE (0, 0), back&
        FOR y = 175 TO 300 STEP 7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 510, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 510, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 500, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _DISPLAY
            _LIMIT 50
        NEXT
    CASE IS = 3 'lower cup 3
        _PUTIMAGE (0, 0), back&
        FOR y = 175 TO 300 STEP 7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 810, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 810, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 800, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _DISPLAY
            _LIMIT 50
        NEXT
END SELECT

RETURN
'=====


'===================================================================
move1to2: 'moves cup 1 over to cup 2
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back& 'redraw background
    'cup 3 stays in place
    RotoZoom3 800, 300, cup&, cup3z, cup3z, 0
    'cup 2 shrinks, going under cup 1, moving left
    RotoZoom3 500 - move, 300 - cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z + .03 ELSE cup2z = cup2z - .03
    'cup 1 enlarges, going over cup 2, moving right
    RotoZoom3 200 + move, 300 * cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z - .03 ELSE cup1z = cup1z + .03
    _DISPLAY
    _LIMIT speed
NEXT
'swap ball placement
SELECT CASE cupball
    CASE 1: cupball = 2
    CASE 2: cupball = 1
END SELECT

RETURN
'=====


'===================================================================
move1to3: 'move cup 1 over to cup 3
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 8
    _PUTIMAGE (0, 0), back&
    'cup 3 shrinks, moves left two places
    RotoZoom3 800 - (move * 2), 300 - cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z + .02 ELSE cup3z = cup3z - .02
    'cup 2 stays in place
    RotoZoom3 500, 300, cup&, cup2z, cup2z, 0
    'cup 1 enlarges, moving right two places
    RotoZoom3 200 + (move * 2), 300 * cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z - .02 ELSE cup1z = cup1z + .02
    _DISPLAY
    _LIMIT speed * 1.7
NEXT
SELECT CASE cupball
    CASE 1: cupball = 3
    CASE 3: cupball = 1
END SELECT

RETURN
'=====

'===================================================================
move2to1: 'move cup 2 over to cup 1
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back&
    '3rd cup stays in place
    RotoZoom3 800, 300, cup&, cup3z, cup3z, 0
    'cup 1 shrinks, moving right
    RotoZoom3 200 + move, 300 - cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z + .03 ELSE cup1z = cup1z - .03
    'cup 2 enlarges, moving left
    RotoZoom3 500 - move, 300 * cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z - .03 ELSE cup2z = cup2z + .03
    _DISPLAY
    _LIMIT speed
NEXT
SELECT CASE cupball
    CASE 1: cupball = 2
    CASE 2: cupball = 1
END SELECT

RETURN
'=====

'===================================================================
move2to3: 'move cup 2 over to cup 3
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back&
    'cup 1 stays in place
    RotoZoom3 200, 300, cup&, cup1z, cup1z, 0
    'cup 3 shrinks under, moves left 1 cup,
    RotoZoom3 800 - move, 300 - cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z + .03 ELSE cup3z = cup3z - .03
    'cup 2 enlarges over, moves right 1 cup
    RotoZoom3 500 + move, 300 * cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z - .03 ELSE cup2z = cup2z + .03
    _DISPLAY
    _LIMIT speed
NEXT
SELECT CASE cupball
    CASE 2: cupball = 3
    CASE 3: cupball = 2
END SELECT

RETURN

'===================================================================
move3to1: 'move cup 3 over to cup 1
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 8
    _PUTIMAGE (0, 0), back&
    'cup 1 shrinks under, moving right two cup places,
    RotoZoom3 200 + (move * 2), 300 - cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z + .02 ELSE cup1z = cup1z - .02
    'cup2 stays in place
    RotoZoom3 500, 300, cup&, cup2z, cup2z, 0
    'cup 3 enlarges over, moving left two cup places,
    RotoZoom3 800 - (move * 2), 300 * cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z - .02 ELSE cup3z = cup3z + .02
    _DISPLAY
    _LIMIT speed * 1.7
NEXT
SELECT CASE cupball
    CASE 3: cupball = 1
    CASE 1: cupball = 3
END SELECT

RETURN
'=====

'===================================================================
move3to2: 'move cup 3 over to cup2
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back&
    'cup1 stays in place
    RotoZoom3 200, 300, cup&, cup1z, cup1z, 0
    'cup 2 shrinks under, moves right 1 cup
    RotoZoom3 500 + move, 300 - cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z + .03 ELSE cup2z = cup2z - .03
    'cup 3 enlarges over, moves left 1 cup,
    RotoZoom3 800 - move, 300 * cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z - .03 ELSE cup3z = cup3z + .03
    _DISPLAY
    _LIMIT speed
NEXT
SELECT CASE cupball
    CASE 3: cupball = 2
    CASE 2: cupball = 3
END SELECT

RETURN


SUB RotoZoom3 (X AS LONG, Y AS LONG, Image AS LONG, xScale AS SINGLE, yScale AS SINGLE, radianRotation AS SINGLE)
    ' This assumes you have set your drawing location with _DEST or default to screen.
    ' X, Y - is where you want to put the middle of the image
    ' Image - is the handle assigned with _LOADIMAGE
    ' xScale, yScale - are shrinkage < 1 or magnification > 1 on the given axis, 1 just uses image size.
    ' These are multipliers so .5 will create image .5 size on given axis and 2 for twice image size.
    ' radianRotation is the Angle in Radian units to rotate the image
    ' note: Radian units for rotation because it matches angle units of other Basic Trig functions
    '       and saves a little time converting from degree.
    '       Use the _D2R() function if you prefer to work in degree units for angles.

    DIM px(3) AS SINGLE: DIM py(3) AS SINGLE ' simple arrays for x, y to hold the 4 corners of image
    DIM W&, H&, sinr!, cosr!, i&, x2&, y2& '   variables for image manipulation
    W& = _WIDTH(Image&): H& = _HEIGHT(Image&)
    px(0) = -W& / 2: py(0) = -H& / 2 'left top corner
    px(1) = -W& / 2: py(1) = H& / 2 ' left bottom corner
    px(2) = W& / 2: py(2) = H& / 2 '  right bottom
    px(3) = W& / 2: py(3) = -H& / 2 ' right top
    sinr! = SIN(-radianRotation): cosr! = COS(-radianRotation) ' rotation helpers
    FOR i& = 0 TO 3 ' calc new point locations with rotation and zoom
        x2& = xScale * (px(i&) * cosr! + sinr! * py(i&)) + X: y2& = yScale * (py(i&) * cosr! - px(i&) * sinr!) + Y
        px(i&) = x2&: py(i&) = y2&
    NEXT
    _MAPTRIANGLE _SEAMLESS(0, 0)-(0, H& - 1)-(W& - 1, H& - 1), Image TO(px(0), py(0))-(px(1), py(1))-(px(2), py(2))
    _MAPTRIANGLE _SEAMLESS(0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), Image TO(px(0), py(0))-(px(3), py(3))-(px(2), py(2))
END SUB

FUNCTION BASIMAGE1& 'cup.png
    v& = _NEWIMAGE(235, 336, 32)
    DIM m AS _MEM: m = _MEMIMAGE(v&)
    A$ = ""
    A$ = A$ + "haIkM^Z\ULK50=O66UZ<`h1KZ=gP;dLGYlg`DVIP13l0SQikHh14H0Q5BZ:h"
    A$ = A$ + "4JZ9gn<GecFZgjEgB]N]0[JNN?W^E_GmFB]d^odWndOhC000L9nOoWomW<lO"
    A$ = A$ + "oWoeRbojS?^d?_lH[e]C0DKTaknla=Wj<l?n;o9_lgocoX:nno7jk1G661RU"
    A$ = A$ + "c;G?JgKNlR5o]?lMQignf3lago^RSegQhkOoHeagce_acQBRVOjjQ6OK;>f4"
    A$ = A$ + "WokodgHa_nSOmdQllCee=N]`YCaUaI1G2iPblQblObLKbhBO^i_l3oaZA[Me"
    A$ = A$ + "#^[?7f=?M>iXaUG;TnYd9=i4U^fV?lcOoGU5ed=kI?EbI>?dlLY[od[OeWaK"
    A$ = A$ + "W7BY?[?cEZdWEILF^>:^jiLE]c9ON\9_\<?\_l^h`m;^i;gmagj[J\nUfcNi"
    A$ = A$ + "8iYUfOmM>kVkeTgeh_Tg]?`=gYjllhhXYjU]boVE7]Fn^Vk:ck:ciRgf67Ej"
    A$ = A$ + "VKNY_aI:mbFkHhVg;76W[`MaI[WKjjWVnfjVcLDcER[FFLKkTmCfeIaK;SSJ"
    A$ = A$ + "=^CWlWb[;mlh:aIKW[jfnY=fF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`W^%%%0"
    btemp$ = ""
    FOR i& = 1 TO LEN(A$) STEP 4: B$ = MID$(A$, i&, 4)
        IF INSTR(1, B$, "%") THEN
            FOR C% = 1 TO LEN(B$): F$ = MID$(B$, C%, 1)
                IF F$ <> "%" THEN C$ = C$ + F$
            NEXT: B$ = C$: END IF: FOR j = 1 TO LEN(B$)
            IF MID$(B$, j, 1) = "#" THEN
        MID$(B$, j) = "@": END IF: NEXT
        FOR t% = LEN(B$) TO 1 STEP -1
            B& = B& * 64 + ASC(MID$(B$, t%)) - 48
            NEXT: X$ = "": FOR t% = 1 TO LEN(B$) - 1
            X$ = X$ + CHR$(B& AND 255): B& = B& \ 256
    NEXT: btemp$ = btemp$ + X$: NEXT
    btemp$ = _INFLATE$(btemp$,m.SIZE)
    _MEMPUT m, m.OFFSET, btemp$: _MEMFREE m
    BASIMAGE1& = _COPYIMAGE(v&): _FREEIMAGE v&
END FUNCTION

FUNCTION BASIMAGE2& 'ball.png
    v& = _NEWIMAGE(100, 99, 32)
    DIM m AS _MEM: m = _MEMIMAGE(v&)
    A$ = ""
    A$ = A$ + "haIkM^SSULL45EK5jB#j#j#K^1X?g3L=X=S\4Xf3bAN22#0bAK1jC718d2i8"
    A$ = A$ + "L8>jP8cZNmlYkIdHTXNeWg_hVghNS8[ne?mdCo^Wn8Jl[ojonY7mj^kcicS7"
    A$ = A$ + "37niOnGNjWnYoiCOkgnGNjkn^ojCOogogNj7oaoaK6[Sch7nQonK6L>6[Woj"
    A$ = A$ + "eiGnUoeKfnILjnanePhmJ;ajenP7L\eiiJhjIo5^hWkjh[S]N=Fk3flBoMne"
    A$ = A$ + "fPHBSIlHfB\MM^_iKncoF\gL2oLlSGl3S]`ghinILioR34?Fah6G1CFaNNlj"
    A$ = A$ + "LLm[S_h:6o<Wal4b[ak1SbSFSoO0Khk8iS#3PHZWccSGKoj_n?mK7O]e77L0"
    A$ = A$ + "\TLIFSYhDaTV?cL8`V?Ua77g0;J>V_j[nS_I0^\Rm>?5Kii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
    A$ = A$ + "eBLN9?__gOLk`3[K\^^Gbo7B=e[fkP;CmhjAmEQ6?i^lJKB\dh1LPZOKlZ[]"
    A$ = A$ + "adm8Wi:eSk;mo?_N4mTkb=fQY^WVClUjUbkG]4ogSSoo2BSc5;Ln\ZOlJ0;H"
    A$ = A$ + "<M_^m^HH_]^fRfgUZQkHOkCRmG1gXo__Ym:LGM7nnBhedH=g0lhdjH]S3<e?"
    A$ = A$ + "aFSQeamlMOO?HmlbEjS]nQ[5Qh]m3_KlBmog^k>FOnfMOdMUf\i4ChSO=K_A"
    A$ = A$ + "le<U_Zm#YeKHmMk[eeJknd^>n[moO2K^bEiN^SfOe>lPed`l3n]<YeKDNAm="
    A$ = A$ + "a_g<U_d17o>ggD_67k^O3_S7<j5eD_AZnMa]YjnJ=PP=C[IKcGiJDnHQC<aA"
    A$ = A$ + ">aEN>N`8oTi0ESOWg:hCCnJWjI5l4gG`?FaRMhcMmOeenKJ^_eb=6ioWC#<e"
    A$ = A$ + "eUglBFGIJ]VN=jMjM5N`h^hBej]V^cI]fgiE<6eofKVZi^m]RJ?nHCOhiR;\"
    A$ = A$ + "Uee[LSM[;UmmBlfJ==7Ui9FSgnJ13Ho?Ei3?:_I57Vh=E3_LUjSMbS[[kfL4"
    A$ = A$ + "NmH=Sno1n`EHAOlJk:OadmgK__kWlIinG=]N8XWlJ[o6O<<\V3[=Ia9b]=eG"
    A$ = A$ + "4^VeSGNSl[g;mg]?U7Cl\??nlh]MlOPD%%L2"
    btemp$ = ""
    FOR i& = 1 TO LEN(A$) STEP 4: B$ = MID$(A$, i&, 4)
        IF INSTR(1, B$, "%") THEN
            FOR C% = 1 TO LEN(B$): F$ = MID$(B$, C%, 1)
                IF F$ <> "%" THEN C$ = C$ + F$
            NEXT: B$ = C$: END IF: FOR j = 1 TO LEN(B$)
            IF MID$(B$, j, 1) = "#" THEN
        MID$(B$, j) = "@": END IF: NEXT
        FOR t% = LEN(B$) TO 1 STEP -1
            B& = B& * 64 + ASC(MID$(B$, t%)) - 48
            NEXT: X$ = "": FOR t% = 1 TO LEN(B$) - 1
            X$ = X$ + CHR$(B& AND 255): B& = B& \ 256
    NEXT: btemp$ = btemp$ + X$: NEXT
    btemp$ = _INFLATE$(btemp$,m.SIZE)
    _MEMPUT m, m.OFFSET, btemp$: _MEMFREE m
    BASIMAGE2& = _COPYIMAGE(v&): _FREEIMAGE v&
END FUNCTION



RE: Find the ball - classic shell game - bplus - 05-11-2022

@Dav luv the shadow! but after a couple of turns I noticed a pale square around the dark ellipise:
   

I have a fix for it, I left both sets of shadow& makers for you to compare, plus ever time a cup is raised, it is in sleep mode, so you can look at screen at different angles.
Code: (Select All)
_Title "Shell Game $5" 'b+ mod 2022-05-09
'Dav added shadow on 2022-05-10
'B+ 2022-05-10 added alternate shadow maker, to test also raised cups are put in sleep mode
'============
'FINDBALL.BAS
'============
'Classic Cups & Ball game (shell game)
'Coded by Dav, MAY/2022

'Cups will shuffle.  Click the cup with the ball.
'If selected correctly, screen flashes green.  If not,
'screen will flash red.  This could be turned into a
'game easy, with score keeping and speed changes.
'For now it just loops over and over.

Randomize Timer

Screen _NewImage(1000, 600, 32)
_ScreenMove 200, 60

cup& = BASIMAGE1& 'decode cup image to use
ball& = BASIMAGE2& 'decode ball image to use

' =======================================
'shadow& = _CopyImage(ball&) 'use ball shape for shadow
'_SetAlpha 35, , shadow& 'set alpha for shadow&

'                   OR

shadow& = _NewImage(100, 100, 32)
fcirc 49, 49, 49, &H25000000
_PutImage , 0, shadow&, (0, 0)-(99, 99)
'==================================================================

'=== draw background
Cls , _RGB(232, 232, 255)
Line (0, 350)-(_Width, _Height), _RGB(128, 255, 128), BF

'=== grab background image
back& = _CopyImage(_Display)

speed = 75 'speed for _LIMIT
moves = 15 'how many shuffle moves to do

Color &HFF000000
_PrintMode _KeepBackground
Dim winnings As Long
Do

    _PutImage , back&, 0
    Locate 2, 2: Print "Winnings: $"; winnings
    Locate 10, 39: Input "Enter to Pay $5 to Play Shell Game, any other quits "; yes$
    If Len(yes$) Then End

    cupball = Int(Rnd * 3) + 1 'make random cupball number (1,2,or 3)

    GoSub ShowBall 'show where ball is first

    'shuffle the cups
    For m = 1 To moves
        Select Case Int(Rnd * 6) + 1 'random move
            Case 1: GoSub move1to2
            Case 2: GoSub move1to3
            Case 3: GoSub move2to1
            Case 4: GoSub move2to3
            Case 5: GoSub move3to1
            Case 6: GoSub move3to2
        End Select
    Next

    GoSub PlaceCups 'make sure they are placed right

    selected = 0 'not selected yet

    Do
        While _MouseInput: Wend
        If _MouseButton(1) Then
            mx = _MouseX: my = _MouseY
            'clicked cup 1
            If mx > 114 And mx < 316 And my > 146 And my < 439 Then
                If cupball = 1 Then selected = 1
                Exit Do
            End If
            'clicked cup 2
            If mx > 378 And mx < 600 And my > 146 And my < 439 Then
                If cupball = 2 Then selected = 1
                Exit Do
            End If
            'clicked cup 3
            If mx > 694 And mx < 911 And my > 146 And my < 439 Then
                If cupball = 3 Then selected = 1
                Exit Do
            End If
        End If
    Loop

    'make sure mouse button up to continue
    Do Until _MouseButton(1) = 0: m = _MouseInput: Loop

    'flash screen based on selection
    If selected = 0 Then
        'flash red - wrong one
        Line (0, 0)-(_Width, _Height), _RGBA(255, 0, 0, 100), BF
        winnings = winnings - 5
        _Display
        _Delay 1
    Else
        'flash green - selected right
        Line (0, 0)-(_Width, _Height), _RGBA(0, 255, 0, 100), BF
        winnings = winnings + 5
        _Display
        _Delay 1
    End If

    GoSub ShowBall 'show where ball is
    If winnings > 50 Then speed = speed + 5
Loop

End

'===================================================================
PlaceCups: 'shows all cups in place
'=========
'Place all cups first
_PutImage (0, 0), back&
RotoZoom3 200, 300, cup&, 1, 1, 0
RotoZoom3 500, 300, cup&, 1, 1, 0
RotoZoom3 800, 300, cup&, 1, 1, 0
_Display
Return
'=====

'===================================================================
ShowBall: 'Raises cup to show ball
'=======

'make sure showing all cups first
GoSub PlaceCups

_Display: _Delay 1

shadowgrow = 0

'raise a cup based on cupball number
Select Case cupball
    Case Is = 1 'raise cup 1
        _PutImage (0, 0), back&
        For y = 300 To 175 Step -7
            _PutImage (0, 0), back&
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 210, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 210, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 200, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _Display
            _Limit 50
        Next
        Sleep
    Case Is = 2 'raise cup 2
        _PutImage (0, 0), back&
        For y = 300 To 175 Step -7
            _PutImage (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 510, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 510, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 500, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _Display
            _Limit 50
        Next
        Sleep
    Case Is = 3 'raise cup 3
        _PutImage (0, 0), back&
        For y = 300 To 175 Step -7
            _PutImage (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 810, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 810, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 800, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _Display
            _Limit 50
        Next
        Sleep
End Select

_Delay 1 'pause to see ball

'now lower the same a cup
Select Case cupball
    Case Is = 1 'lower cup 1
        _PutImage (0, 0), back&
        For y = 175 To 300 Step 7
            _PutImage (0, 0), back&
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 210, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 210, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 200, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _Display
            _Limit 50
        Next
    Case Is = 2 'lower cup 2
        _PutImage (0, 0), back&
        For y = 175 To 300 Step 7
            _PutImage (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 510, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 510, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 500, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _Display
            _Limit 50
        Next
    Case Is = 3 'lower cup 3
        _PutImage (0, 0), back&
        For y = 175 To 300 Step 7
            _PutImage (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 810, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 810, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 800, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _Display
            _Limit 50
        Next
End Select

Return
'=====


'===================================================================
move1to2: 'moves cup 1 over to cup 2
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 15
    _PutImage (0, 0), back& 'redraw background
    'cup 3 stays in place
    RotoZoom3 800, 300, cup&, cup3z, cup3z, 0
    'cup 2 shrinks, going under cup 1, moving left
    RotoZoom3 500 - move, 300 - cup2z, cup&, cup2z, cup2z, 0
    If move > 150 Then cup2z = cup2z + .03 Else cup2z = cup2z - .03
    'cup 1 enlarges, going over cup 2, moving right
    RotoZoom3 200 + move, 300 * cup1z, cup&, cup1z, cup1z, 0
    If move > 150 Then cup1z = cup1z - .03 Else cup1z = cup1z + .03
    _Display
    _Limit speed
Next
'swap ball placement
Select Case cupball
    Case 1: cupball = 2
    Case 2: cupball = 1
End Select

Return
'=====


'===================================================================
move1to3: 'move cup 1 over to cup 3
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 8
    _PutImage (0, 0), back&
    'cup 3 shrinks, moves left two places
    RotoZoom3 800 - (move * 2), 300 - cup3z, cup&, cup3z, cup3z, 0
    If move > 150 Then cup3z = cup3z + .02 Else cup3z = cup3z - .02
    'cup 2 stays in place
    RotoZoom3 500, 300, cup&, cup2z, cup2z, 0
    'cup 1 enlarges, moving right two places
    RotoZoom3 200 + (move * 2), 300 * cup1z, cup&, cup1z, cup1z, 0
    If move > 150 Then cup1z = cup1z - .02 Else cup1z = cup1z + .02
    _Display
    _Limit speed * 1.7
Next
Select Case cupball
    Case 1: cupball = 3
    Case 3: cupball = 1
End Select

Return
'=====

'===================================================================
move2to1: 'move cup 2 over to cup 1
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 15
    _PutImage (0, 0), back&
    '3rd cup stays in place
    RotoZoom3 800, 300, cup&, cup3z, cup3z, 0
    'cup 1 shrinks, moving right
    RotoZoom3 200 + move, 300 - cup1z, cup&, cup1z, cup1z, 0
    If move > 150 Then cup1z = cup1z + .03 Else cup1z = cup1z - .03
    'cup 2 enlarges, moving left
    RotoZoom3 500 - move, 300 * cup2z, cup&, cup2z, cup2z, 0
    If move > 150 Then cup2z = cup2z - .03 Else cup2z = cup2z + .03
    _Display
    _Limit speed
Next
Select Case cupball
    Case 1: cupball = 2
    Case 2: cupball = 1
End Select

Return
'=====

'===================================================================
move2to3: 'move cup 2 over to cup 3
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 15
    _PutImage (0, 0), back&
    'cup 1 stays in place
    RotoZoom3 200, 300, cup&, cup1z, cup1z, 0
    'cup 3 shrinks under, moves left 1 cup,
    RotoZoom3 800 - move, 300 - cup3z, cup&, cup3z, cup3z, 0
    If move > 150 Then cup3z = cup3z + .03 Else cup3z = cup3z - .03
    'cup 2 enlarges over, moves right 1 cup
    RotoZoom3 500 + move, 300 * cup2z, cup&, cup2z, cup2z, 0
    If move > 150 Then cup2z = cup2z - .03 Else cup2z = cup2z + .03
    _Display
    _Limit speed
Next
Select Case cupball
    Case 2: cupball = 3
    Case 3: cupball = 2
End Select

Return

'===================================================================
move3to1: 'move cup 3 over to cup 1
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 8
    _PutImage (0, 0), back&
    'cup 1 shrinks under, moving right two cup places,
    RotoZoom3 200 + (move * 2), 300 - cup1z, cup&, cup1z, cup1z, 0
    If move > 150 Then cup1z = cup1z + .02 Else cup1z = cup1z - .02
    'cup2 stays in place
    RotoZoom3 500, 300, cup&, cup2z, cup2z, 0
    'cup 3 enlarges over, moving left two cup places,
    RotoZoom3 800 - (move * 2), 300 * cup3z, cup&, cup3z, cup3z, 0
    If move > 150 Then cup3z = cup3z - .02 Else cup3z = cup3z + .02
    _Display
    _Limit speed * 1.7
Next
Select Case cupball
    Case 3: cupball = 1
    Case 1: cupball = 3
End Select

Return
'=====

'===================================================================
move3to2: 'move cup 3 over to cup2
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 15
    _PutImage (0, 0), back&
    'cup1 stays in place
    RotoZoom3 200, 300, cup&, cup1z, cup1z, 0
    'cup 2 shrinks under, moves right 1 cup
    RotoZoom3 500 + move, 300 - cup2z, cup&, cup2z, cup2z, 0
    If move > 150 Then cup2z = cup2z + .03 Else cup2z = cup2z - .03
    'cup 3 enlarges over, moves left 1 cup,
    RotoZoom3 800 - move, 300 * cup3z, cup&, cup3z, cup3z, 0
    If move > 150 Then cup3z = cup3z - .03 Else cup3z = cup3z + .03
    _Display
    _Limit speed
Next
Select Case cupball
    Case 3: cupball = 2
    Case 2: cupball = 3
End Select

Return


Sub RotoZoom3 (X As Long, Y As Long, Image As Long, xScale As Single, yScale As Single, radianRotation As Single)
    ' This assumes you have set your drawing location with _DEST or default to screen.
    ' X, Y - is where you want to put the middle of the image
    ' Image - is the handle assigned with _LOADIMAGE
    ' xScale, yScale - are shrinkage < 1 or magnification > 1 on the given axis, 1 just uses image size.
    ' These are multipliers so .5 will create image .5 size on given axis and 2 for twice image size.
    ' radianRotation is the Angle in Radian units to rotate the image
    ' note: Radian units for rotation because it matches angle units of other Basic Trig functions
    '       and saves a little time converting from degree.
    '       Use the _D2R() function if you prefer to work in degree units for angles.

    Dim px(3) As Single: Dim py(3) As Single ' simple arrays for x, y to hold the 4 corners of image
    Dim W&, H&, sinr!, cosr!, i&, x2&, y2& '   variables for image manipulation
    W& = _Width(Image&): H& = _Height(Image&)
    px(0) = -W& / 2: py(0) = -H& / 2 'left top corner
    px(1) = -W& / 2: py(1) = H& / 2 ' left bottom corner
    px(2) = W& / 2: py(2) = H& / 2 '  right bottom
    px(3) = W& / 2: py(3) = -H& / 2 ' right top
    sinr! = Sin(-radianRotation): cosr! = Cos(-radianRotation) ' rotation helpers
    For i& = 0 To 3 ' calc new point locations with rotation and zoom
        x2& = xScale * (px(i&) * cosr! + sinr! * py(i&)) + X: y2& = yScale * (py(i&) * cosr! - px(i&) * sinr!) + Y
        px(i&) = x2&: py(i&) = y2&
    Next
    _MapTriangle _Seamless(0, 0)-(0, H& - 1)-(W& - 1, H& - 1), Image To(px(0), py(0))-(px(1), py(1))-(px(2), py(2))
    _MapTriangle _Seamless(0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), Image To(px(0), py(0))-(px(3), py(3))-(px(2), py(2))
End Sub

Function BASIMAGE1& 'cup.png
    v& = _NewImage(235, 336, 32)
    Dim m As _MEM: m = _MemImage(v&)
    A$ = ""
    A$ = A$ + "haIkM^Z\ULK50=O66UZ<`h1KZ=gP;dLGYlg`DVIP13l0SQikHh14H0Q5BZ:h"
    A$ = A$ + "4JZ9gn<GecFZgjEgB]N]0[JNN?W^E_GmFB]d^odWndOhC000L9nOoWomW<lO"
    A$ = A$ + "oWoeRbojS?^d?_lH[e]C0DKTaknla=Wj<l?n;o9_lgocoX:nno7jk1G661RU"
    A$ = A$ + "c;G?JgKNlR5o]?lMQignf3lago^RSegQhkOoHeagce_acQBRVOjjQ6OK;>f4"
    A$ = A$ + "WokodgHa_nSOm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HU^ZI>L>#\lU:ckO\lVhYeeSEcmJ^FjLMdmjGBNMTafEbnn"
    A$ = A$ + "MeHMghmDLfkfASegmHcmZln\n^nI6WYfcCa4cdjHgEVHiNCjIVNaWED[6GH?"
    A$ = A$ + "<VjBN<kKl;aNn>abIfjHD8<VkSjKn[>hcAjKE?BdW5b=m\^:jiSWn_jN]Cfg"
    A$ = A$ + "EbI>O4J<`n67\aQ?eJ=X#?ObTleCl<;;bm8llmWJkU<7Y_aEbH;1Y3k3I<R?"
    A$ = A$ + "7?enM?BinbNnd3dODO>WF^AGJM\1<fTS3k^VFeh\^]jLX5ImTLFg;4ihT]nJ"
    A$ = A$ + "70BB9o\?O_Gagi0i110P_`o7c`W^%%%0"
    btemp$ = ""
    For i& = 1 To Len(A$) Step 4: B$ = Mid$(A$, i&, 4)
        If InStr(1, B$, "%") Then
            For C% = 1 To Len(B$): F$ = Mid$(B$, C%, 1)
                If F$ <> "%" Then C$ = C$ + F$
            Next: B$ = C$: End If: For j = 1 To Len(B$)
            If Mid$(B$, j, 1) = "#" Then
        Mid$(B$, j) = "@": End If: Next
        For t% = Len(B$) To 1 Step -1
            B& = B& * 64 + Asc(Mid$(B$, t%)) - 48
            Next: X$ = "": For t% = 1 To Len(B$) - 1
            X$ = X$ + Chr$(B& And 255): B& = B& \ 256
    Next: btemp$ = btemp$ + X$: Next
    btemp$ = _Inflate$(btemp$)
    _MemPut m, m.OFFSET, btemp$: _MemFree m
    BASIMAGE1& = _CopyImage(v&): _FreeImage v&
End Function

Function BASIMAGE2& 'ball.png
    v& = _NewImage(100, 99, 32)
    Dim m As _MEM: m = _MemImage(v&)
    A$ = ""
    A$ = A$ + "haIkM^SSULL45EK5jB#j#j#K^1X?g3L=X=S\4Xf3bAN22#0bAK1jC718d2i8"
    A$ = A$ + "L8>jP8cZNmlYkIdHTXNeWg_hVghNS8[ne?mdCo^Wn8Jl[ojonY7mj^kcicS7"
    A$ = A$ + "37niOnGNjWnYoiCOkgnGNjkn^ojCOogogNj7oaoaK6[Sch7nQonK6L>6[Woj"
    A$ = A$ + "eiGnUoeKfnILjnanePhmJ;ajenP7L\eiiJhjIo5^hWkjh[S]N=Fk3flBoMne"
    A$ = A$ + "fPHBSIlHfB\MM^_iKncoF\gL2oLlSGl3S]`ghinILioR34?Fah6G1CFaNNlj"
    A$ = A$ + "LLm[S_h:6o<Wal4b[ak1SbSFSoO0Khk8iS#3PHZWccSGKoj_n?mK7O]e77L0"
    A$ = A$ + "\TLIFSYhDaTV?cL8`V?Ua77g0;J>V_j[nS_I0^\Rm>?5KiiKL4L[ijHdg;[3"
    A$ = A$ + "EO0\oWJhajk3cWGOoH>oJ[c]\fWcicclOOLh5`7<N`ila<6DMWV_bL6kQkC1"
    A$ = A$ + "LQio<?VHIe\]NPSUFOQ[5>bjJIh[Qg_6kW`2^^VcZibFjo<nH5GPC`lJ`Sef"
    A$ = A$ + "_l;o3o?j1Mn]SINn^7P9h3^NcjnljHLfh>hajc4HE[YiS9=O[IcgEVo1>HMF"
    A$ = A$ + "66Chk^a:N<n[hh53Lle_g4OMLfl8S?L=>nk]`AFWOEob;M<o:lXnR<W`NT#["
    A$ = A$ + "`i_LlKYWcccaGWCSg7k9XNPkFc]Vh7UghSaaMN\efGjhn^QW;_RWV?\3?jS;"
    A$ = A$ + "6Jl`ajeS9FiJ8Jm:E?gL1beE<QGGV3<EkB[KiU>fGN1cG17:oPib;M3Vkcn["
    A$ = A$ + "]niQ^`jHe?\WWRnTc_\N^[hSeE\6d47Qc3NJl`nPkk??VJmO=XYPGFW_`iR\"
    A$ = A$ + "gDcAje0NDM2b7I^1WOM>fjjnJn?S9^F3cOZ?\ZW=i?cjkXYlBS9N^b:V^V_c"
    A$ = A$ + "LNc1ji:7aOGao5N`\7Gh46;L]KT7cNQiHegKk;cTWRbGVZ]deX\`UG:NQ[;f"
    A$ = A$ + "iK86kloCnEij<naSA3bJ?>>^>VcQKM5S[CnMM]ifCUmT]c;\emme1N\^n?de"
    A$ = A$ + "X#o`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VeSGNSl[g;mg]?U7Cl\??nlh]MlOPD%%L2"
    btemp$ = ""
    For i& = 1 To Len(A$) Step 4: B$ = Mid$(A$, i&, 4)
        If InStr(1, B$, "%") Then
            For C% = 1 To Len(B$): F$ = Mid$(B$, C%, 1)
                If F$ <> "%" Then C$ = C$ + F$
            Next: B$ = C$: End If: For j = 1 To Len(B$)
            If Mid$(B$, j, 1) = "#" Then
        Mid$(B$, j) = "@": End If: Next
        For t% = Len(B$) To 1 Step -1
            B& = B& * 64 + Asc(Mid$(B$, t%)) - 48
            Next: X$ = "": For t% = 1 To Len(B$) - 1
            X$ = X$ + Chr$(B& And 255): B& = B& \ 256
    Next: btemp$ = btemp$ + X$: Next
    btemp$ = _Inflate$(btemp$)
    _MemPut m, m.OFFSET, btemp$: _MemFree m
    BASIMAGE2& = _CopyImage(v&): _FreeImage v&
End Function

Sub fcirc (CX As Long, CY As Long, R As Long, C As _Unsigned Long)
    Dim Radius As Long, RadiusError As Long
    Dim X As Long, Y As Long
    Radius = Abs(R): RadiusError = -Radius: X = Radius: Y = 0
    If Radius = 0 Then PSet (CX, CY), C: Exit Sub
    Line (CX - X, CY)-(CX + X, CY), C, BF
    While X > Y
        RadiusError = RadiusError + Y * 2 + 1
        If RadiusError >= 0 Then
            If X <> Y + 1 Then
                Line (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
                Line (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
            End If
            X = X - 1
            RadiusError = RadiusError - X * 2
        End If
        Y = Y + 1
        Line (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
        Line (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
    Wend
End Sub

A shadow under the ball would be nice too!


RE: Find the ball - classic shell game - bplus - 05-11-2022

OK I tried Shadow under the ball but your ball has a white outline. PS and the light reflecting on the ball is coming on an angle from the right.
   

I will try a drawn ball.


RE: Find the ball - classic shell game - bplus - 05-11-2022

Lots of choices! Here the drawn ball makes sense with shadow, I think.
Code: (Select All)
_Title "Shell Game $5" 'b+ mod 2022-05-09
'Dav added shadow on 2022-05-10
'============
'FINDBALL.BAS
'============
'Classic Cups & Ball game (shell game)
'Coded by Dav, MAY/2022

'Cups will shuffle.  Click the cup with the ball.
'If selected correctly, screen flashes green.  If not,
'screen will flash red.  This could be turned into a
'game easy, with score keeping and speed changes.
'For now it just loops over and over.

Randomize Timer

Screen _NewImage(1000, 600, 32)
_ScreenMove 200, 60

cup& = BASIMAGE1& 'decode cup image to use
'ball& = BASIMAGE2& 'decode ball image to use

' =======================================
'shadow& = _CopyImage(ball&) 'use ball shape for shadow
'_SetAlpha 35, , shadow& 'set alpha for shadow&

'                   OR

shadow& = _NewImage(100, 100, 32)
fcirc 49, 49, 49, &H25000000
_PutImage , 0, shadow&, (0, 0)-(99, 99)
'=========================================
ball& = _NewImage(100, 100, 32)
For r = 49 To 0 Step -1
    fcirc 49, 49, r, _RGB32(255 - 4 * r, 0, 50 - r)
Next

_PutImage , 0, ball&, (0, 0)-(99, 99)



'=== draw background
Cls , _RGB(232, 232, 255)
Line (0, 350)-(_Width, _Height), _RGB(128, 255, 128), BF

'=== grab background image
back& = _CopyImage(_Display)

speed = 75 'speed for _LIMIT
moves = 15 'how many shuffle moves to do

Color &HFF000000
_PrintMode _KeepBackground
Dim winnings As Long
Do

    _PutImage , back&, 0
    Locate 2, 2: Print "Winnings: $"; winnings
    Locate 10, 39: Input "Enter to Pay $5 to Play Shell Game, any other quits "; yes$
    If Len(yes$) Then End

    cupball = Int(Rnd * 3) + 1 'make random cupball number (1,2,or 3)

    GoSub ShowBall 'show where ball is first

    'shuffle the cups
    For m = 1 To moves
        Select Case Int(Rnd * 6) + 1 'random move
            Case 1: GoSub move1to2
            Case 2: GoSub move1to3
            Case 3: GoSub move2to1
            Case 4: GoSub move2to3
            Case 5: GoSub move3to1
            Case 6: GoSub move3to2
        End Select
    Next

    GoSub PlaceCups 'make sure they are placed right

    selected = 0 'not selected yet

    Do
        While _MouseInput: Wend
        If _MouseButton(1) Then
            mx = _MouseX: my = _MouseY
            'clicked cup 1
            If mx > 114 And mx < 316 And my > 146 And my < 439 Then
                If cupball = 1 Then selected = 1
                Exit Do
            End If
            'clicked cup 2
            If mx > 378 And mx < 600 And my > 146 And my < 439 Then
                If cupball = 2 Then selected = 1
                Exit Do
            End If
            'clicked cup 3
            If mx > 694 And mx < 911 And my > 146 And my < 439 Then
                If cupball = 3 Then selected = 1
                Exit Do
            End If
        End If
    Loop

    'make sure mouse button up to continue
    Do Until _MouseButton(1) = 0: m = _MouseInput: Loop

    'flash screen based on selection
    If selected = 0 Then
        'flash red - wrong one
        Line (0, 0)-(_Width, _Height), _RGBA(255, 0, 0, 100), BF
        winnings = winnings - 5
        _Display
        _Delay 1
    Else
        'flash green - selected right
        Line (0, 0)-(_Width, _Height), _RGBA(0, 255, 0, 100), BF
        winnings = winnings + 5
        _Display
        _Delay 1
    End If

    GoSub ShowBall 'show where ball is
    If winnings > 50 Then speed = speed + 5
Loop

End

'===================================================================
PlaceCups: 'shows all cups in place
'=========
'Place all cups first
_PutImage (0, 0), back&
RotoZoom3 200, 300, cup&, 1, 1, 0
RotoZoom3 500, 300, cup&, 1, 1, 0
RotoZoom3 800, 300, cup&, 1, 1, 0
_Display
Return
'=====

'===================================================================
ShowBall: 'Raises cup to show ball
'=======

'make sure showing all cups first
GoSub PlaceCups

_Display: _Delay 1

shadowgrow = 0

'raise a cup based on cupball number
Select Case cupball
    Case Is = 1 'raise cup 1
        _PutImage (0, 0), back&
        For y = 300 To 175 Step -7
            _PutImage (0, 0), back&
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 210, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 210, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 210, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 200, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _Display
            _Limit 50
        Next
        'Sleep
    Case Is = 2 'raise cup 2
        _PutImage (0, 0), back&
        For y = 300 To 175 Step -7
            _PutImage (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 510, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 510, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 510, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 500, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _Display
            _Limit 50
        Next
        ' Sleep
    Case Is = 3 'raise cup 3
        _PutImage (0, 0), back&
        For y = 300 To 175 Step -7
            _PutImage (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 810, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 810, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 810, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 800, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _Display
            _Limit 50
        Next
        'Sleep
End Select

_Delay 1 'pause to see ball

'now lower the same a cup
Select Case cupball
    Case Is = 1 'lower cup 1
        _PutImage (0, 0), back&
        For y = 175 To 300 Step 7
            _PutImage (0, 0), back&
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 210, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 210, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 210, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 200, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _Display
            _Limit 50
        Next

    Case Is = 2 'lower cup 2
        _PutImage (0, 0), back&
        For y = 175 To 300 Step 7
            _PutImage (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 510, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 510, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 510, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 500, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _Display
            _Limit 50
        Next
    Case Is = 3 'lower cup 3
        _PutImage (0, 0), back&
        For y = 175 To 300 Step 7
            _PutImage (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 810, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 810, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 810, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 800, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _Display
            _Limit 50
        Next
End Select

Return
'=====


'===================================================================
move1to2: 'moves cup 1 over to cup 2
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 15
    _PutImage (0, 0), back& 'redraw background
    'cup 3 stays in place
    RotoZoom3 800, 300, cup&, cup3z, cup3z, 0
    'cup 2 shrinks, going under cup 1, moving left
    RotoZoom3 500 - move, 300 - cup2z, cup&, cup2z, cup2z, 0
    If move > 150 Then cup2z = cup2z + .03 Else cup2z = cup2z - .03
    'cup 1 enlarges, going over cup 2, moving right
    RotoZoom3 200 + move, 300 * cup1z, cup&, cup1z, cup1z, 0
    If move > 150 Then cup1z = cup1z - .03 Else cup1z = cup1z + .03
    _Display
    _Limit speed
Next
'swap ball placement
Select Case cupball
    Case 1: cupball = 2
    Case 2: cupball = 1
End Select

Return
'=====


'===================================================================
move1to3: 'move cup 1 over to cup 3
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 8
    _PutImage (0, 0), back&
    'cup 3 shrinks, moves left two places
    RotoZoom3 800 - (move * 2), 300 - cup3z, cup&, cup3z, cup3z, 0
    If move > 150 Then cup3z = cup3z + .02 Else cup3z = cup3z - .02
    'cup 2 stays in place
    RotoZoom3 500, 300, cup&, cup2z, cup2z, 0
    'cup 1 enlarges, moving right two places
    RotoZoom3 200 + (move * 2), 300 * cup1z, cup&, cup1z, cup1z, 0
    If move > 150 Then cup1z = cup1z - .02 Else cup1z = cup1z + .02
    _Display
    _Limit speed * 1.7
Next
Select Case cupball
    Case 1: cupball = 3
    Case 3: cupball = 1
End Select

Return
'=====

'===================================================================
move2to1: 'move cup 2 over to cup 1
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 15
    _PutImage (0, 0), back&
    '3rd cup stays in place
    RotoZoom3 800, 300, cup&, cup3z, cup3z, 0
    'cup 1 shrinks, moving right
    RotoZoom3 200 + move, 300 - cup1z, cup&, cup1z, cup1z, 0
    If move > 150 Then cup1z = cup1z + .03 Else cup1z = cup1z - .03
    'cup 2 enlarges, moving left
    RotoZoom3 500 - move, 300 * cup2z, cup&, cup2z, cup2z, 0
    If move > 150 Then cup2z = cup2z - .03 Else cup2z = cup2z + .03
    _Display
    _Limit speed
Next
Select Case cupball
    Case 1: cupball = 2
    Case 2: cupball = 1
End Select

Return
'=====

'===================================================================
move2to3: 'move cup 2 over to cup 3
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 15
    _PutImage (0, 0), back&
    'cup 1 stays in place
    RotoZoom3 200, 300, cup&, cup1z, cup1z, 0
    'cup 3 shrinks under, moves left 1 cup,
    RotoZoom3 800 - move, 300 - cup3z, cup&, cup3z, cup3z, 0
    If move > 150 Then cup3z = cup3z + .03 Else cup3z = cup3z - .03
    'cup 2 enlarges over, moves right 1 cup
    RotoZoom3 500 + move, 300 * cup2z, cup&, cup2z, cup2z, 0
    If move > 150 Then cup2z = cup2z - .03 Else cup2z = cup2z + .03
    _Display
    _Limit speed
Next
Select Case cupball
    Case 2: cupball = 3
    Case 3: cupball = 2
End Select

Return

'===================================================================
move3to1: 'move cup 3 over to cup 1
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 8
    _PutImage (0, 0), back&
    'cup 1 shrinks under, moving right two cup places,
    RotoZoom3 200 + (move * 2), 300 - cup1z, cup&, cup1z, cup1z, 0
    If move > 150 Then cup1z = cup1z + .02 Else cup1z = cup1z - .02
    'cup2 stays in place
    RotoZoom3 500, 300, cup&, cup2z, cup2z, 0
    'cup 3 enlarges over, moving left two cup places,
    RotoZoom3 800 - (move * 2), 300 * cup3z, cup&, cup3z, cup3z, 0
    If move > 150 Then cup3z = cup3z - .02 Else cup3z = cup3z + .02
    _Display
    _Limit speed * 1.7
Next
Select Case cupball
    Case 3: cupball = 1
    Case 1: cupball = 3
End Select

Return
'=====

'===================================================================
move3to2: 'move cup 3 over to cup2
'=======
cup1z = 1: cup2z = 1: cup3z = 1
For move = 1 To 300 Step 15
    _PutImage (0, 0), back&
    'cup1 stays in place
    RotoZoom3 200, 300, cup&, cup1z, cup1z, 0
    'cup 2 shrinks under, moves right 1 cup
    RotoZoom3 500 + move, 300 - cup2z, cup&, cup2z, cup2z, 0
    If move > 150 Then cup2z = cup2z + .03 Else cup2z = cup2z - .03
    'cup 3 enlarges over, moves left 1 cup,
    RotoZoom3 800 - move, 300 * cup3z, cup&, cup3z, cup3z, 0
    If move > 150 Then cup3z = cup3z - .03 Else cup3z = cup3z + .03
    _Display
    _Limit speed
Next
Select Case cupball
    Case 3: cupball = 2
    Case 2: cupball = 3
End Select

Return


Sub RotoZoom3 (X As Long, Y As Long, Image As Long, xScale As Single, yScale As Single, radianRotation As Single)
    ' This assumes you have set your drawing location with _DEST or default to screen.
    ' X, Y - is where you want to put the middle of the image
    ' Image - is the handle assigned with _LOADIMAGE
    ' xScale, yScale - are shrinkage < 1 or magnification > 1 on the given axis, 1 just uses image size.
    ' These are multipliers so .5 will create image .5 size on given axis and 2 for twice image size.
    ' radianRotation is the Angle in Radian units to rotate the image
    ' note: Radian units for rotation because it matches angle units of other Basic Trig functions
    '       and saves a little time converting from degree.
    '       Use the _D2R() function if you prefer to work in degree units for angles.

    Dim px(3) As Single: Dim py(3) As Single ' simple arrays for x, y to hold the 4 corners of image
    Dim W&, H&, sinr!, cosr!, i&, x2&, y2& '   variables for image manipulation
    W& = _Width(Image&): H& = _Height(Image&)
    px(0) = -W& / 2: py(0) = -H& / 2 'left top corner
    px(1) = -W& / 2: py(1) = H& / 2 ' left bottom corner
    px(2) = W& / 2: py(2) = H& / 2 '  right bottom
    px(3) = W& / 2: py(3) = -H& / 2 ' right top
    sinr! = Sin(-radianRotation): cosr! = Cos(-radianRotation) ' rotation helpers
    For i& = 0 To 3 ' calc new point locations with rotation and zoom
        x2& = xScale * (px(i&) * cosr! + sinr! * py(i&)) + X: y2& = yScale * (py(i&) * cosr! - px(i&) * sinr!) + Y
        px(i&) = x2&: py(i&) = y2&
    Next
    _MapTriangle _Seamless(0, 0)-(0, H& - 1)-(W& - 1, H& - 1), Image To(px(0), py(0))-(px(1), py(1))-(px(2), py(2))
    _MapTriangle _Seamless(0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), Image To(px(0), py(0))-(px(3), py(3))-(px(2), py(2))
End Sub

Function BASIMAGE1& 'cup.png
    v& = _NewImage(235, 336, 32)
    Dim m As _MEM: m = _MemImage(v&)
    A$ = ""
    A$ = A$ + "haIkM^Z\ULK50=O66UZ<`h1KZ=gP;dLGYlg`DVIP13l0SQikHh14H0Q5BZ:h"
    A$ = A$ + "4JZ9gn<GecFZgjEgB]N]0[JNN?W^E_GmFB]d^odWndOhC000L9nOoWomW<lO"
    A$ = A$ + "oWoeRbojS?^d?_lH[e]C0DKTaknla=Wj<l?n;o9_lgocoX:nno7jk1G661R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L\TjcD;Wc[DOFj1c;ZLm:DOgUgOgM^Q`9_V_VENg#g7=B>Hg?3OmG<eL6Ge"
    A$ = A$ + "C;Q_F;G]4NZFoHU^ZI>L>#\lU:ckO\lVhYeeSEcmJ^FjLMdmjGBNMTafEbnn"
    A$ = A$ + "MeHMghmDLfkfASegmHcmZln\n^nI6WYfcCa4cdjHgEVHiNCjIVNaWED[6GH?"
    A$ = A$ + "<VjBN<kKl;aNn>abIfjHD8<VkSjKn[>hcAjKE?BdW5b=m\^:jiSWn_jN]Cfg"
    A$ = A$ + "EbI>O4J<`n67\aQ?eJ=X#?ObTleCl<;;bm8llmWJkU<7Y_aEbH;1Y3k3I<R?"
    A$ = A$ + "7?enM?BinbNnd3dODO>WF^AGJM\1<fTS3k^VFeh\^]jLX5ImTLFg;4ihT]nJ"
    A$ = A$ + "70BB9o\?O_Gagi0i110P_`o7c`W^%%%0"
    btemp$ = ""
    For i& = 1 To Len(A$) Step 4: B$ = Mid$(A$, i&, 4)
        If InStr(1, B$, "%") Then
            For C% = 1 To Len(B$): F$ = Mid$(B$, C%, 1)
                If F$ <> "%" Then C$ = C$ + F$
            Next: B$ = C$: End If: For j = 1 To Len(B$)
            If Mid$(B$, j, 1) = "#" Then
        Mid$(B$, j) = "@": End If: Next
        For t% = Len(B$) To 1 Step -1
            B& = B& * 64 + Asc(Mid$(B$, t%)) - 48
            Next: X$ = "": For t% = 1 To Len(B$) - 1
            X$ = X$ + Chr$(B& And 255): B& = B& \ 256
    Next: btemp$ = btemp$ + X$: Next
    btemp$ = _Inflate$(btemp$)
    _MemPut m, m.OFFSET, btemp$: _MemFree m
    BASIMAGE1& = _CopyImage(v&): _FreeImage v&
End Function

Function BASIMAGE2& 'ball.png
    v& = _NewImage(100, 99, 32)
    Dim m As _MEM: m = _MemImage(v&)
    A$ = ""
    A$ = A$ + "haIkM^SSULL45EK5jB#j#j#K^1X?g3L=X=S\4Xf3bAN22#0bAK1jC718d2i8"
    A$ = A$ + "L8>jP8cZNm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kfL4"
    A$ = A$ + "NmH=Sno1n`EHAOlJk:OadmgK__kWlIinG=]N8XWlJ[o6O<<\V3[=Ia9b]=eG"
    A$ = A$ + "4^VeSGNSl[g;mg]?U7Cl\??nlh]MlOPD%%L2"
    btemp$ = ""
    For i& = 1 To Len(A$) Step 4: B$ = Mid$(A$, i&, 4)
        If InStr(1, B$, "%") Then
            For C% = 1 To Len(B$): F$ = Mid$(B$, C%, 1)
                If F$ <> "%" Then C$ = C$ + F$
            Next: B$ = C$: End If: For j = 1 To Len(B$)
            If Mid$(B$, j, 1) = "#" Then
        Mid$(B$, j) = "@": End If: Next
        For t% = Len(B$) To 1 Step -1
            B& = B& * 64 + Asc(Mid$(B$, t%)) - 48
            Next: X$ = "": For t% = 1 To Len(B$) - 1
            X$ = X$ + Chr$(B& And 255): B& = B& \ 256
    Next: btemp$ = btemp$ + X$: Next
    btemp$ = _Inflate$(btemp$)
    _MemPut m, m.OFFSET, btemp$: _MemFree m
    BASIMAGE2& = _CopyImage(v&): _FreeImage v&
End Function

Sub fcirc (CX As Long, CY As Long, R As Long, C As _Unsigned Long)
    Dim Radius As Long, RadiusError As Long
    Dim X As Long, Y As Long
    Radius = Abs(R): RadiusError = -Radius: X = Radius: Y = 0
    If Radius = 0 Then PSet (CX, CY), C: Exit Sub
    Line (CX - X, CY)-(CX + X, CY), C, BF
    While X > Y
        RadiusError = RadiusError + Y * 2 + 1
        If RadiusError >= 0 Then
            If X <> Y + 1 Then
                Line (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
                Line (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
            End If
            X = X - 1
            RadiusError = RadiusError - X * 2
        End If
        Y = Y + 1
        Line (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
        Line (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
    Wend
End Sub



RE: Find the ball - classic shell game - Dav - 05-11-2022

I like the new ball!  Good catch on the shadow edges showing.  On my old laptop screen they didn't stick out, until you pointed it out.  I thought the background and cup colors needed improving, to match the better ball and shadow, so I overhauled the look.  Removed the ball image, replaced the cup one.

- Dav


Code: (Select All)
_TITLE "Shell Game $5" 'b+ mod 2022-05-09
'mod by Dav 2022-05-11, colors & cup image

'============
'FINDBALL.BAS
'============
'Classic Cups & Ball game (shell game)
'Coded by Dav, MAY/2022

'Cups will shuffle.  Click the cup with the ball.
'If selected correctly, screen flashes green.  If not,
'screen will flash red.  This could be turned into a
'game easy, with score keeping and speed changes.
'For now it just loops over and over.

RANDOMIZE TIMER

SCREEN _NEWIMAGE(1000, 600, 32)
_SCREENMOVE 200, 60

cup& = BASIMAGE1& 'decode cup image to use

shadow& = _NEWIMAGE(100, 100, 32)
fcirc 49, 49, 49, &H25000000
_PUTIMAGE , 0, shadow&, (0, 0)-(99, 99)
'=========================================
ball& = _NEWIMAGE(100, 100, 32)
FOR r = 49 TO 0 STEP -1
    fcirc 49, 49, r, _RGB32(255 - 4 * r, 0, 50 - r)
NEXT

_PUTIMAGE , 0, ball&, (0, 0)-(99, 99)


'=== draw background

CLS , _RGB(0, 0, 0) 'black sky
'add a few stars
FOR s = 1 TO 75
    PSET (RND * _WIDTH, RND * 250), _RGB(192, 192, 192)
NEXT
'green gradient ground
c = 0
FOR y = 300 TO _HEIGHT
    LINE (0, y)-(_WIDTH, y), _RGB(0, c, c / 2), BF
    c = c + 1: IF c = 128 THEN c = 128
NEXT

'=== grab background image
back& = _COPYIMAGE(_DISPLAY)

speed = 75 'speed for _LIMIT
moves = 15 'how many shuffle moves to do

COLOR &HFFFFFFFF
_PRINTMODE _KEEPBACKGROUND
DIM winnings AS LONG
DO

    _PUTIMAGE , back&, 0
    LOCATE 2, 2: PRINT "Winnings: $"; winnings
    LOCATE 10, 39: INPUT "Enter to Pay $5 to Play Shell Game, any other quits "; yes$
    IF LEN(yes$) THEN END

    cupball = INT(RND * 3) + 1 'make random cupball number (1,2,or 3)

    GOSUB ShowBall 'show where ball is first

    'shuffle the cups
    FOR m = 1 TO moves
        SELECT CASE INT(RND * 6) + 1 'random move
            CASE 1: GOSUB move1to2
            CASE 2: GOSUB move1to3
            CASE 3: GOSUB move2to1
            CASE 4: GOSUB move2to3
            CASE 5: GOSUB move3to1
            CASE 6: GOSUB move3to2
        END SELECT
    NEXT

    GOSUB PlaceCups 'make sure they are placed right

    selected = 0 'not selected yet

    DO
        WHILE _MOUSEINPUT: WEND
        IF _MOUSEBUTTON(1) THEN
            mx = _MOUSEX: my = _MOUSEY
            'clicked cup 1
            IF mx > 114 AND mx < 316 AND my > 146 AND my < 439 THEN
                IF cupball = 1 THEN selected = 1
                EXIT DO
            END IF
            'clicked cup 2
            IF mx > 378 AND mx < 600 AND my > 146 AND my < 439 THEN
                IF cupball = 2 THEN selected = 1
                EXIT DO
            END IF
            'clicked cup 3
            IF mx > 694 AND mx < 911 AND my > 146 AND my < 439 THEN
                IF cupball = 3 THEN selected = 1
                EXIT DO
            END IF
        END IF
    LOOP

    'make sure mouse button up to continue
    DO UNTIL _MOUSEBUTTON(1) = 0: m = _MOUSEINPUT: LOOP

    'flash screen based on selection
    IF selected = 0 THEN
        'flash red - wrong one
        LINE (0, 0)-(_WIDTH, _HEIGHT), _RGBA(255, 0, 0, 64), BF
        winnings = winnings - 5
        _DISPLAY
        _DELAY 1
    ELSE
        'flash green - selected right
        LINE (0, 0)-(_WIDTH, _HEIGHT), _RGBA(0, 255, 0, 64), BF
        winnings = winnings + 5
        _DISPLAY
        _DELAY 1
    END IF

    GOSUB ShowBall 'show where ball is
    IF winnings > 50 THEN speed = speed + 5
LOOP

END

'===================================================================
PlaceCups: 'shows all cups in place
'=========
'Place all cups first
_PUTIMAGE (0, 0), back&
RotoZoom3 200, 300, cup&, 1, 1, 0
RotoZoom3 500, 300, cup&, 1, 1, 0
RotoZoom3 800, 300, cup&, 1, 1, 0
_DISPLAY
RETURN
'=====

'===================================================================
ShowBall: 'Raises cup to show ball
'=======

'make sure showing all cups first
GOSUB PlaceCups

_DISPLAY: _DELAY 1

shadowgrow = 0

'raise a cup based on cupball number
SELECT CASE cupball
    CASE IS = 1 'raise cup 1
        _PUTIMAGE (0, 0), back&
        FOR y = 300 TO 175 STEP -7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 210, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 210, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 210, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 200, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _DISPLAY
            _LIMIT 50
        NEXT
        'Sleep
    CASE IS = 2 'raise cup 2
        _PUTIMAGE (0, 0), back&
        FOR y = 300 TO 175 STEP -7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 510, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 510, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 510, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 500, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _DISPLAY
            _LIMIT 50
        NEXT
        ' Sleep
    CASE IS = 3 'raise cup 3
        _PUTIMAGE (0, 0), back&
        FOR y = 300 TO 175 STEP -7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 810, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 810, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 810, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 800, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _DISPLAY
            _LIMIT 50
        NEXT
        'Sleep
END SELECT

_DELAY 1 'pause to see ball

'now lower the same a cup
SELECT CASE cupball
    CASE IS = 1 'lower cup 1
        _PUTIMAGE (0, 0), back&
        FOR y = 175 TO 300 STEP 7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 210, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 210, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 210, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 200, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _DISPLAY
            _LIMIT 50
        NEXT

    CASE IS = 2 'lower cup 2
        _PUTIMAGE (0, 0), back&
        FOR y = 175 TO 300 STEP 7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 510, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 510, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 510, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 500, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _DISPLAY
            _LIMIT 50
        NEXT
    CASE IS = 3 'lower cup 3
        _PUTIMAGE (0, 0), back&
        FOR y = 175 TO 300 STEP 7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 810, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 810, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 810, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 800, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _DISPLAY
            _LIMIT 50
        NEXT
END SELECT

RETURN
'=====


'===================================================================
move1to2: 'moves cup 1 over to cup 2
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back& 'redraw background
    'cup 3 stays in place
    RotoZoom3 800, 300, cup&, cup3z, cup3z, 0
    'cup 2 shrinks, going under cup 1, moving left
    RotoZoom3 500 - move, 300 - cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z + .03 ELSE cup2z = cup2z - .03
    'cup 1 enlarges, going over cup 2, moving right
    RotoZoom3 200 + move, 300 * cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z - .03 ELSE cup1z = cup1z + .03
    _DISPLAY
    _LIMIT speed
NEXT
'swap ball placement
SELECT CASE cupball
    CASE 1: cupball = 2
    CASE 2: cupball = 1
END SELECT

RETURN
'=====


'===================================================================
move1to3: 'move cup 1 over to cup 3
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 8
    _PUTIMAGE (0, 0), back&
    'cup 3 shrinks, moves left two places
    RotoZoom3 800 - (move * 2), 300 - cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z + .02 ELSE cup3z = cup3z - .02
    'cup 2 stays in place
    RotoZoom3 500, 300, cup&, cup2z, cup2z, 0
    'cup 1 enlarges, moving right two places
    RotoZoom3 200 + (move * 2), 300 * cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z - .02 ELSE cup1z = cup1z + .02
    _DISPLAY
    _LIMIT speed * 1.7
NEXT
SELECT CASE cupball
    CASE 1: cupball = 3
    CASE 3: cupball = 1
END SELECT

RETURN
'=====

'===================================================================
move2to1: 'move cup 2 over to cup 1
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back&
    '3rd cup stays in place
    RotoZoom3 800, 300, cup&, cup3z, cup3z, 0
    'cup 1 shrinks, moving right
    RotoZoom3 200 + move, 300 - cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z + .03 ELSE cup1z = cup1z - .03
    'cup 2 enlarges, moving left
    RotoZoom3 500 - move, 300 * cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z - .03 ELSE cup2z = cup2z + .03
    _DISPLAY
    _LIMIT speed
NEXT
SELECT CASE cupball
    CASE 1: cupball = 2
    CASE 2: cupball = 1
END SELECT

RETURN
'=====

'===================================================================
move2to3: 'move cup 2 over to cup 3
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back&
    'cup 1 stays in place
    RotoZoom3 200, 300, cup&, cup1z, cup1z, 0
    'cup 3 shrinks under, moves left 1 cup,
    RotoZoom3 800 - move, 300 - cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z + .03 ELSE cup3z = cup3z - .03
    'cup 2 enlarges over, moves right 1 cup
    RotoZoom3 500 + move, 300 * cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z - .03 ELSE cup2z = cup2z + .03
    _DISPLAY
    _LIMIT speed
NEXT
SELECT CASE cupball
    CASE 2: cupball = 3
    CASE 3: cupball = 2
END SELECT

RETURN

'===================================================================
move3to1: 'move cup 3 over to cup 1
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 8
    _PUTIMAGE (0, 0), back&
    'cup 1 shrinks under, moving right two cup places,
    RotoZoom3 200 + (move * 2), 300 - cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z + .02 ELSE cup1z = cup1z - .02
    'cup2 stays in place
    RotoZoom3 500, 300, cup&, cup2z, cup2z, 0
    'cup 3 enlarges over, moving left two cup places,
    RotoZoom3 800 - (move * 2), 300 * cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z - .02 ELSE cup3z = cup3z + .02
    _DISPLAY
    _LIMIT speed * 1.7
NEXT
SELECT CASE cupball
    CASE 3: cupball = 1
    CASE 1: cupball = 3
END SELECT

RETURN
'=====

'===================================================================
move3to2: 'move cup 3 over to cup2
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back&
    'cup1 stays in place
    RotoZoom3 200, 300, cup&, cup1z, cup1z, 0
    'cup 2 shrinks under, moves right 1 cup
    RotoZoom3 500 + move, 300 - cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z + .03 ELSE cup2z = cup2z - .03
    'cup 3 enlarges over, moves left 1 cup,
    RotoZoom3 800 - move, 300 * cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z - .03 ELSE cup3z = cup3z + .03
    _DISPLAY
    _LIMIT speed
NEXT
SELECT CASE cupball
    CASE 3: cupball = 2
    CASE 2: cupball = 3
END SELECT

RETURN


SUB RotoZoom3 (X AS LONG, Y AS LONG, Image AS LONG, xScale AS SINGLE, yScale AS SINGLE, radianRotation AS SINGLE)
    ' This assumes you have set your drawing location with _DEST or default to screen.
    ' X, Y - is where you want to put the middle of the image
    ' Image - is the handle assigned with _LOADIMAGE
    ' xScale, yScale - are shrinkage < 1 or magnification > 1 on the given axis, 1 just uses image size.
    ' These are multipliers so .5 will create image .5 size on given axis and 2 for twice image size.
    ' radianRotation is the Angle in Radian units to rotate the image
    ' note: Radian units for rotation because it matches angle units of other Basic Trig functions
    '       and saves a little time converting from degree.
    '       Use the _D2R() function if you prefer to work in degree units for angles.

    DIM px(3) AS SINGLE: DIM py(3) AS SINGLE ' simple arrays for x, y to hold the 4 corners of image
    DIM W&, H&, sinr!, cosr!, i&, x2&, y2& '   variables for image manipulation
    W& = _WIDTH(Image&): H& = _HEIGHT(Image&)
    px(0) = -W& / 2: py(0) = -H& / 2 'left top corner
    px(1) = -W& / 2: py(1) = H& / 2 ' left bottom corner
    px(2) = W& / 2: py(2) = H& / 2 '  right bottom
    px(3) = W& / 2: py(3) = -H& / 2 ' right top
    sinr! = SIN(-radianRotation): cosr! = COS(-radianRotation) ' rotation helpers
    FOR i& = 0 TO 3 ' calc new point locations with rotation and zoom
        x2& = xScale * (px(i&) * cosr! + sinr! * py(i&)) + X: y2& = yScale * (py(i&) * cosr! - px(i&) * sinr!) + Y
        px(i&) = x2&: py(i&) = y2&
    NEXT
    _MAPTRIANGLE _SEAMLESS(0, 0)-(0, H& - 1)-(W& - 1, H& - 1), Image TO(px(0), py(0))-(px(1), py(1))-(px(2), py(2))
    _MAPTRIANGLE _SEAMLESS(0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), Image TO(px(0), py(0))-(px(3), py(3))-(px(2), py(2))
END SUB

FUNCTION BASIMAGE1& 'cup.png
    v& = _NEWIMAGE(235, 336, 32)
    DIM m AS _MEM: m = _MEMIMAGE(v&)
    A$ = ""
    A$ = A$ + "haIkM_SLMLS506nj#7XMPRDi<WbBK0_8V87<k8_<d6aK3_5DX3i8DDH8^Pha"
    A$ = A$ + "1_a1hOZj[V9H45Igm?AOknd]NmeGOl:004k?NiUG=nc_neGo_oj_^E\O_mKO"
    A$ = A$ + "nc_^j]C0mPmHJSJkRojaS]C[=^aZggPka_oU_8^3GMK]Cb]]bLN4f][?NHfD"
    A$ = A$ + "_nmeH_9]5GmanW89]\IocZ?61kGC^jSMAn>V6n\T[;GmaQX_=<m[NHKc#G;e"
    A$ = A$ + "EO\5VOoBk^?X=A:d^kAOBKRBAg>7QFoLekkQN5ZKGmahJFX[;dZg7ScCXigH"
    A$ = A$ + "e7k[5VIIc]AGmnBL?LKFVYbdL?GgE_O3g;>ghhH]D\KLGSMema^`dY^GgXE_"
    A$ = A$ + "?2`bLlhoiGn5jeObdYV]7dYHgHKEcaXgnWOelk[NiCOReDaFbfZVSA_meF=o"
    A$ = A$ + "n:cf1FG5k6g>ehfWK2K[j^f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KX9C]]doLOmiO>m[nkiAgaa>^YTF^V^NW?nZV_gSeJY"
    A$ = A$ + "fV:IkIYG7RC#ZcmeUmc]JGKmDgN8mHBY7;EkaPm\ekQBon]d[aJ]oL^jSEVi"
    A$ = A$ + "aS^KGcm>GboLQ_U]Eedb]LLn8JmM1mghkDo[cd]g[U^]NV[Y=kfRe17ka>ed"
    A$ = A$ + "Yd[[Koe:]j]1g6oO?M]MJXNemgo^jO>1dZH=ZYeZ]C3e[Wfe86HV2eXfk;C9"
    A$ = A$ + "ok2G:^GOHjEPb<S6eUi[Yke8Vc968=o[KXkik>R6=eJ\nG3aE_]1HeRmiAKm"
    A$ = A$ + "J7ekc9VV5gX#gk=o6MDW_K=WC<=;^=iF3en>GIE=ZdVU^5WXL[QJkCckK`Eg"
    A$ = A$ + "ViJf#gS7jFXIB?7gM^?SaliImKFjFX9BjC=\6ZDVO62]FK\^Uf5[B\icnTkc"
    A$ = A$ + "JjFJG<KBKcKY?ce]nGC:JG<:UdVgNOBkRI:dcBTTf<fk<5dofUnmn4kil;EK"
    A$ = A$ + "J_f]cN>R>Min\^aV53jhcA^m[ijBJce`\m>gj^Ufa[nHAT_9UdSnWC;]inYV"
    A$ = A$ + "nEjJadbc[7ULMOX;?G]daUnn8JeM`^fO]dRdSXf6^GMm^ej]lmM=m7=9jUNf"
    A$ = A$ + "bcZegQN;5kfCJA\:fS1WAG_KhNCRKRmHmLgGZAgK\N70#knO[;ga%%%0"
    btemp$ = ""
    FOR i& = 1 TO LEN(A$) STEP 4: B$ = MID$(A$, i&, 4)
        IF INSTR(1, B$, "%") THEN
            FOR C% = 1 TO LEN(B$): F$ = MID$(B$, C%, 1)
                IF F$ <> "%" THEN C$ = C$ + F$
            NEXT: B$ = C$: END IF: FOR j = 1 TO LEN(B$)
            IF MID$(B$, j, 1) = "#" THEN
        MID$(B$, j) = "@": END IF: NEXT
        FOR t% = LEN(B$) TO 1 STEP -1
            B& = B& * 64 + ASC(MID$(B$, t%)) - 48
            NEXT: X$ = "": FOR t% = 1 TO LEN(B$) - 1
            X$ = X$ + CHR$(B& AND 255): B& = B& \ 256
    NEXT: btemp$ = btemp$ + X$: NEXT
    btemp$ = _INFLATE$(btemp$,m.SIZE)
    _MEMPUT m, m.OFFSET, btemp$: _MEMFREE m
    BASIMAGE1& = _COPYIMAGE(v&): _FREEIMAGE v&
END FUNCTION

SUB fcirc (CX AS LONG, CY AS LONG, R AS LONG, C AS _UNSIGNED LONG)
    DIM Radius AS LONG, RadiusError AS LONG
    DIM X AS LONG, Y AS LONG
    Radius = ABS(R): RadiusError = -Radius: X = Radius: Y = 0
    IF Radius = 0 THEN PSET (CX, CY), C: EXIT SUB
    LINE (CX - X, CY)-(CX + X, CY), C, BF
    WHILE X > Y
        RadiusError = RadiusError + Y * 2 + 1
        IF RadiusError >= 0 THEN
            IF X <> Y + 1 THEN
                LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
                LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
            END IF
            X = X - 1
            RadiusError = RadiusError - X * 2
        END IF
        Y = Y + 1
        LINE (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
        LINE (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
    WEND
END SUB



RE: Find the ball - classic shell game - bplus - 05-11-2022

Looks good! I thought first cups were realistic image, new ones do look drawn but need darker color.


RE: Find the ball - classic shell game - Dav - 05-11-2022

Yeah. The first one was more realistic, but the image had white edges. Couldn’t remove it easily so I just drew a cup to match it with black edges. Not satisfied with it either.  I’ll work on a better one, and try to come up with some sounds. 

- Dav


RE: Find the ball - classic shell game - Dav - 05-12-2022

Hey @bplus!   I had a cancelled gig today and found some time to improve this game.  I went back to the original cup, removed its white outline (just inverted the image colors which turned the white edge to black, then colorized the image to blue again).  I also added larger text using PPRINT.  Also, the cups now drop down onto the board and lift away between turns.  Also added some sound effects (cheap ones, but some sound at least). 

- Dav

Code: (Select All)
_TITLE "Shell Game $5" 'b+ mod 2022-05-09

'mod by Dav 2022-05-12, back to old cup, cups drop & lift for new turns, added sounds.

'============
'FINDBALL.BAS
'============
'Classic Cups & Ball game (shell game)
'Coded by Dav, MAY/2022

'Cups will shuffle.  Click the cup with the ball.
'If selected correctly, screen flashes green.  If not,
'screen will flash red.  This could be turned into a
'game easy, with score keeping and speed changes.
'For now it just loops over and over.

RANDOMIZE TIMER

SCREEN _NEWIMAGE(1000, 600, 32)
_SCREENMOVE 200, 60

cup& = BASIMAGE1& 'decode cup image to use

shadow& = _NEWIMAGE(100, 100, 32)
fcirc 49, 49, 49, &H25000000
_PUTIMAGE , 0, shadow&, (0, 0)-(99, 99)
'=========================================
ball& = _NEWIMAGE(100, 100, 32)
FOR r = 49 TO 0 STEP -1
    fcirc 49, 49, r, _RGB32(255 - 4 * r, 0, 50 - r)
NEXT

_PUTIMAGE , 0, ball&, (0, 0)-(99, 99)


'=== draw background

CLS , _RGB(0, 0, 0) 'black sky
'add a few stars
FOR s = 1 TO 75
    PSET (RND * _WIDTH, RND * 250), _RGB(192, 192, 192)
NEXT
'green gradient ground
c = 0
FOR y = 300 TO _HEIGHT
    LINE (0, y)-(_WIDTH, y), _RGB(0, c, c / 2), BF
    c = c + 1: IF c = 128 THEN c = 128
NEXT

'=== grab background image
back& = _COPYIMAGE(_DISPLAY)

speed = 75 'speed for _LIMIT
moves = 15 'how many shuffle moves to do

DIM winnings AS LONG

DO

    _PUTIMAGE , back&, 0
    PPRINT 20, 10, 20, _RGB(255, 255, 255), 0, "Winnings: $" + LTRIM$(STR$(winnings))

    PPRINT 204, 124, 50, _RGB(32, 32, 32), 0, "Find the ball" 'shadow
    PPRINT 200, 120, 50, _RGB(0, 128, 255), 0, "Find the ball"

    PPRINT 260, 220, 16, _RGB(255, 255, 255), 0, "Press ENTER to Pay $5 and try!"
    PPRINT 300, 245, 16, _RGB(255, 255, 255), 0, "(any other key quits)"

    _KEYCLEAR
    COLOR 0, 0: INPUT "", yes$: IF LEN(yes$) THEN END

    GOSUB DropCups

    cupball = INT(RND * 3) + 1 'make random cupball number (1,2,or 3)

    GOSUB ShowBall 'show where ball is first

    'shuffle the cups
    FOR m = 1 TO moves

        SELECT CASE INT(RND * 6) + 1 'random move
            CASE 1: GOSUB move1to2
            CASE 2: GOSUB move1to3
            CASE 3: GOSUB move2to1
            CASE 4: GOSUB move2to3
            CASE 5: GOSUB move3to1
            CASE 6: GOSUB move3to2
        END SELECT

        'shuffle sound
        PLAY "mb l64 t255 o1 c,d o2 b,d+"

    NEXT

    GOSUB PlaceCups 'make sure they are placed right

    PPRINT 250, 30, 30, _RGB(255, 255, 0), 0, "Where's the ball?": _DISPLAY

    selected = 0 'not selected yet

    DO
        WHILE _MOUSEINPUT: WEND
        IF _MOUSEBUTTON(1) THEN
            mx = _MOUSEX: my = _MOUSEY
            'clicked cup 1
            IF mx > 114 AND mx < 316 AND my > 146 AND my < 439 THEN
                IF cupball = 1 THEN selected = 1
                EXIT DO
            END IF
            'clicked cup 2
            IF mx > 378 AND mx < 600 AND my > 146 AND my < 439 THEN
                IF cupball = 2 THEN selected = 1
                EXIT DO
            END IF
            'clicked cup 3
            IF mx > 694 AND mx < 911 AND my > 146 AND my < 439 THEN
                IF cupball = 3 THEN selected = 1
                EXIT DO
            END IF
        END IF
    LOOP

    'make sure mouse button up to continue
    DO UNTIL _MOUSEBUTTON(1) = 0: m = _MOUSEINPUT: LOOP

    'flash screen based on selection
    IF selected = 0 THEN
        'wrong - play failed sound
        PLAY "mb l16 c,f f,b c,f f,b c,f"
        _PUTIMAGE (0, 0), back&
        GOSUB PlaceCups
        PPRINT 360, 30, 30, _RGB(255, 0, 0), 0, "WRONG CUP!": _DISPLAY
        'flash red - wrong one
        LINE (0, 0)-(_WIDTH, _HEIGHT), _RGBA(255, 0, 0, 64), BF
        winnings = winnings - 5
        _DISPLAY
        _DELAY 1
    ELSE
        'right! - play fanfare
        PLAY "mb l8 o3e,g,o4c o3g,o4c,e c,e,g e,g,o5c"
        _PUTIMAGE (0, 0), back&
        GOSUB PlaceCups
        PPRINT 360, 30, 30, _RGB(0, 255, 0), 0, "CORRECT!": _DISPLAY
        'flash green - selected right
        LINE (0, 0)-(_WIDTH, _HEIGHT), _RGBA(0, 255, 0, 64), BF
        winnings = winnings + 5
        _DISPLAY
        _DELAY 1
    END IF

    GOSUB ShowBall 'show where ball is
    IF winnings > 50 THEN speed = speed + 5

    GOSUB LiftCups
    _DELAY .5

LOOP

END

'===================================================================
PlaceCups: 'shows all cups in place
'=========
'Place all cups first
_PUTIMAGE (0, 0), back&
RotoZoom3 200, 300, cup&, 1, 1, 0
RotoZoom3 500, 300, cup&, 1, 1, 0
RotoZoom3 800, 300, cup&, 1, 1, 0
_DISPLAY
RETURN
'=====

'===================================================================
DropCups: 'drops cups down at start of turn
'=======

'drop down sound....

PLAY "mb l64 o4 bagfedc o3 bagfedc"

_PUTIMAGE (0, 0), back&
FOR y = -200 TO 300 STEP 10
    _PUTIMAGE (0, 0), back&
    RotoZoom3 500, y, cup&, 1, 1, 0
    RotoZoom3 800, y, cup&, 1, 1, 0
    RotoZoom3 200, y, cup&, 1, 1, 0
    _DISPLAY
    _LIMIT 90
NEXT

'add thud at end for cups landing...
PLAY "mb l64 t255 o1 a,b c,d a,b c,d a,b"

RETURN


'===================================================================
LiftCups:
'=======

PLAY "mb l64 t200 o3 cdefgab o4 cdefgab"

_PUTIMAGE (0, 0), back&
FOR y = 300 TO -200 STEP -10
    _PUTIMAGE (0, 0), back&
    RotoZoom3 500, y, cup&, 1, 1, 0
    RotoZoom3 800, y, cup&, 1, 1, 0
    RotoZoom3 200, y, cup&, 1, 1, 0
    _DISPLAY
    _LIMIT 90
NEXT

RETURN


'===================================================================
ShowBall: 'Raises cup to show ball
'=======

'make sure showing all cups first
GOSUB PlaceCups

_DISPLAY: _DELAY 1

'play raising sound...
PLAY "mb l16 o1cdefg"

shadowgrow = 0

'raise a cup based on cupball number
SELECT CASE cupball
    CASE IS = 1 'raise cup 1
        _PUTIMAGE (0, 0), back&
        FOR y = 300 TO 175 STEP -7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 210, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 210, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 210, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 200, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _DISPLAY
            _LIMIT 50
        NEXT
        'Sleep
    CASE IS = 2 'raise cup 2
        _PUTIMAGE (0, 0), back&
        FOR y = 300 TO 175 STEP -7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 510, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 510, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 510, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 500, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _DISPLAY
            _LIMIT 50
        NEXT
        ' Sleep
    CASE IS = 3 'raise cup 3
        _PUTIMAGE (0, 0), back&
        FOR y = 300 TO 175 STEP -7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 810, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 810, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 810, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 800, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow + .13
            _DISPLAY
            _LIMIT 50
        NEXT
        'Sleep
END SELECT

_DELAY 1.25 'pause to see ball

'lowering sound
PLAY "mb l32 o1 bagfedc"

'now lower the same a cup
SELECT CASE cupball
    CASE IS = 1 'lower cup 1
        _PUTIMAGE (0, 0), back&
        FOR y = 175 TO 300 STEP 7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 210, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 210, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 210, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 200, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _DISPLAY
            _LIMIT 50
        NEXT

    CASE IS = 2 'lower cup 2
        _PUTIMAGE (0, 0), back&
        FOR y = 175 TO 300 STEP 7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 800, 300, cup&, 1, 1, 0
            RotoZoom3 510, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 510, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 510, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 500, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _DISPLAY
            _LIMIT 50
        NEXT
    CASE IS = 3 'lower cup 3
        _PUTIMAGE (0, 0), back&
        FOR y = 175 TO 300 STEP 7
            _PUTIMAGE (0, 0), back&
            RotoZoom3 200, 300, cup&, 1, 1, 0
            RotoZoom3 500, 300, cup&, 1, 1, 0
            RotoZoom3 810, 425, shadow&, 1 + shadowgrow, 1, 0
            RotoZoom3 810, 425, shadow&, 1, .58, 0 ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
            RotoZoom3 810, 400, ball&, 1, 1, 0 'ball first
            RotoZoom3 800, y, cup&, 1, 1, 0 'cup over
            shadowgrow = shadowgrow - .13
            _DISPLAY
            _LIMIT 50
        NEXT
END SELECT

RETURN
'=====


'===================================================================
move1to2: 'moves cup 1 over to cup 2
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back& 'redraw background
    'cup 3 stays in place
    RotoZoom3 800, 300, cup&, cup3z, cup3z, 0
    'cup 2 shrinks, going under cup 1, moving left
    RotoZoom3 500 - move, 300 - cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z + .03 ELSE cup2z = cup2z - .03
    'cup 1 enlarges, going over cup 2, moving right
    RotoZoom3 200 + move, 300 * cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z - .03 ELSE cup1z = cup1z + .03
    _DISPLAY
    _LIMIT speed
NEXT
'swap ball placement
SELECT CASE cupball
    CASE 1: cupball = 2
    CASE 2: cupball = 1
END SELECT

RETURN
'=====


'===================================================================
move1to3: 'move cup 1 over to cup 3
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 8
    _PUTIMAGE (0, 0), back&
    'cup 3 shrinks, moves left two places
    RotoZoom3 800 - (move * 2), 300 - cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z + .02 ELSE cup3z = cup3z - .02
    'cup 2 stays in place
    RotoZoom3 500, 300, cup&, cup2z, cup2z, 0
    'cup 1 enlarges, moving right two places
    RotoZoom3 200 + (move * 2), 300 * cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z - .02 ELSE cup1z = cup1z + .02
    _DISPLAY
    _LIMIT speed * 1.7
NEXT
SELECT CASE cupball
    CASE 1: cupball = 3
    CASE 3: cupball = 1
END SELECT

RETURN
'=====

'===================================================================
move2to1: 'move cup 2 over to cup 1
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back&
    '3rd cup stays in place
    RotoZoom3 800, 300, cup&, cup3z, cup3z, 0
    'cup 1 shrinks, moving right
    RotoZoom3 200 + move, 300 - cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z + .03 ELSE cup1z = cup1z - .03
    'cup 2 enlarges, moving left
    RotoZoom3 500 - move, 300 * cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z - .03 ELSE cup2z = cup2z + .03
    _DISPLAY
    _LIMIT speed
NEXT
SELECT CASE cupball
    CASE 1: cupball = 2
    CASE 2: cupball = 1
END SELECT

RETURN
'=====

'===================================================================
move2to3: 'move cup 2 over to cup 3
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back&
    'cup 1 stays in place
    RotoZoom3 200, 300, cup&, cup1z, cup1z, 0
    'cup 3 shrinks under, moves left 1 cup,
    RotoZoom3 800 - move, 300 - cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z + .03 ELSE cup3z = cup3z - .03
    'cup 2 enlarges over, moves right 1 cup
    RotoZoom3 500 + move, 300 * cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z - .03 ELSE cup2z = cup2z + .03
    _DISPLAY
    _LIMIT speed
NEXT
SELECT CASE cupball
    CASE 2: cupball = 3
    CASE 3: cupball = 2
END SELECT

RETURN

'===================================================================
move3to1: 'move cup 3 over to cup 1
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 8
    _PUTIMAGE (0, 0), back&
    'cup 1 shrinks under, moving right two cup places,
    RotoZoom3 200 + (move * 2), 300 - cup1z, cup&, cup1z, cup1z, 0
    IF move > 150 THEN cup1z = cup1z + .02 ELSE cup1z = cup1z - .02
    'cup2 stays in place
    RotoZoom3 500, 300, cup&, cup2z, cup2z, 0
    'cup 3 enlarges over, moving left two cup places,
    RotoZoom3 800 - (move * 2), 300 * cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z - .02 ELSE cup3z = cup3z + .02
    _DISPLAY
    _LIMIT speed * 1.7
NEXT
SELECT CASE cupball
    CASE 3: cupball = 1
    CASE 1: cupball = 3
END SELECT

RETURN
'=====

'===================================================================
move3to2: 'move cup 3 over to cup2
'=======
cup1z = 1: cup2z = 1: cup3z = 1
FOR move = 1 TO 300 STEP 15
    _PUTIMAGE (0, 0), back&
    'cup1 stays in place
    RotoZoom3 200, 300, cup&, cup1z, cup1z, 0
    'cup 2 shrinks under, moves right 1 cup
    RotoZoom3 500 + move, 300 - cup2z, cup&, cup2z, cup2z, 0
    IF move > 150 THEN cup2z = cup2z + .03 ELSE cup2z = cup2z - .03
    'cup 3 enlarges over, moves left 1 cup,
    RotoZoom3 800 - move, 300 * cup3z, cup&, cup3z, cup3z, 0
    IF move > 150 THEN cup3z = cup3z - .03 ELSE cup3z = cup3z + .03
    _DISPLAY
    _LIMIT speed
NEXT
SELECT CASE cupball
    CASE 3: cupball = 2
    CASE 2: cupball = 3
END SELECT

RETURN


SUB RotoZoom3 (X AS LONG, Y AS LONG, Image AS LONG, xScale AS SINGLE, yScale AS SINGLE, radianRotation AS SINGLE)
    ' This assumes you have set your drawing location with _DEST or default to screen.
    ' X, Y - is where you want to put the middle of the image
    ' Image - is the handle assigned with _LOADIMAGE
    ' xScale, yScale - are shrinkage < 1 or magnification > 1 on the given axis, 1 just uses image size.
    ' These are multipliers so .5 will create image .5 size on given axis and 2 for twice image size.
    ' radianRotation is the Angle in Radian units to rotate the image
    ' note: Radian units for rotation because it matches angle units of other Basic Trig functions
    '       and saves a little time converting from degree.
    '       Use the _D2R() function if you prefer to work in degree units for angles.

    DIM px(3) AS SINGLE: DIM py(3) AS SINGLE ' simple arrays for x, y to hold the 4 corners of image
    DIM W&, H&, sinr!, cosr!, i&, x2&, y2& '   variables for image manipulation
    W& = _WIDTH(Image&): H& = _HEIGHT(Image&)
    px(0) = -W& / 2: py(0) = -H& / 2 'left top corner
    px(1) = -W& / 2: py(1) = H& / 2 ' left bottom corner
    px(2) = W& / 2: py(2) = H& / 2 '  right bottom
    px(3) = W& / 2: py(3) = -H& / 2 ' right top
    sinr! = SIN(-radianRotation): cosr! = COS(-radianRotation) ' rotation helpers
    FOR i& = 0 TO 3 ' calc new point locations with rotation and zoom
        x2& = xScale * (px(i&) * cosr! + sinr! * py(i&)) + X: y2& = yScale * (py(i&) * cosr! - px(i&) * sinr!) + Y
        px(i&) = x2&: py(i&) = y2&
    NEXT
    _MAPTRIANGLE _SEAMLESS(0, 0)-(0, H& - 1)-(W& - 1, H& - 1), Image TO(px(0), py(0))-(px(1), py(1))-(px(2), py(2))
    _MAPTRIANGLE _SEAMLESS(0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), Image TO(px(0), py(0))-(px(3), py(3))-(px(2), py(2))
END SUB

FUNCTION BASIMAGE1& 'cup.png
    v& = _NEWIMAGE(235, 336, 32)
    DIM m AS _MEM: m = _MEMIMAGE(v&)
    A$ = ""
    A$ = A$ + "haIkM6[[UTC40MR8NRPO0T8K5BTSFQ4a4RfT=Ko08VT=PO1T85nCh_PoV1JF"
    A$ = A$ + "<C=NZb]MKk^:KO#j8N;\gkkNMGWGif^LeOjCOj3O2fBn?oW?=:lnk20ARklU"
    A$ = A$ + "?>HnEo\nNmhg`ZC]iZ\lWLnMoLKnSoBKnnOmh8omFnI#kc<>=45Zek\l[JMT"
    A$ = A$ + "OlKo9n[Og_8\Tn<JihiOoelikLK__N3aUJb5VWg;g1KecnWoi_I;XE_F;O]F"
    A$ = A$ + "NJb;3i^YFNA]LQULakRWoGomOH;IFn\E>J]LaN7;1Sg9U^Y<7Ib;el`Ce1m`"
    A$ = A$ + "W[aYU>LYL`N7g1]iVJi;ccCJiUN7OObDS;;c3;coVWgekhA`f=Ui;]LB]lUN"
    A$ = A$ + "7O2?cQebkNA:_;cG>6nI]cU5WL?YVl^bi;CnFOlCLCh>ge:O;>[On9N9XQVk"
    A$ = A$ + "VlflL]N7[_Z8MDimMZUkdkh1H=h>WUl\]kXbLXblW<_FH4Xi\YkYUL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 = A$ + "hCYJ;Cc=cm`T;:mAbI^7TOm;??\VoVW;njinNjo>mcYLcGdRS;oW7US?[i3D"
    A$ = A$ + "b]ZiN6_6GB87;USWFg?YUGZMmdkH<`?7f2=g^DNJY?_beBTeWmdg=]iVJ=6I"
    A$ = A$ + "UCl^LThTP5Ja:e>?K=O>oN[d8?V?U3:?On8h^gkJnlJiQe<oDLA`;JaYK1Il"
    A$ = A$ + "o\XW?OhN`^A=iEF=lN<mThO3=4K5%%%0"
    btemp$ = ""
    FOR i& = 1 TO LEN(A$) STEP 4: B$ = MID$(A$, i&, 4)
        IF INSTR(1, B$, "%") THEN
            FOR C% = 1 TO LEN(B$): F$ = MID$(B$, C%, 1)
                IF F$ <> "%" THEN C$ = C$ + F$
            NEXT: B$ = C$: END IF: FOR j = 1 TO LEN(B$)
            IF MID$(B$, j, 1) = "#" THEN
        MID$(B$, j) = "@": END IF: NEXT
        FOR t% = LEN(B$) TO 1 STEP -1
            B& = B& * 64 + ASC(MID$(B$, t%)) - 48
            NEXT: X$ = "": FOR t% = 1 TO LEN(B$) - 1
            X$ = X$ + CHR$(B& AND 255): B& = B& \ 256
    NEXT: btemp$ = btemp$ + X$: NEXT
    btemp$ = _INFLATE$(btemp$,m.SIZE)
    _MEMPUT m, m.OFFSET, btemp$: _MEMFREE m
    BASIMAGE1& = _COPYIMAGE(v&): _FREEIMAGE v&
END FUNCTION

SUB fcirc (CX AS LONG, CY AS LONG, R AS LONG, C AS _UNSIGNED LONG)
    DIM Radius AS LONG, RadiusError AS LONG
    DIM X AS LONG, Y AS LONG
    Radius = ABS(R): RadiusError = -Radius: X = Radius: Y = 0
    IF Radius = 0 THEN PSET (CX, CY), C: EXIT SUB
    LINE (CX - X, CY)-(CX + X, CY), C, BF
    WHILE X > Y
        RadiusError = RadiusError + Y * 2 + 1
        IF RadiusError >= 0 THEN
            IF X <> Y + 1 THEN
                LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
                LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
            END IF
            X = X - 1
            RadiusError = RadiusError - X * 2
        END IF
        Y = Y + 1
        LINE (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
        LINE (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
    WEND
END SUB

SUB PPRINT (x, y, size, clr&, trans&, text$)
    orig& = _DEST
    bit = 32: IF _PIXELSIZE(0) = 1 THEN bit = 256
    FOR t = 0 TO LEN(text$) - 1
        pprintimg& = _NEWIMAGE(16, 16, bit)
        _DEST pprintimg&
        CLS , trans&: COLOR clr&
        PRINT MID$(text$, t + 1, 1);
        _CLEARCOLOR _RGB(0, 0, 0), pprintimg&
        _DEST orig&
        x1 = x + (t * size): x2 = x1 + size
        y1 = y: y2 = y + size
        _PUTIMAGE (x1 - (size / 2), y1)-(x2, y2 + (size / 3)), pprintimg&
        _FREEIMAGE pprintimg&
    NEXT
END SUB