function love.load()
pj = 0
px = 30 -- Start Pos
py = 60 -- Start Pos
phygrav = 0.50 -- Gravity Pull
phyground = 61 -- Ground Location
pgraphic = love.graphics.newImage("p_graphic.bmp")
end
function love.update(dt)
if love.keyboard.isDown("a") then
px = px - 0.70
elseif love.keyboard.isDown("d") then
px = px + 0.70
elseif love.keyboard.isDown("w") then
print "jump attempt"
if pj = 0 then <------------ Problem Starts Here
py = py - 6
pj = 1
end
end
if py < 60 then
py = py - phygrav
elseif py >= 60 then
pj = 0
end
end
function love.draw()
love.graphics.draw(pgraphic, px, py)
end
Error: Syntax error: main.lua:20: 'then' expected near '='
stack traceback:
[C]: at 0x7ff82aed3af0
[C]: in function 'require'
[string "boot.lua"]:429: in function <[string "boot.lua"]:275>
[C]: in function 'xpcall'