mario-demo
mario-demo copied to clipboard
push.lua
anybody have this running the github lovedemo ? :
Error
push.lua:101: attempt to call field 'getPixelScale' (a nil value)
Traceback
push.lua:101: in function 'initValues' push.lua:48: in function 'setupScreen' main.lua:26: in function 'load' [C]: in function 'xpcall' [C]: in function 'xpcall'
the problem appears with löve 11.1 not with the previous version löve 0.10
yes because in love 0.11.1 'love.window.getPixelScale()' is replaced with 'love.window.getDPIScale()'. so open up push.lua in IDE and replace 'love.window.getPixelScale()' with 'love.window.getDPIScale()'.
Yes, then it starts without errors, but screen is all messed up (with 0.10.2 it all works fine).
So there have been more breaking changes between 0.10.2 and 11.1. Would be nice to know what else changed between versions (maybe the love.graphics.newQuad is also different?).
Initially you get a blank screen (scaled wrongly), but when resizing it becomes visible again but the empty blocks are not blue but white instead see screenshot.
Tweaked it a bit for love 11.2:
changing love.graphics.clear(108/255, 140/255, 255/255, 255/255) in main.lua makes background blue again and changing setPixelScale into getDPIScale avoids runtime errors. Still a grey border around the quads/tiles though and also starting in fullscreen or resizing draws ok but the initial screen is still messed op (seems zoomed in too far somehow, imho push.lua needs some more tweaks for it to work with latest love libs).
it does not work for me. still the same push.lua 101 error Any help.
You can find Love 0.10 here https://bitbucket.org/rude/love/downloads/
new in game development with lua . finally run this.
For those that want to make the effort of knowing what changed between Löve versions, the wiki offers a handy page for that: https://love2d.org/wiki/Version_History
Just update to the latest push.lua from the github page for new Love2d users! It worked for pretty fine after that for all the codes! I suppose it is push.lua v0.2 we're using with the code but for using with the new Love2d we need to have push.lua v0.4 Cheers! @blaisek