| View previous topic :: View next topic |
| Author |
Message |
worldspawn
Joined: 17 Jul 2005 Posts: 4
|
Posted: Mon Sep 05, 2005 3:58 am Post subject: Error in code |
|
|
I'm getting this error with the code below:
error: script.lua4: attempt to call global 'pidle' (a nil value)
I've been coding for about 4 months in Visual Basic.. Lua seems like an easy language, but I'm still learning. Bear with me. =]
| Code: | -- Animation Test
-- variables
pidle {}
-- graphics
pidle[1] = Image.load("gfx/pidle1.png")
pidle[2] = Image.load("gfx/pidle2.png")
pidle[3] = Image.load("gfx/pidle3.png")
pidle[4] = Image.load("gfx/pidle4.png")
pidle[5] = Image.load("gfx/pidle5.png")
-- animation
while true do
for x=1,5 do
screen:blit(200, 100, pidle[x])
screen:flip()
screen.waitVblankStart(3)
end
end
|
|
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Mon Sep 05, 2005 4:14 am Post subject: |
|
|
The fourth line should be:
This way is to let Lua recognize pidle as a table. _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
worldspawn
Joined: 17 Jul 2005 Posts: 4
|
Posted: Mon Sep 05, 2005 4:36 am Post subject: |
|
|
Thanks a bunch!
Ah man.. I should have seen that. Heh. |
|
| Back to top |
|
 |
|