Balloon Adventure

Show off your games, demos and other (playable) creations.
User avatar
BoonyBuny
Prole
Posts: 31
Joined: Mon Jun 13, 2022 1:24 am
Location: France
Contact:

Re: Balloon Adventure

Post 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
A coding begginer that is migrating from 8 years of Scratch... yea yikes. :emo:
Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests