1

I've got this project I am working on. If you try and hold the UP key down, you'll see what I mean:

http://harlem-shake-it.com/tetris/

I need to make it turn around its axis, instead of what it does there.

Look at the code here: http://harlem-shake-it.com/tetris/js/tetris.js

Thanks in advance

MortenMoulder
  • 6,138
  • 11
  • 60
  • 116

1 Answers1

0

I am not sure but, I think you are using a 4 by 4 matrix to draw shapes..

Use a 5 by 5 instead . [0,0] to [4,4] and rotate thing on [2,2] as the center ..

This will solve the problem. Keep [2,2] as the center block in all shapes, [2,2] will be always colored. To get hold of this, try/understand it using a pen n paper or go here:-

Source/Link - http://javilop.com/gamedev/tetris-tutorial-in-c-platform-independent-focused-in-game-logic-for-beginners/

Or You can use a 3x3 grid as I did .. https://github.com/ashtt/TetrisOnCanvas

Piyush Ashtt
  • 340
  • 1
  • 5