Tetris block in C -


i have project college create tetris using dynamically allocated board representing empty part . . wanted create blocks each of pieces individually example

o o o o  

block in tetris described in 2d dynamically allocated matrix that:

tablo[0][((distx/2)-1)] = 'o'; /*tablo stands board(the 2d allocated matrix) , '(distx/2)-1'    used start block top center of board */ printf("\n"); for(i=0;i<3;i++) {   tablo[1][((distx/2)-1)+i] = 'o'; } 

so question is:

  • is efficient?

  • is there way make blocks , move them inside board matrix easier?

with solution of blocks have bit of trouble finding way make them drop whole it's drawing tetris.

plus told include hard mode tetris starts blocks or block parts on board difficult solution.

its first time posting please tell me if need more information issue. thank time.

here example of tetris game implemented in c

http://www.gladir.com/coder/turboc/tetris.htm

in first link shapes stored in separated bi-dimensional arrays , added matrix represents board game. -same principle idea -. think kind of architecture might fit needs because bit having pieces separated, represented in oo language different objects same parent classe shape -for instance-.

here other example of tetris in c, seems more confusing first link may help.

http://www.c.happycodings.com/games_and_graphics/code32.html


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -