Obiekt1x = 20
Obiekt2y = 20
Obiekt2x = 60
Obiekt2y = 60
Kwadrat1 = Image.load("kwadrat1.png")
Kwadrat2 = Image.load("kwadrat2.png")
Tlo = Color.new(0,255,0)
screen:clear(tlo)
while true do
screen:blit(Obiekt1x, Obiekt1y, Kwadrat1)
screen:blit(Obiekt2x, Obiekt2y, Kwadrat2)
Pad = Controls.read()
if Pad : Up() then Obiekt1y = Obiekt1y - 5 end
if Pad : Down() then Obiekt1y = Obiekt1y + 5 end
if Pad : Left() then Obiekt1x = Obiekt1x - 5 end
if Pad : Right() then Obiekt1x = Obiekt1x + 5 end
if Pad : Triangle() then Obiekt2y = Obiek2y - 5 end
if Pad : Cross() then Obiekt2y = Obiekt2y + 5 end
if Pad : Square() then Obiekt2x = Obiekt2x - 5 end
if Pad : Circle() then Obiekt2x = Obiekt2x + 5 end
screen:flip()
screen.waitVblankStart()
end
Zrobiłem taki oto program, kompilator wywala mi dwa błędy:
inedx.lua attempt to index global 'Image' (a nil value)
index.lua bad argument #1 to 'blit' (number expected, got nil)