Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Great atmosphere created for such simple graphics and a cool idea too! I see your observation about timing things with the music on a web build. I had a similar problem when I made Carol of the Bells (not a 3-hour game!). The way I solved it is to forget about delta time altogether. Instead, I used:

  • The projectile's starting position
  • The projectile's finishing position
  • A timestamp of when the projectile started
  • A timestamp of when the projectile was supposed to arrive at the destination

With these four variables I could calculate the position each frame by getting a ratio using Time.time in relation to the start/end time and then lerping that between the start/finish positions. Doing it this way means it doesn't matter how many FPS you're on, or what delta time works out to be, because you're recalculating based on the current time each frame.

Hope this helps!

(1 edit) (+1)

Thanks! The upload version is already not using Delta time, it's actually using the music time itself to calculate the position, pretty much in the way you mentioned. The issue is more complex: on web, the audio gets buffered by the browser, so what godot register is actually not what we are hearing, because it must go through the browser first. After the submissions I tried some workarounds using javascript and trying to incorporate direct communication with the browser on the game, but things were just getting too complex and messy, and I just took the L haha