   [java] Help on a project
  I need some help on a project that I am starting on. I have to make a java application for my Computer Science class and I was thinking of doing some clone of tetris. The only problem is, I have no idea where to start. I'm not asking for help on coding, but rather on how to set it up. In other words, I want to have enough information to create a UML diagram and work from that.This is also my first attempt at making a game, so don't be to hard on me, haha.   
  Hi there,My first game was tetris as well and i had implemented in Java also.Each of the blocks in tetris are made by 4 blocks. Blocks ======00  00    00 00   000  0000    00    0    00   00  0   0The way i implemented was by using a 2d integer array to represent the area where the blocks fall in.  Then use an integer value for each of the different blocks i.e. 0 - empty1 - square block2 - L-block3 - some other blockSo lets say the our grid area is 5 by 5.The 2d array would be created by:int [][] grid = new int[5][5];when the grid area is empty then we use 0.So this is our empty grid.0000000000000000000000000This grid contains a square ( I have used the value 1 for the square)0000000110001100000000000This grid now contains an L-block and a square ( i have used the value 2 for the L-Block)0000000110021100200002200Note the zero represents the empty spaces in the grid where there are no block.Drawing the grid and blocks===========================Next thing to do is to draw the grid.  Since i have used numbers to identifyeach of the block (1 for square, 2 for L-block, 0 for empty), we can use these numbers to draw the blocks.Loop through the 2d grid array and check each integer value.  If integer value is zero then draw a black square representing empty space ( you can use own colours), if value is one then draw a square different coloured square and the same for the other blocks when you come across there numbers.Moving blocks down==================If you have decided to implement the way i have shown using a 2d array then to move the blocks you would need to update the integer values inside the 2d arraySo lets assume we have a square in the grid0000000110001100000000000After a certain amount of time the square must fall.  We do this like so.0000000000001100011000000See how the ones have moved down one place in the array.Theres something for you to get started on.  I am not sure about your knowledge of programming so I would recommend studying and understanding arrays first.  Once you understand how to use 2d arrays the game should be pretty simple to implement.Don't assume that this is the only way to implement a tetris game.  There will probably be other ways to do it, but i think this way should be the easiest. If you don't understand something just post here.Anyway goodluck.   ;  Well, the hardest part for me in this project is the graphical part. I'm not quite sure how to divide up everything and make the parts communicate with each other.   ;public void run(){  while (!gameOver()) {    ProcessInput();    if (currentTime > nextTime ) { // only move block every 100ms, probably increases with level MoveBlock(); CheckForCollision(); nextTime = currentTime + 100;    }    RenderBoard();  }}private void ProcessInput(){  // check which keys were pressed   // rotate/drop/move block}private void MoveBlock(){  // move current block down by 1}private void CheckForCollision(){  // test if player's block overlaps any of the pieces in the board}private bool gameOver(){  // obvious, may just check for a flag set in CheckForCollisions()};  Have a look at this link.http://javaboutique.internet.com/tutorials/Java_Game_Programming/index.html   