Question about array

Started by
1 comment, last by georaldc 17 years, 6 months ago
Well, this my first posting here (since I'm still kind of new to game programming) so hi everyone. Now to my question.. I was wondering what would be the best way to rotate an array's values in java (CW or CCW)? I'm asking this for my tetris game since the tetris blocks are stored in a 4x4 array, and I would like to change their orientation by rotating the array (I know that it would look kinda unnatural compared to real tetris games when rotating using this method, but I'll try to fix that once I figure out how to rotate an array).
Advertisement
It's probably easiest just to rotate the pieces manually because you are only rotating to 4 different positions per shape, two with some of them.
hm, yeah I guess your're right. Actually, I wanted to do some sort of shape editor, which is why I wanted to rotate the array so that any shape could be rotated. But, this is kinda like a project for class and I'm running out of time, so I just did it manually a while ago and good thing it works fine.

This topic is closed to new replies.

Advertisement