Search found 472 matches

by milon
Wed Aug 17, 2022 5:50 pm
Forum: General
Topic: About the love.load function
Replies: 6
Views: 2205

Re: About the love.load function

Personally, I either don't use love.load at all, or else I use it as pgimeno stated - declare things at the top of main.lua, and assign them elsewhere. Helps me keep my code clean(ish).
by milon
Wed Aug 17, 2022 5:46 pm
Forum: Support and Development
Topic: Random Generation map error on Mobile
Replies: 14
Views: 3209

Re: Random Generation map error on Mobile

And anyone knows if thats better use love.window.getSafeArea( ) instead of love.graphics.getWidth()/Height()? safex, safey, safew, safeh = love.window.getSafeArea( ) screensizex=safew screensizey=safeh For desktop, there's absolutely no difference. On some mobile devices there's no difference. It w...
by milon
Tue Aug 16, 2022 6:30 pm
Forum: Support and Development
Topic: Random Generation map error on Mobile
Replies: 14
Views: 3209

Re: Random Generation map error on Mobile

darkfrei wrote: Tue Aug 16, 2022 5:00 pm No, math.random is better ...
How so? My impression is the exact opposite (although they're both generally fine depending on application).
by milon
Fri Aug 12, 2022 6:21 pm
Forum: Games and Creations
Topic: Exemplar(Release)
Replies: 2
Views: 3203

Re: Exemplar(Release)

The Itch link is currently broken, FYI
by milon
Thu Aug 11, 2022 1:50 pm
Forum: Support and Development
Topic: Images
Replies: 4
Views: 2477

Re: Images

How do i put images in my thing (not game yet), i make sure the name is right and... i'm not very sure about the code, here is it For ease of readability on the forums, you can use [ code ] tags like this: function love.load() frame = newPaddedImage("frame_up.png") x = 0 y = 0 mv = 10 end...
by milon
Mon Aug 08, 2022 5:48 pm
Forum: Support and Development
Topic: variables updated but not in love.graphics.rectangle
Replies: 3
Views: 1725

Re: variables updated but not in love.graphics.rectangle

No worries! And you're welcome. I've had plenty of those moments myself - we all have! :)
by milon
Mon Aug 08, 2022 5:43 pm
Forum: Support and Development
Topic: advertizements in google play help
Replies: 2
Views: 1561

Re: advertizements in google play help

You probably want a library to handle that for you:
viewtopic.php?f=5&t=84226
by milon
Mon Aug 08, 2022 5:38 pm
Forum: Support and Development
Topic: Is there any best way to create pause game feature??
Replies: 2
Views: 2041

Re: Is there any best way to create pause game feature??

If you don't want a lot of if/else structuring, then it's time to start implementing state machines.

Also, why is love.keypressed() defined inside of love.update()? It really should be its own separate function IMO.
by milon
Mon Aug 08, 2022 5:31 pm
Forum: Support and Development
Topic: variables updated but not in love.graphics.rectangle
Replies: 3
Views: 1725

Re: variables updated but not in love.graphics.rectangle

I does stop at the edge though, with no visible gap. If you want a black buffer around the rectangle, modify love.update to something like this:

Code: Select all

function love.update(dt)
    if w < width-x*2 then
        w = w + 1
    end
    if h < height-y*2 then
        h = h + 1
    end
end
by milon
Fri Aug 05, 2022 5:42 pm
Forum: General
Topic: Efficient way of distributing items
Replies: 11
Views: 3721

Re: Efficient way of distributing items

Suppose you have 2 item with same rarity, like this: weapons[1] = {name = "super_sword_gun", rarity = 5, ...} weapons[2] = {name = "super_plasma_gun", rarity = 5, ...} If you pick random number smaller < 5, the for loop will always return "super_sword_gun" as it is che...