rem HUD and UI: a health bar - OpenDBC tutorial (DarkBASIC Classic) sync on : sync rate 60 autocam off color backdrop rgb(20, 24, 40) make object cube 1, 10 color object 1, rgb(90, 200, 255) position camera 0, 8, -30 point camera 0, 0, 0 health = 100 do yrotate object 1, wrapvalue(object angle y(1) + 1) health = health - 1 if health < 0 then health = 100 ink rgb(255, 255, 255), 0 text 20, 16, "HEALTH" ink rgb(40, 40, 60), 0 box 100, 18, 302, 36 if health > 30 then ink rgb(80, 220, 120), 0 else ink rgb(240, 70, 60), 0 box 101, 19, 101 + health * 2, 35 sync loop