表較短的方式所以基本上我有這樣的代碼,控制我的平臺(我想創建一個2D平臺遊戲的遊戲)的遊戲(Love2D LUA)這裏的腳本定義的平臺
platforms = {}
platform1 = { x = 0, y = 600, width = 279, height = 49 }
platform2 = { x = 279, y = 600, width = 279, height = 49 }
platform3 = { x = 558, y = 600, width = 279, height = 49 }
table.insert(platforms, platform1)
table.insert(platforms, platform2)
table.insert(platforms, platform3)
是有沒有更好的方法來控制/創建平臺?
如果Y也會改變怎麼辦?我應該輸入什麼內容'_',或者我應該輸入這個符號? – LostPuppy
@LostPuppy,'_'符號表示您只是忽略該變量。你不需要'{0,279,558}'表的'1,2,3'鍵 – slavanap