Click here to Skip to main content
Click here to Skip to main content
Articles » Multimedia » DirectX » Games » Downloads
 
Add your own
alternative version

Falling Blocks

, 17 Apr 2008
A game written using Visual C++ and DirectX.
fallingblocks.zip
fallingblocksvc7.zip
FallingBlocks
Block are Falling.doc
DirectX.ico
Drowning.wav
Graphics.bmp
LineComplete.wav
Move.wav
Place.wav
Web Falling Blocks.doc
fallingblocksvs2008.zip
Block are Falling.doc
DirectX.ico
Drowning.wav
FallingBlocks.suo
Graphics.bmp
LineComplete.wav
Move.wav
Place.wav
Web Falling Blocks.doc
fallingblocks_src.zip
Block are Falling.doc
DirectX.ico
Drowning.wav
FallingBlocks.dsp
FallingBlocks.dsw
Graphics.bmp
LineComplete.wav
Move.wav
Place.wav
Web Falling Blocks.doc
// FlooredBlocks.h: interface for the CFlooredBlocks class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FLOOREDBLOCKS_H__E4FB0140_C598_4061_A528_8D863FFCDB14__INCLUDED_)
#define AFX_FLOOREDBLOCKS_H__E4FB0140_C598_4061_A528_8D863FFCDB14__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//////////////////////////////////////////////////////////////////////
// The CFlooredBlocks maintains the list of blocks that have been placed 
// on the floor. All the shapes that fall down are added to this list.
//////////////////////////////////////////////////////////////////////
class CFlooredBlocks: public CBlockList  
{
public:
	bool IsGameOver();

	void IncrementYabove(short nY); // Helper function for CheckAndRemoveContinuousBlocks 
	                                // used to drop the blocks above the removed line.
	bool IsOccupied(CBlockList& BlockList, short nX, short nY);
	bool Insert(CBlockList& BlockList);
	void Display();
	short CheckAndRemoveContinuousBlocks(); // Returns the number of lines removed. 
	                                        // This can be used to calculate the score. 
	                                        // This function also adjust the coordinates 
	                                        // of all the other blocks so that they fall.
	                                        
	bool IsOccupied(short X, short Y);
	CFlooredBlocks(RECT rcBoundary);
	virtual ~CFlooredBlocks();
	RECT m_rcBoundary;
};

#endif // !defined(AFX_FLOOREDBLOCKS_H__E4FB0140_C598_4061_A528_8D863FFCDB14__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Xavier John
Software Developer
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 17 Apr 2008
Article Copyright 2001 by Xavier John
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid