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

Falling Blocks

, 17 Apr 2008
A game written using Visual C++ and DirectX.
fallingblocks.zip
FallingBlocks.exe
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
// BlockList.h: interface for the CBlockList class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BLOCKLIST_H__5C19BD1E_B253_42C6_95D0_E2D86D84FA80__INCLUDED_)
#define AFX_BLOCKLIST_H__5C19BD1E_B253_42C6_95D0_E2D86D84FA80__INCLUDED_

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

////////////////////////////
// Block definitation
////////////////////////////
struct SBlock {
	short nX,nY,nColor;
};

///////////////////////////////////////////////////////////////////////
// CBlockList will be the parent class for the CShape class and the 
// CFlooredBlocks class. It contains the methods to maintain the lists.
///////////////////////////////////////////////////////////////////////

class CBlockList  
{
public:
	struct SNODE {
		SBlock Block;
		SNODE* pNext;
		inline SNODE();
	} *m_pListHead;

public:
	void Destroy(); // Empties the linked list.
	bool IsOccupied(short nX, short nY); // Returns true if the given location is already occupied
	void Display(short nX=0, short nY=0); // Displays the block on the screen offsetting it by nX and nY.
	bool Add(const SBlock Block);  // Adds the block to the end of the list.
	void dbgDisplay(); // Dumps the list to the debugger.
	bool Insert(const SBlock Block); //Inserts the block based on the value in linked list.
	CBlockList();
	virtual ~CBlockList();

};

#endif // !defined(AFX_BLOCKLIST_H__5C19BD1E_B253_42C6_95D0_E2D86D84FA80__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
Web01 | 2.8.140916.1 | Last Updated 17 Apr 2008
Article Copyright 2001 by Xavier John
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid