我想自学编程,我认为pico-8非常适合我,但我真的很困惑,因为在第13行只有_update函数……我怎么搞砸了?
语法错误是,第13行(制表符0)处的未关闭函数
local guy_x
local guy_y
-- lua scripting language
function _init()
-- all the code that happens
-- when the cart is firt run
guy_x=64
guy_y=64
end
function _update()
-- all the code that
-- updates the game state
if btn(1) then
guy_x+=1
end
function _draw()
-- all the code that
-- drwas thing to the screen
cls() -- clears screen!
rect(10,20,100,60,12) -- draws a blue rectangle
-- rect(x1,y1,x2,y2,color)
circ(20,20,20,14) -- draws a pink circle
pset(90,50,9) -- draws one pixel
rectfill(85,50,90,40,9)
circfill(guy_x,guy_y,5,9)
-- circfill(x,y,radius,color
end发布于 2021-11-11 00:43:41
好吧,nvm我真的很愚蠢我只是忘了在if btn(1)then guy_x+=1之后写end
已修复:
function _update()
-- all the code that
-- updates the game state
if btn(1) then
guy_x+=1
end
endhttps://stackoverflow.com/questions/69921858
复制相似问题