Spoiler
Hello,
since I am a noob at lua and I suck at error fixing, I was hoping for someone a bit more experienced to help me with an error I keep getting. I'm trying to make a simple 'shooter'-ish game (like Space Invaders but simpler). So far I've got the key-handling code and the 'ship-drawing code':
Sorry for the potential noobieness, I tried my best
/>
When I try to run this code/program/derp, the console throws the following error:
bios:328: [string "shooter"]:20: '=' expected -- (the program's name is 'shooter' by the way)
I can't seem to find the solution to this, so I'm hoping anyone can help me.
Thanks in advance!
~Username
Hello,
since I am a noob at lua and I suck at error fixing, I was hoping for someone a bit more experienced to help me with an error I keep getting. I'm trying to make a simple 'shooter'-ish game (like Space Invaders but simpler). So far I've got the key-handling code and the 'ship-drawing code':
local w,h = term.getSize()
local pos = 1
function handleKeys()
local type,key = os.pullEvent()
if key == 203 then
if pos > 2 then
pos = pos-1
end
end
if key == 205 then
if pos < (w-2) then
pos = pos+1
end
end
end
funtion drawShip()
term.setCursorPos((pos,h)
write(" | nooo") -- not 'noooo' but <newline>ooo (it should represent a simple shooter thingy)
end
while true do
term.clear()
handleKeys()
drawShip()
end
Sorry for the potential noobieness, I tried my best
When I try to run this code/program/derp, the console throws the following error:
bios:328: [string "shooter"]:20: '=' expected -- (the program's name is 'shooter' by the way)
I can't seem to find the solution to this, so I'm hoping anyone can help me.
Thanks in advance!
~Username
Nevermind, I think I am going to study Lua for the next 10 years so I'll be able to program a decent application or game.












