Home ← TI-Nspire Authoring ← Lua Scripting HQ ← Lua and JavaScript
Todo: - Image support - Font size support - Physics support - Toolpallete support - Clipboard - D2Editor - coroutine (possibly not possible) - string functions - keyboard improvements
platform.apilevel = 2.0platform.apilevel = 2.0-- Cameron Harris @ ImperialMatrix.comlocal wlocal hlocal runningSimlocal timerCountlocal simOverlocal ratio5local xPointslocal yPointslocal pointIndexlocal clockArclocal displayTimelocal pointXlocal pointYlocal ratiolocal hummingbirdlocal Birdyfunction init(gc)w = platform.window:width()h = platform.window:height()runningSim = 0timerCount = 0simOver = 0ratio = (w/h)*5xPoints = {}yPoints = {}pointIndex = 1clockArc = 0displayTime = 0pointX = w*(10/64)pointY = h*(27/32)Birdy = Bird(w*(1/4),h*(1/4),0)timer.start(1/15)on.paint = paintpaint(gc)endfunction on.timer()if timerCount == 60 thenrunningSim = 0timerCount = 0simOver = 1clockArc = 0end--end if to stop sim once 4 sec have elapsed