cannot understand the error in this code

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
kanika456
Prole
Posts: 1
Joined: Thu Jul 02, 2020 10:01 am

cannot understand the error in this code

Post by kanika456 »

push=require 'push'
WINDOW_WIDTH=1280
WINDOW_HEIGHT=720
VIRTUAL_WIDTH=432
VIRTUAL_HEIGHT=243
push:setupScreen(WINDOW_HEIGHT,WINDOW_WIDTH,VIRTUAL_HEIGHT,VIRTUAL_WIDTH,{fullscreen=true})
function love.draw()
push:apply('start')
love.graphics.printf('hello pong',0,VIRTUAL_HEIGHT/2-6,VIRTUAL_WIDTH,center)
push:apply('finish')
end


can someone tell me whats the problem in this?it is giving me errors while running it
User avatar
MadByte
Party member
Posts: 533
Joined: Fri May 03, 2013 6:42 pm
Location: Braunschweig, Germany

Re: cannot understand the error in this code

Post by MadByte »

Welcome to the forums.
Would be helpful to know the exact error message you got, keep it in mind next time.
What I can see is that you wrote center without "" (="center") to indicate it as string value which is needed for this argument.

Some more notes:
  • Make sure to use proper indention and spacing between values, this will help yourself and everyone who want's to help you with your future problems.
  • There is a "Support and Development" sub-forum which is more suitable for this kind of topics then the "General" sub-forum.
sphyrth
Party member
Posts: 260
Joined: Mon Jul 07, 2014 11:04 am
Contact:

Re: cannot understand the error in this code

Post by sphyrth »

Using the latest version of push.lua is the best advice we can give you.

I have to apologize. Everybody actually knows the drill. We're just tired of addressing it over and over again, although it's not your fault for following CS50.
hoistbypetard
Prole
Posts: 26
Joined: Fri May 22, 2020 7:00 pm

Re: cannot understand the error in this code

Post by hoistbypetard »

sphyrth wrote: Fri Jul 03, 2020 2:35 am Using the latest version of push.lua is the best advice we can give you.

I have to apologize. Everybody actually knows the drill. We're just tired of addressing it over and over again, although it's not your fault for following CS50.
As someone who is wrapping up CS50's GD50, I'd give a slight twist to that advice... just use LOVE 0.10.2 for those class exercises where you start with code that the instructor wrote. push is the one that everyone posts here about, but there are other subtle things lurking in assorted other libraries the exercises bundle in, and none of the LOVE-based exercises really need anything that's in 11.3.

If you choose to use LOVE2D for your final project, it's worth moving to 11.3 and also grabbing the current versions of knife, push, etc. But it's not, IMO, worth getting the exercises to work right on 11.3 unless you're planning to base something more interesting on those exercises.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests