Forums Archived

The forums are being archived. See this topic for more information.

Rubygame::Clock#_accurate_delay

Get help and support with Rubygame

Rubygame::Clock#_accurate_delay

Postby red » Thu Dec 30, 2010 6:39 pm

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?
red
 
Posts: 7
Joined: Thu Dec 30, 2010 6:26 pm

Re: Rubygame::Clock#_accurate_delay

Postby red » Thu Dec 30, 2010 8:55 pm

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
red
 
Posts: 7
Joined: Thu Dec 30, 2010 6:26 pm


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 0 guests

cron