Challenge: Create nextblock game components
This chapter does not really discuss nextblock game components, so there is a reason for this. I want you to create it on your own. In this bookSource codeThe nextblock class in is empty, and your task is filled with it. The nextblock game component has been added to the tetrisgrid class and you have seen all the methods to be used. If you are not confident about your solution, you can check the complete source for all the improvements.CodeAnd the source code of all the xNa RIS projects I have developed also has a complete nextblock class. However, I suggest you write game components, maybe some other improvements to the game make you more familiar with all these new classes.
The nextblock component should display the model of the next brick. Use the blocktypes enumeration from the tetrisgrid class to display the next brick in a 5 × 5 grid and add a small text on the top (see Figure 4-11 ).
Figure 4-11
Tip: Do not waste too much time playing with Tetris. This is a good game, but it is better in this book.