Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: devpolytechnic on September 25, 2011, 08:50:49 am

Title: Те́трис, anyone?
Post by: devpolytechnic on September 25, 2011, 08:50:49 am
No matter how many tutorials I scroll through online, I can't seem to find any that show how to program something like Tetris. How do you program the pieces and all; how do you program so that the pieces' "skin" is not just blocks of color; how do you make it so that when the pieces line up, you get points?
 ???

Considering the fact that Lua has only been in the TI-Nspire CX/CX CAS OS for several months, I don't expect for there to be many tutorials online. Maybe somebody could create one ;D

If there are any tutorials on this that I haven't found, please tell me!

Thanks in advance.
Title: Re: Те́трис, anyone?
Post by: Adriweb on September 25, 2011, 12:32:41 pm
Among other examples, you can find a Lua tetris here (at the bottom) :

http://www.compasstech.com.au/TNS_Authoring/Scripting/ (http://www.compasstech.com.au/TNS_Authoring/Scripting/)

For tutorials, go to : http://www.inspired-lua.org (http://www.inspired-lua.org)
Title: Re: Те́трис, anyone?
Post by: ExtendeD on September 25, 2011, 04:22:07 pm
devpolytechnic: you need to find a data structure (array, objects, table, ...) to represent a piece, and the whole screen. Combines this with an algorithm than scans those structures to check for collisions and lines.