I don't have much to say, but I've created a tunnel game. Unfortunately, you have to move it by a certain number of pixels, rather than it being smooth.

Also, one thing I added while making the game was adding error catching code. The error showed here was induced by me adding an extra line of code, and isnt actually a real error in the game:
Looks nice! Would you mind posting how you implemented the error catching? I have never worked with error catching stuff in lua before, and it'd be nice to see how you handled it.
There are two ways to have error catching in ti nspire lua.
You can use pcall(funtion) and have it work like a try catch statement in lua. It returns true if there were no errors, and otherwise it returns false. Thus can do something like this:


if pcall(function) then
--no errors, keep going
--handle errors

The other way to do it only works in ti nspire lua(as far as I am aware).
You can use something of the form


   handleError(l, e)
   return true

Essentially you just set the function to run in the case of an error. It returns true if you want the code to keep running, and otherwise it returns false.
The function recieves up to four values. The first is linenumber, then the error message(which includes the line numer in it), then the callstack, and then locals.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum