Jump to content
  • Advertisement
Sign in to follow this  
georaldc

Question about array

This topic is 4273 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!