Search found 4 matches

by Dranzule
Sat Apr 23, 2022 6:05 pm
Forum: Support and Development
Topic: Issues with .setColor
Replies: 6
Views: 2569

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...
by Dranzule
Sat Apr 23, 2022 2:04 pm
Forum: Support and Development
Topic: Issues with .setColor
Replies: 6
Views: 2569

Re: Issues with .setColor

zorg wrote: Sat Apr 23, 2022 6:43 am The initial issue, according to the first code snippet posted, was that you were using `number = love.math.random(5, 5)` which gives you a random number between 5 and... 5
guess how many whole numbers are in that range.
Yeah sorry, I had changed that for testing and had not realized.
by Dranzule
Fri Apr 22, 2022 2:52 pm
Forum: Support and Development
Topic: Issues with .setColor
Replies: 6
Views: 2569

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...
by Dranzule
Fri Apr 22, 2022 12:29 pm
Forum: Support and Development
Topic: Issues with .setColor
Replies: 6
Views: 2569

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...