The seven tetrominos: they can be also named by the letter they resemble. The figure shows I
Question:
The seven tetrominos: they can be also named by the letter they resemble. The figure shows I (light blue), J (dark blue), O (yellow), L (orange), T (purple), S (green), Z (red). Your Java program should randomly choose a tetromino shape, a random color for this shape, and a random location within the frame, and displays it on the screen. Then, the program can terminate after a while or wait until the user closes the window.
Create a TetrisViewer class Create a TetrisComponent (should include a method paintComponent and a method setTetromino(/* shape, color */). In the TetrisViewer class, randomly choose a tetromino and its color (use java.util.Random). Set this information in the TetrisComponent. Hint: You will use RGB color system, so you can create three random integers between 0-255 to create a random color. Display the frame and component (in a random location (random x and y coordinate point)). ** You will be displaying one random tetromino only (do not bother to create more objects in one run) ** We are not developing the whole game, so you should not worry about creating multiple different objects and fitting them on the screen... or other specifications of the Tetris game. Our goal is to create one random object only. **Hint: You will use the Rectangle component and locate for square together to create different tetrominos.
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill