Author Topic: Те́трис, anyone?  (Read 4307 times)

0 Members and 1 Guest are viewing this topic.

Offline devpolytechnic

  • LV0 Newcomer (Next: 5)
  • Posts: 4
  • Rating: +0/-0
    • View Profile
Те́трис, anyone?
« 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.
i like programming :)
#include <iostream>
int main()
{
cout << "Hello, World!" << endl;
}

public class HelloWorld{
 public static void main(String[] args){
  System.out.println("Hello, World!");
 }
}

Define helloworld()=
Prgm
Disp "Hello, World!"
EndPrgm

function on.paint(gc)
 gc:drawString("Hello, World!",125,100)
end

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Те́трис, anyone?
« Reply #1 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/

For tutorials, go to : http://www.inspired-lua.org
« Last Edit: September 25, 2011, 12:32:52 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Те́трис, anyone?
« Reply #2 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.
Ndless.me with the finest TI-Nspire programs