Sign in to follow this  
georaldc

Question about array

Recommended Posts

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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this