"Romans_I_XVI" wrote:
but the screen.DrawAll() would peak at about 18-20 milliseconds when the screen was full.
"Romans_I_XVI" wrote:
If you hold down a button (even if my game is not designed to do any action with that button, * for instance) it will cause the fps to drop
"TheEndless" wrote:
As long as you're able to accomplish ~20fps (~50ms), and your animation is time based and not frame based (i.e., objects move at the same distance in the same amount of time regardless of framerate)
"Romans_I_XVI" wrote:
Do you have a suggestion/example of how to go about switching the sprite movement to time based instead of frame based? I would appreciate it very much. I am kinda excited now, because if I fix this I think it will actually run very smooth.
Function LinearTween(start As Integer, finish As Integer, currentTime As Integer, duration As Integer) As Integer
If currentTime > duration Then Return finish
change = finish - start
time = currentTime / duration
Return change * time + start
End Function
Function move_enemy_1()
removed = -1
for each item in m.spr_enemy_1
y = item.GetY()+m.enemy_1_speed
item.MoveTo(item.GetX(), y)
if y > 740
removed = removed+1
end if
end for
if removed > -1
for r = 0 to removed
m.spr_enemy_1[0].Remove()
m.spr_enemy_1.Shift()
end for
end if
End Function
newY = LinearTween(0, 100, timer.TotalMilliseconds(), 5000)
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
Thanks for your patience — we’re excited to share what’s next!