local M = {}

local flashInterval = 0.45  
local timeElapsed = 0      
local isFlashing = false   

local function updateGFX(dt)
    local engineRunning = electrics.values.running 

    timeElapsed = timeElapsed + dt

    if engineRunning then

        if timeElapsed >= flashInterval then
            isFlashing = not isFlashing  
            electrics.values.SeatbeltLight = isFlashing and 1 or 0  
            timeElapsed = 0 
        end
    else
        electrics.values.SeatbeltLight = 0
        isFlashing = false
        timeElapsed = 0  
    end
end

M.updateGFX = updateGFX

return M
