Corona 是一個跨手機平台的SDK, 有免費版及付費版. 若你打算上架App Store, 就一定要用付費版. 官網
理論上可以用在商業程式或遊戲, 看過API後我認為比較偏遊戲開發.
Corona用的是Lua language, 是一種直譯語言, 在遊戲界應該尚算流行. 弱型別語言, 可以用類似物件導向的寫法, 但我覺得還是偏非物件導向, 要封裝及傳遞變數並不是很直覺.
開發環境我是用LDT, 設定上不算複雜, 但也繼承了一些Eclipse的毛病, 總是會遇到問題. 設定方法如下
1) Add a new interpreter for corona simulator in the Lua/interpreter preference page by selecting "add" and selecting the Corona Simulator executable as Interpreter executable, adding "-debug" to "Interpreter arguments" and uncheck the option "Accept -e as argument". 2) You should still add the following code at the begging of your project: if (system.getInfo("environment")=="simulator") then require("debugger")() end 3) Copy the debugger.lua file by clicking on the top menu "Run/Debug Configuration" and then create a "Lua Attach to application" launch configuration and click on the link "Lua Debbuger Client" and select "Corona SDK/Ressources" folder. 4) Then go to top menu "Run/Debug Configuration" and create a "Lua Application" launch configuration which will use the created Corona interpreter as runtime interpreter and launch it in debug mode.
啟動LDT時記得用管理員權限, 不然你做上面4 steps時會有問題
UPDATE : Corona Editor 1.0 已推出, 自動完成功能 樂勝
每一個程式都要有main.lua, 裡面的variable 雖然用local宣告, 但我看文件覺得那其實是global. 因為Lua不需要main function, 所以main.lua裡的local, 其實整個main都可以用得到.
至於其他檔案看不看得到?要怎樣定義類別及分檔案?這就是我覺得lua很不物件導向的原因, part 2再續…
You must be logged in to post a comment.