What does the "function argument expected near 'blah blah'" mean? And what code would I use to make 'script.lua' (My loading screen) read 'game.lua'? (The actual game code)
Printable View
What does the "function argument expected near 'blah blah'" mean? And what code would I use to make 'script.lua' (My loading screen) read 'game.lua'? (The actual game code)
Why not just make your entire loading screen file a function? Then you could condense it into one LUA file. If you can't do that for some reason, the comand would be dofile("game.lua")Zitat:
Zitat von MaSt3r_ShAk3
Good idea... But I need to know what the error means before I can get anyhere =/
Give the exact error.
Well im on my PSP but it wasCode:Function argument expected near 'while'
whats your while command look like..an example could be...
while something == something do
code here
end
make sure you just dont have something like
while do
whereas ..
while true do ... would work
Soadnation, what line is the error in?
Also, do you get the error when you leave in the comparisation of the highscore and your score, or only when you put in the save and load function?
could someone please explain how io.input and io.output are used?
I've got io.output("highscore.txt" ) ... what do I need to put to make it write a variable (score) to the text file?
then what would I have to put after io.input in order to read the score from the text file and display it on screen/
hey PSPHax0r9, I have an idea for a game but I'm just learning Lua so can you give me a bit of code to get me started? I want a simple little game that there are 3 constantly bouncing balls that when you press a trigger, you can select one and move it right or left. I need some help. How do you make it so you can switch between them and how can you make them bounce constantly. Those are my main issues. Help would be appreciated. Thank you!
Heres my code so far (besides the loading screen, combining scripts later)Zitat:
Zitat von PSPMillionaire
Code:black=Color.new(0, 0, 0)
player={}
player[1]={x=240, y=250}
screenwidth=480 - player:width
while true do
screen:blit(0, 0, background, false)
screen:blit(player[1].x,player[1].y,player)
for a=0,10 do
for b=0,0 do
screen:blit(45*a, 45*b, spike)
end
end
pad = Controls.read()
screen:clear()
if pad:left() then
player[1].x = player.x - 2
end
if pad:right() then
player[1].x = player.x + 2
end
screen.waitVblankStart()
screen.flip()
end