10.12.2009, 15:43
Hallo,
ich versuche gerade lua zu lernen. Ich habe mich nun bereits an das Malproggi von bumuckl gewagt, doch das klappt bei mir nicht.
kann vlt jmd gucken, ob er den fehler findet?
weis = Color.new(255,255,255)
schwarz = Color.new(0,0,0)
malflaeche = Image.createEmpty(480,272)
malflaeche:clear(weis)
cursor = image.load("Cursor.png")
cursor_x = 100
cursor_y = 100
while true do
pad = controls.read()
dx = pad:analogX()
dy = pad:analogY()
if dx > 30 then
cursor_x = cursor_x + (math.abs(pad:analogX())/64)
end
if dx < -30 then
cursor_x = cursor_x - (math.abs(pad:analogX())/64)
end
if dy > 30 then
cursor_y = cursor_y + (math.abs(pad:analogY())/64)
end
if dy > -30 then
cursor_y = cursor_y - (math.abs(pad:analogY())/64)
end
screen:blit(0,0,malflaeche)
screen:blit(cursor_x, cursor_y, cursor, true)
if pad:cross() then
malflaecherawline(cursor_x, cursor_y, cursor_x, cursor_y,schwarz)
end
screen.flip()
scren.waitVblankstart()
end
wenn ich das(mit lua player hm7) starte kommt: attempt to index global ´image´ (a nil value)
Bitte helft mir.
Gruß
ich versuche gerade lua zu lernen. Ich habe mich nun bereits an das Malproggi von bumuckl gewagt, doch das klappt bei mir nicht.
kann vlt jmd gucken, ob er den fehler findet?
weis = Color.new(255,255,255)
schwarz = Color.new(0,0,0)
malflaeche = Image.createEmpty(480,272)
malflaeche:clear(weis)
cursor = image.load("Cursor.png")
cursor_x = 100
cursor_y = 100
while true do
pad = controls.read()
dx = pad:analogX()
dy = pad:analogY()
if dx > 30 then
cursor_x = cursor_x + (math.abs(pad:analogX())/64)
end
if dx < -30 then
cursor_x = cursor_x - (math.abs(pad:analogX())/64)
end
if dy > 30 then
cursor_y = cursor_y + (math.abs(pad:analogY())/64)
end
if dy > -30 then
cursor_y = cursor_y - (math.abs(pad:analogY())/64)
end
screen:blit(0,0,malflaeche)
screen:blit(cursor_x, cursor_y, cursor, true)
if pad:cross() then
malflaecherawline(cursor_x, cursor_y, cursor_x, cursor_y,schwarz)
end
screen.flip()
scren.waitVblankstart()
end
wenn ich das(mit lua player hm7) starte kommt: attempt to index global ´image´ (a nil value)
Bitte helft mir.
Gruß