So this is really simple, I only have a little bit of code:
import "CoreLibs/graphics"
import "CoreLibs/object"
import "CoreLibs/sprites"
import "CoreLibs/nineslice"
import "CoreLibs/timer"
import "CoreLibs/frameTimer"
import "config"
import "core/definitions"
import "core/cotton/all"
import "scripts/index"
import "core/lieb/all"
import "core/CoreGame"
playdate.display.setRefreshRate(50)
bpm = 60;
function addCircle()
playdate.graphics.drawCircleAtPoint(math.random(400), math.random(240), 10)
end
function playdate.update()
input.update()
scene.update()
playdate.timer.performAfterDelay(60000 / bpm, addCircle)
playdate.timer.updateTimers()
end
BTW the "config" files and stuff are because I'm using Cotton (it's on github its super helpful and lets you use ltdk and stuff). I'm not actually using LTdk, I'm just using Cotton because it has a good template for games, but ANYWAYS: I'm trying to call the addCircle() function ONCE every beat (haven't added the music yet but the BPM variable exists), but playdate.timer.performAfterDelay() still calls it every frame, just starts later. I'm wondering how to change that?