Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Alexintosh
Prole
Posts: 8
Joined: Mon Apr 04, 2011 11:18 am
Location: Italy
Contact:

Hi everybody,

I'm really new on game development so you'll see a lot of my messages in these days anyway i writing this post because I started yesterday to use LOVE and I just LOVE it but using it on ubuntu 9.0 the cpu always run about 100% and the temperature rise up to 90°

can anybody help?

Alexintosh

BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Welcome!

This may be because LOVE, by default, doesn't have a framerate cap; but then again, it doesn't do this on my computer. It could also be because you're doing some heavy duty processing; make sure you're not creating any resources in love.update or love.draw.

EDIT: By the way, what exactly is your avatar doing? I hope it's not what I think it is.

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

You can use love.timer.sleep to slow it down.

nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

BlackBulletIV wrote:EDIT: By the way, what exactly is your avatar doing? I hope it's not what I think it is.
If you're thinking it's wielding a chainsaw, then yeah, that's exactly what it's doing.

Alexintosh
Prole
Posts: 8
Joined: Mon Apr 04, 2011 11:18 am
Location: Italy
Contact:

BlackBulletIV wrote:Welcome!

This may be because LOVE, by default, doesn't have a framerate cap; but then again, it doesn't do this on my computer. It could also be because you're doing some heavy duty processing; make sure you're not creating any resources in love.update or love.draw.
How can I set the framerate??

I'm following this tutorial, so I use love.graphics.draw for any drawable object in a table may be this?
EDIT: By the way, what exactly is your avatar doing? I hope it's not what I think it is.
He was laughing , anyway to avoid problems i changed it.
You can use love.timer.sleep to slow it down.
Do you mean in the love.draw() function?

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Alexintosh wrote:How can I set the framerate??
You can't. You can aim for a certain framerate with love.time.sleep(), but it's imperfect.
Alexintosh wrote:I'm following this tutorial, so I use love.graphics.draw for any drawable object in a table may be this?
That particular tutorial has been criticised on this forum. Drawing things shouldn't cause problems like that.

Could you try running LÖVE without a game (you'll get the no-game screen) and tell us whether the same thing happens?

Also, could you upload a .love of your game to the forums, so we can look for clues there?
Alexintosh wrote:
You can use love.timer.sleep to slow it down.
Do you mean in the love.draw() function?
You can put it there, but traditionally, it's put at the end of love.update().

Trevor
Prole
Posts: 30
Joined: Thu Mar 31, 2011 4:14 pm

I'm glad you pointed this out. I didn't realize my CPU usage increases by 500% (from 10% to 50%) when I run my game. It runs at about 325 FPS. I'll give the sleep idea a try.

BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

The best way to attempt to set the framerate, is to redefine love.run and increase the amount of time slept at the end of the function (the love.timer.sleep call). You may to do something like:

Code: Select all

love.timer.sleep(1000 / 60) -- 60 FPS

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

But, as I said, it is imperfect.

Alexintosh
Prole
Posts: 8
Joined: Mon Apr 04, 2011 11:18 am
Location: Italy
Contact: