Page 2 of 2

Re: Balloon Adventure

Posted: Sat Jul 02, 2022 8:12 pm
by BoonyBuny
pgimeno wrote: Sat Jul 02, 2022 6:00 pm Well, a quick and dirty solution that worked for me was to add this at the beginning of love.draw():

Code: Select all

  local scale = math.min(love.graphics.getWidth()/1920, love.graphics.getHeight()/1080)
  love.graphics.scale(scale)
Also, making the window resizeable should be no problem.

I've taken a quick look into the code because the first time I press F11 it does nothing. That's because of a problem with the scope of a variable. You declare fullscreen as local inside love.load(), and then use it in love.keypressed, but since it's local to love.load, what love.keypressed actually accesses is the global variable fullscreen, which defaults to nil which is equivalent to false when negated. The fix is to move it from love.load to the top of the file:

Code: Select all

local fullscreen, fstype = true, "desktop"

function love.load()
    love.window.setFullscreen(fullscreen, fstype)
    ...
At least I could play. It's quite difficult, I could only collect 1 coin :)
thanks for that juicy info, and glad you could run the game lol, it's difficult because i was inspired by Flappy Bird