Page 1 of 1

Rubygame::Clock#_accurate_delay

PostPosted: Thu Dec 30, 2010 6:39 pm
by red
The game laggs.
ruby -rprofile gives me results that show (look title) wasting almost 30% of running time.

I only have one @clock.tick in main loop.

Code: Select all
def run
   loop do
­      update
­      draw
­      @clock.tick
­   end
end

this thing does everything.
In main class initialize I have these:
Code: Select all
@clock = Rubygame::Clock.new
@clock.target_framerate 60



Also. SDL.Flip and SDL.BlitSurface seem to be a bit slow. Is there any way to use some other libraries exclusively to render stuff onto the screen?

Re: Rubygame::Clock#_accurate_delay

PostPosted: Thu Dec 30, 2010 8:55 pm
by red
after computer restart everything seems to be working perfectly fine
I even managed to keep 600 little pixart pumpkins on the moving screen ( calculating the position for each so they stay in the same spot and the camera is the one moving) with a 1366 x 768 px background without any major frame drops Oo