![]() The gameplay for "Falling Blocks You Move to Make Lines" is fairly simple and pretty familiar. I was working on game logic basically right from the start and that makes all the difference in the world. I have written Tetris clones before so I had the knowledge of how to do it, but XNA still took away so much of the early project work typically associated with making a game. The game itself took me about a weekend to write (and about 2 months for me to finally post it and re-do it in Beta 2). It is one of the recommended "first step" games for all budding game developers and making one with XNA is extremely straightforward and easy. new VC7 project, with files to make it easier for those having difficulties setting directories for SDK files.Falling Blocks You Move to make lines is a clone of a game we all know and love. Make games and share your knowledge :) History Look at the code and everything should be self-explanatory. This way you // can added new shapes to the array and active // it by changing this value. Sets the maximum number of shapes that // will be used from the array. bool SetMaxNoOfShapesAllowed( short nMac) Converts the internal SBlock to contain the actual // coordinates so that it can be added to the floored list. void Display() // Displays the shape void ConvertToSpaceCoord() bool Rotate() // Rotates based on the shape. bool MoveLeft() īool MoveDown() // Moves the shape down. bool MoveRight() // Moves the shape right. This function creates the blocks and gives it the color bool MoveTo(x1,y1) // Moves the shape to the given coordinates. Creates a shape from the build in shapes at random. M_pStockShapes array holds the shape definitions. All you have to do is add the shape to the array and update the array information. It is easy to add your own shapes in this game. If you set the game to crazy mode, you will get weird shapes. Under the level menu, you can select the game speed. Game is over when a shape hits the bottom and some of the blocks are above the grey line. When a shape hits the bottom, it is added to the Floored Block list and a new Next shape is created.įor each line of blocks removed, 10* NumberOfLinesRemoved* NumberOfLinesRemoved * GameSpeed points are given. One is the shape currently falling and the other is the next shape. ![]() The game creates two shapes when the game starts. You will have to adjust the project setting to reflect your DirectX SDK paths. ![]() To run the game, DirectX 7 is all that is required. It should work fine with DirectX 7 but I have not tried it. I developed this game using DirectX 8 SDK. ![]() The classes CDisplay and CSurface are created by Microsoft and are shipped along with the DirectX SDK. The project consists of the following classes: I have sprinkled comments all over the code so it should help you with understanding the code. This code should help you create small games using DirectX. DirectX 8.0 SDK (DirectX 7.0 SDK should also work but I have not tried it).A row filled with blocks are removed and points are given. The objective is to get continuous blocks in a row. Down arrow to move the block down faster and the center key (5) to drop the block. Use the Left arrow and the Right arrow to move the block left or right.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |