Search found 4 matches
- Sat Apr 23, 2022 6:05 pm
- Forum: Support and Development
- Topic: Issues with .setColor
- Replies: 6
- Views: 2706
Re: Issues with .setColor
Your solution puts an if case for a neverchanging value inside a frame. Thats 60 times per seconds requesting if true stays true, its a waste of cpu. You should instead define a colour in the load process.: isHungry = {1,0,0} love.graphics.setColor(ishungry) Although on luajit the impact is minimal...
- Sat Apr 23, 2022 2:04 pm
- Forum: Support and Development
- Topic: Issues with .setColor
- Replies: 6
- Views: 2706
Re: Issues with .setColor
Yeah sorry, I had changed that for testing and had not realized.
- Fri Apr 22, 2022 2:52 pm
- Forum: Support and Development
- Topic: Issues with .setColor
- Replies: 6
- Views: 2706
Re: Issues with .setColor
Found the solution to the problem. Don't think it's the most optimized, but it will work with no issues. function love.load() isHungry = determineHunger() gameFont = love.graphics.newFont(25) end function determineHunger() number = love.math.random(0, 5) if number == 5 then return true else return f...
- Fri Apr 22, 2022 12:29 pm
- Forum: Support and Development
- Topic: Issues with .setColor
- Replies: 6
- Views: 2706
Issues with .setColor
Hello. I'm trying to make a simple application which, when run, will render a cube as well as a simple text on the top right of the screen. That cube is supposed to have a 1/5 chance of being red(instead of orange). I'm somewhat of a beginner, so sorry if this is kinda obvious. Here's the piece of c...