Lua Carousel: better support for French and hopefully other languages


Garvalf is a French-speaking Forth enthusiast trying out Lua Carousel on a computer. It's lovely that I can run Garvalf's interactive rotating beauty on my English-based phone:

-- use mouse wheel to change rotation, right clic to stop, left clic to rotate...
car.angle = 0
car.spin = 0.005 -- vitesse actuelle
car.friction = 0.55 -- ralentissement progressif (entre 0 et 1)
function arcLine(x, y, r, a1, a2, segments)
    segments = segments or 40
    local points = {}
    local step = (a2 - a1) / segments
    for i = 0, segments do
        local a = math.rad(a1 + step * i)
        table.insert(points, x + math.cos(a) * r)
        table.insert(points, y + math.sin(a) * r)
    end
    love.graphics.line(points)
end
function car.mouse_wheel_move(x, y)
 car.spin = car.spin + y * 0.02 -- la molette ajuste la vitesse directement
end
-- Angle de rotation (global ou dans car)
car.angle = car.angle or 0
function car.update(dt)
    -- Clic gauche = sens horaire
    if love.mouse.isDown(1) then
        car.spin = 0.05
        car.angle = car.angle + car.spin  -- tourne à la vitesse actuelle
    elseif love.mouse.isDown(2) then
        car.angle = 0 -- stop
        car.spin = 0
    else
        car.angle = car.angle + car.spin  -- continue de tourner sans friction
    end
end
function car.draw()
    local mx, my = love.mouse.getPosition()
    -- On translate à la souris, on rotate, puis on dessine centré sur (0,0)
    love.graphics.push()
    love.graphics.translate(mx, my)
    love.graphics.rotate(car.angle)
    local function arc(x, y, r, a1, a2)
        love.graphics.arc("line", x, y, r, math.rad(a1), math.rad(a2))
    end
    local function line(x1, y1, x2, y2)
        love.graphics.line(x1, y1, x2, y2)
    end
    -- === COINS === (coordonnées relatives à (0,0) au lieu de (mx, my))
    -- top left
    do
        local x, y = -150, -50
        arc(x, y, 100, 270, 360)
        line(x, y, x, y - 100)
        line(x, y, x + 100, y)
    end
    -- top right
    do
        local x, y = 150, -50
        arc(x, y, 100, 180, 270)
        line(x, y, x, y - 100)
        line(x, y, x - 100, y)
    end
    -- bottom left
    do
        local x, y = -150, 50
        arc(x, y, 100, 0, 90)
        line(x, y, x, y + 100)
        line(x, y, x + 100, y)
    end
    -- bottom right
    do
        local x, y = 150, 50
        arc(x, y, 100, 90, 180)
    end
    -- === CENTRE HAUT ===
    arcLine(-50, -50, 100, 270, 300)
    arcLine( 50, -50, 100, 240, 270)
    love.graphics.line(-50, -50, -50, -150)
    love.graphics.line( 50, -50,  50, -150)
    love.graphics.line(-50, -50,  50, -50)
    -- === CENTRE (cercles) ===
    for i = -1, 1 do
        love.graphics.circle("line", i * 100, 0, 50)
    end
    -- === CENTRE BAS ===
    arcLine(-50, 50, 100, 60, 90)
    arcLine( 50, 50, 100, 90, 120)
    love.graphics.line(-50, 50, -50, 150)
    love.graphics.line( 50, 50,  50, 150)
    love.graphics.line(-50, 50,  50, 50)
    love.graphics.pop()
end


It wasn't smooth sailing, though. To get here I had to fix bugs in Carousel's support for non-English keyboard layouts. Thanks to bug reports from Garvalf's azerty keyboard, I think I now understand the 'altGr' key. Other languages should be much improved as well, and while I was at it I also translated the menu buttons in all of Carousel's supported languages. If you try out Lua Carousel, please report bugs in your language and keyboard layout and help make it better.

---
My kids: what's a bug report?

Me: It's like having a pen pal. Except instead of talking about what the weather is like in distant parts of the world, you can talk about what other people's keyboard is like.

Files

carousel2-28-fr.love 424 kB
Apr 02, 2026
carousel2-28-en.love 419 kB
Apr 02, 2026
carousel2-28-de.love 424 kB
Apr 02, 2026
carousel2-28-es-LA.love 423 kB
Apr 02, 2026
carousel2-28-es-ES.love 422 kB
Apr 02, 2026
carousel2-28-pt.love 423 kB
Apr 02, 2026
carousel2-28-jp.love 15 MB
Apr 02, 2026
carousel2-28-zh-CN.love 24 MB
Apr 02, 2026

Get Lua Carousel

Leave a comment

Log in with itch.io to leave a comment.