Hi all
Today I tested my game on a friend’s computer, and it appears that the computer in question is far more powerful than mine
On my computer:
On his computer:
I don’t have any gameplay footage to show the visual result, but the characters were moving way faster (while the spine animation seemed to remain the same).
It’s been a while, but… it seems like I’m using something called “Metrics” (?) to display the FPS.
The code looks like this:
function init(self)
self.instance = fps.create(self.samples, nil, go.get_world_position(), self.color)
end
function update(self, dt)
self.instance.update()
if self.show then
self.instance.draw()
end
fps.update()
debug.fps = lume.round(fps.fps(), 1)
end
And for the the characters movements:
function update(self, dt)
local p, movement = go.get_world_position(), self.move_direction * self.move_speed_cur * move_speed_factor
go.set_position(p + movement)
end
1/ Is it possible to prevent the game from going beyond 60fps?
2/ And most of all, how to make sure the character movements don’t depend on the fps? (so they don’t move slowly at 30fps and super fast at 120fps)