A lot of FPS agnosticism, added def lerp

This commit is contained in:
Maruno17
2023-05-20 18:37:54 +01:00
parent 62e372f4d7
commit d112e2361a
38 changed files with 619 additions and 628 deletions

View File

@@ -1298,11 +1298,11 @@ def pbAnimationsOrganiser
list.delete_at(cmd[1])
cmd[1] = [cmd[1], list.length - 1].min
refreshlist = true
pbWait(Graphics.frame_rate * 2 / 10)
pbWait(0.2)
when 4 # Insert spot
list.insert(cmd[1], PBAnimation.new)
refreshlist = true
pbWait(Graphics.frame_rate * 2 / 10)
pbWait(0.2)
when 0
cmd2 = pbMessage(_INTL("Save changes?"),
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)

View File

@@ -382,11 +382,11 @@ class MapScreenScene
end
def onClick(mapid, x, y)
if @lastclick > 0 && Graphics.frame_count - @lastclick < Graphics.frame_rate * 0.5
if @lastclick > 0 && System.uptime - @lastclick <= 0.5
onDoubleClick(mapid)
@lastclick = -1
else
@lastclick = Graphics.frame_count
@lastclick = System.uptime
if mapid >= 0
@dragging = true
@dragmapid = mapid

View File

@@ -248,7 +248,7 @@ class SpritePositioner
@sprites["info"].visible = true
ret = false
loop do
sprite.visible = (Graphics.frame_count % 16) < 12 # Flash the selected sprite
sprite.visible = ((System.uptime * 8).to_i % 4) < 3 # Flash the selected sprite
Graphics.update
Input.update
self.update