can someone tell we what's wrong with this please?
I tried making a quick game as a joke and It won't work.
I read quick guide and built it around what it said, and whenever I try launching it in luaplayer it says that there is no script file found. I tried saving it as both script.lua and index.lua. any help appreciated.
Code:
pimppicture=Image.load("pics/pimp.png")
kidpicture=Image.load("pics/kid.png")
mom=Image.load("pics/mom.png")
background=Image.load("pics/background.png")
winner=Image.load("pics/winner.png")
loser=Image.load("pics/loser.png")
distance=nul
timer=1
pimp=430
kid=300
while true do
timer=1
screen:clear()
pad=Controls.read()
if pad:cross() then
kid=kid-2
end
kid=kid-.5
pimp=pimp-.5
if kid=40 then
while timer=1
pad=Controls.read()
screen:blit(0, 0, winner)
screen.flip()
if pad:cross() then
timer=2
end
end
end
distance=kid+30
if pimp=distance then
while timer=1
pad=Controls.read()
screen.blit(1, 1, loser)
screen.flip()
if pad:cross() then
timer=2
end
end
end
screen.blit(0, 0, background)
screen.blit(0, 100, mom)
screen.blit(kid, 100, kidpicture)
screen.blit(pimp, 100, pimppicture)
screen.flip()
end
I wanted to make it so that you had to press the cross button really fast to move the kid over to the "mom" befoe the pimp catches him and shanks him.