Letter Physics

How do I make letters have physics. Like the letter G falling and bouncing. Do i just make a circle ohysics body and sprite the letter G over it? Or can I make a specific physics body for the letter

Yes, you make the simplest physical shape you can for each letter (enough for it to bounce correctly), then sprite the letter over it.

I made this a long time ago. I didn’t want to search for it so I posted it again.


function setup() 
    b=65    -- starting value for letter A
    
    c1 = physics.body(CIRCLE,5)     -- create boundary for the letter
    c1.x=295
    c1.y=900
    c1.restitution=.8
    c1.gravityScale=1
    
    c2 = physics.body(CIRCLE,50)    -- create boundary for 1st circle
    c2.type=STATIC
    c2.x=300
    c2.y=600
    
    c3 = physics.body(CIRCLE,50)    -- create boundary for 2nd circle
    c3.type=STATIC
    c3.x=120
    c3.y=400
end

function draw()
    a=string.char(b)    -- convert value to a letter
    
    background(30, 30, 30, 25)
    
    stroke(255)
    strokeWidth(1)
    noFill()
    ellipse(c2.x,c2.y,100,100)    -- draw the 1st circle
    ellipse(c3.x,c3.y,100,100)    -- draw the 2nd circle    
    
    fill(255)
    fontSize(30)
    text(a,c1.x,c1.y)   -- draw the letter
    
    -- get next letter when previous gets below y position of 20
    if c1.y<20 then
        c1.y=900
        c1.x=295
        c1.linearVelocity=vec2(0,0)
        b = b + 1
        if b>90 then
            b=65
        end
    end
end