DAMMIT SAKURAI! NOW I HAVE TO ADD MORE LINES OF CODE TO THE GAME THAT I'M ALREADY BURNT OUT ON!

invidious.poast.org/watch?v=Od

Freeze frames are probably something I can do, but no way in hell am I doing screen shakes or slow motion. Screen shakes would require me to mess with viewports and I really don't feel like getting in to that. Slow motion would require me to either reduce the framerate (which I don't know how to do in MonoGame) or slow down every single object.

@xianc78 Are you not managing changes in the game relative to a dt? Having your logic advance statically per frame isn't a good idea

Monogame should be giving you something like an update(dt) callback that gives you the deltatime (time since last frame, rendering + vsync)

All you have to do for slow motion is to have a multiplier for it

player.x = player.x + (player.velocity * player.speed * dt * speed)

Follow

@xianc78 >Having your logic advance statically per frame isn't a good idea

Specifically, either you told monogame the exact framerate it should have or you're relying on undefined behaviour. It might play at 2x or 0.5x speed on someone elses system with 30hz or 120hz screens

If you do manually specify it then it's wasting resources or is artificially laggy, plus possible artifacts like screen tear

>player.x = player.x + (player.velocity * player.speed * dt * speed)

Well, rather you'd have something like

local speed = 1
function mono.update(dt)
dt = dt * speed
player:update(dt)
enemies:update(dt)
...
end

So, you're either using a system where it's really easy to add slowmotion or you have a bad system (prolly, I'm making assumptions)

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Game Liberty Mastodon

Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.