Roulette

If anyone would be happy to and has time to help me code a roulette mini game, could you give an example code?

You might find these artivles interesting: ronjeffries.com/categories/roulette/
questions welcome.

articles, too :slight_smile:

@Pauls4eva Here’s something using the image from the above link. Select the link above, then select Roulette - Maybe some graphics and select and save the first roulette wheel. Put that image in Dropbox and name it wheel.

displayMode(FULLSCREEN)

function setup()
    img=readImage("Dropbox:wheel")
    ang=math.random(360)
    ang1=math.random(360)
    spin=0
    spin1=0
end

function draw()
    background(40, 40, 50)
    fill(255)
    text("tap screen to spin",WIDTH/2,HEIGHT-50)
    -- wheel
    translate(WIDTH/2,HEIGHT/2)    
    rotate(ang)
    sprite(img,0,0,740)
    ang=ang+spin
    if spin>0 then
        spin=spin-.01
    else
        spin=0
    end   
    -- ball 
    rotate(ang1)
    ellipse(282,0,30)
        ang1=ang1-spin1
    if spin1>0 then
        spin1=spin1-.02
    else
        spin1=0
    end
end

function touched(t)
    if t.state==BEGAN then
        spin=5
        spin1=11
    end
end

Cool! Thanks for the help.