Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Love: Pong 2 and beyond #22

Open
VoidGamer220 opened this issue Jun 30, 2019 · 13 comments
Open

Problem with Love: Pong 2 and beyond #22

VoidGamer220 opened this issue Jun 30, 2019 · 13 comments

Comments

@VoidGamer220
Copy link

I was greeted with the following upon running Pong 2:

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:49: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

I ran the other pongs and only pong1 and pong0 are unaffected. It seems to be a problem with getPixelScale, perhaps the system has changed so that this part of the code is less viable?

@evertoncrespin
Copy link

Had the same problem, what happens is that 'getPixelScale' ceased to exist in love above version 0.9. So if you are using a version higher than 0.9, (you probablly got version 11.x) you should use 'getDPIScale'.

I did a full "Replace all" on this function using vscode and had no problems with this function anymore.

Another problem that i had was about #8, wich thankfully @09jlardinois already found an answer and I didn't have to dig around for days to find a solution like him.

See love2d wiki on "Renamed APIs" section

@phervas
Copy link

phervas commented Apr 15, 2020

Hi, maybe you need to update push.lua to the latest version -> v0.4
https://github.com/Ulydev/push/blob/master/push.lua

I have another issue with a completely white screen with nothing on it

@Fiain
Copy link

Fiain commented Apr 16, 2020

I get the same issue @phervas as I've updated the push.lua
and then sorted the error with 'getPixelScale' substituting 'getDPIScale'
Now all I have is white screen

@phervas
Copy link

phervas commented Apr 16, 2020

Hi @Fiain, apparently there was a change in Love somebody mentioned at some other post. What worked for me was do divide the first 3 values at love.graphics.clear by 255:

love.graphics.clear(40/255, 45/255, 52/255, 255)

@JordiCorbilla
Copy link

I can confirm that the solution works. Just upgraded to Love 11.3, push.lua v0.4 and changed the following line in the code and I got back the rendering instead of the white screen:

love.graphics.clear(40/255, 45/255, 52/255, 255/255)

image

@srisowmya2000
Copy link

I have tried this one love.graphics.clear(40/255, 45/255, 52/255, 255/255) and got it but the other issue is I am not able to see the ball and the second paddle.

Screenshot 2020-04-28 at 2 23 46 PM

@srisowmya2000
Copy link

my code is
Screenshot 2020-04-28 at 2 29 15 PM

@Yaugan
Copy link

Yaugan commented Apr 30, 2020

@srisowmya2000 in the love.graphics.clear function just do this and it will work:

love.graphics.clear(40/255, 45/255, 52/255, 255)

and similarly in the love.graphics.printf:

love.graphics.printf('Hello Pong!', 0, 20, VIRTUAL_WIDTH, 'center')

you aren't able to see the right paddle and ball as you are rendering only half the virtual width minus 6 dimensions whereas your ball and right paddle are being placed in the non-rendered area

@srisowmya2000
Copy link

@Yaugan thanks for helping me out. But I still am getting an error.
Screenshot 2020-05-10 at 9 35 31 AM

@Sid85-vit
Copy link

Thanks evertoncrespin. It works

@priyam23g
Copy link

@srisowmya2000 use this push file made by @phervas
https://github.com/Ulydev/push/blob/master/push.lua
it works!!

@iamRezzy
Copy link

i stilll am getting a white screen with FPS

@iamRezzy
Copy link

for which file do we change this in @phervas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants