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

pong 0 #31

Open
Abhiab3012 opened this issue Apr 16, 2020 · 27 comments
Open

pong 0 #31

Abhiab3012 opened this issue Apr 16, 2020 · 27 comments

Comments

@Abhiab3012
Copy link

how to run pong 0 after writing code in visual studio code?

@MichaelVDubs
Copy link

You can look at the documentation on LOVE2d for that. Found here: https://love2d.org/wiki/Getting_Started

@Abhiab3012
Copy link
Author

i have facing problem showing
"
Error

main.lua:5: attempt to call field 'setmode' (a nil value)

Traceback

main.lua:5: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
"

@ghost
Copy link

ghost commented Apr 18, 2020

Facing the same problem of xpcall and the program isn't even running showing those problems above given by @Abhiab3012

@mpysys
Copy link

mpysys commented Apr 18, 2020

Facing the same issue here:
Error

boot.lua:577: Cannot load game at path.
Make sure a folder exists at the specified path.

Traceback

[C]: in function 'error'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

@Abhiab3012
Copy link
Author

we all would be glad if you help us to resolve this issue.kindly help ASAP.

@mpysys
Copy link

mpysys commented Apr 18, 2020

So, it seems that we downloaded a more recent version. If you read https://docs.cs50.net/games/2020/x/assignments/0/assignment0.html it will say that the correct version to use of LOVE is 0.10.2

@Abhiab3012
Copy link
Author

though i am facing this issue

Error: main.lua:5: attempt to call field 'setmode' (a nil value)
stack traceback:
main.lua:5: in function 'load'
[string "boot.lua"]:440: in function <[string "boot.lua"]:436>
[C]: in function 'xpcall'

@ghost
Copy link

ghost commented Apr 18, 2020

So can any1 help us all here ?
V need to learn n move forward instead of getting stuck n wasting our precious time!!!

@Kafeedos
Copy link

how to run pong 0 after writing code in visual studio code?

Download the love2D Support extension in visual studio code then Use ALT + L to run the code

@Abhiab3012
Copy link
Author

Abhiab3012 commented Apr 19, 2020

doing all things you've all told but
still facing same issue can any1 help us out?

@H4CKL0RD
Copy link

No i still face the same issue

@H4CKL0RD
Copy link

see
Error

main.lua:5: attempt to call field 'SetMode' (a nil value)

Traceback

main.lua:5: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'Error

main.lua:5: attempt to call field 'SetMode' (a nil value)

Traceback

main.lua:5: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'Error

main.lua:5: attempt to call field 'SetMode' (a nil value)

Traceback

main.lua:5: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

@H4CKL0RD
Copy link

i think we might have wrote the line incorrect it should be setMode

@H4CKL0RD
Copy link

yep it works

@H4CKL0RD
Copy link

image

@H4CKL0RD
Copy link

it works fine or you are using the wrong text editor

@H4CKL0RD
Copy link

i would recommend using Atom.io

@H4CKL0RD
Copy link

and i am using the most recent version

@ghost
Copy link

ghost commented Apr 20, 2020

@H4CKLORD how did u solve that problem can u explain properly it would be helpful

@Kafeedos
Copy link

though i am facing this issue

Error: main.lua:5: attempt to call field 'setmode' (a nil value)
stack traceback:
main.lua:5: in function 'load'
[string "boot.lua"]:440: in function <[string "boot.lua"]:436>
[C]: in function 'xpcall'

Notice the spelling of the "setMode", the only uppercase should be "M"

@Abhiab3012
Copy link
Author

@Kafeedos thankyou for your help

@gopalpendalwar
Copy link

gopalpendalwar commented Apr 25, 2020

@H4CKL0RD, or anyone else
can you please tell me the step by step process to run this pong-0 tutorial?

@yassin92827a
Copy link

I am facing this issue. Is there a way to solve it?

Error

Syntax error: main.lua:3: '=' expected near 'Pong'

Traceback

[C]: at 0x7ffafc2928f0
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

@tatkeller
Copy link

tatkeller commented May 17, 2020

I had this same problem. It seems like the proper way to run love is just to call "love .", but this might not work with versions >10.2 so a work around is renaming the folder with the main.lua file inside to "foo.love", and then you can run "love foo.love" in the command line. Works for latest version of love2d (11.3), and also for the previous version (10.2).

To be specific: in your cloned repo, rename the "pong-0" folder to "pong-0.love", and run "love pong-0.love". Should solve it. Later iterations of pong (1,2,etc) will give you an error but those are version related (love != 10.2). But again, the proper calling is "love ." within a folder

@kenaztynes
Copy link

WINDOW_WIDTH = 1280
WINDOW_HEIGHT = 720

--[[
Runs when the game first starts up, only once; used to initialize the game.
]]
function love.load()
love.window.setMode(WINDOW_WIDTH, WINDOW_HEIGHT, {
fullscreen = false,
resizable = false,
vsync = true
})
end

--[[
Called after update by LÖVE2D, used to draw anything to the screen, updated or otherwise.
]]
function love.draw()
love.graphics.printf(
'Hello Pong!', -- text to render
0, -- starting X (0 since we're going to center it based on width)
WINDOW_HEIGHT / 2 - 6, -- starting Y (halfway down the screen)
WINDOW_WIDTH, -- number of pixels to center within (the entire screen here)
'center') -- alignment mode, can be 'center', 'left', or 'right'
end

@kenaztynes
Copy link

What's the next step ?

@adimoraret
Copy link

@tatkeller love . also works with version 11.3

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