Need help with BackingMode

okay, first of all, i’m pretty noob, and i’m just trying things out and experimenting right now.
I want to use BackingMode(RETAINED) But i think it doesn’t work because of my background.
here’s the code:

function setup()
    backingMode(RETAINED)
    a=0
    x=50
    y=50
    xspeed=10
    yspeed=8
    radius=50
    RandomKleur1=0
    RandomKleur2=0
    RandomKleur3=0
    RandomKleur4=0
    RandomKleur5=0
    RandomKleur6=0
end
function draw()
    background(RandomKleur1, RandomKleur2, RandomKleur3)
    a = a + 1
    if a == 45 then
        a = 0
    RandomKleur1 = math.random(0, 255)
    RandomKleur2 = math.random(0, 255)
    RandomKleur3 = math.random(0, 255)
    RandomKleur4 = math.random(0, 255)
    RandomKleur5 = math.random(0, 255)
    RandomKleur6 = math.random(0, 255)
        end
    x=x+xspeed
    if x-radius<0 or x+radius>=WIDTH then
    xspeed=-xspeed
    end
    y=y+yspeed
    if y-radius<0 or y+radius>=HEIGHT then
    yspeed=-yspeed
        end
    fill(RandomKleur4, RandomKleur5, RandomKleur6)
    ellipse(x,y,radius*2)
end

any help on how to fix this so i can use BackingMode would be appreciated.
P.S. Can someone tell me how to markdown my code :stuck_out_tongue:

@wildcat_JK - first, noobs are welcome :-h

mark your code with `~~~’ before and after, as I did above.

Yes, the background command draws on top of the retained background. Just get rid of it.

Thnx for your comment ignatz, i wrote this code based on your guide on codea :slight_smile: