-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTFigure.h
73 lines (65 loc) · 2.38 KB
/
TFigure.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
filename : TFigure.h
Interface for the TFigure class. This class is responsible
for making figures and put it on the map.
By : Rafid Khalid
created on : Thursday, November 18, 1999
last modified on : Tuesday, December 7, 1999
--------------------------------------------------------------------*/
#if !defined(AFX_TFIGURE_H__CDCB6EE6_9DD6_11D3_B055_DA618E836B1D__INCLUDED_)
#define AFX_TFIGURE_H__CDCB6EE6_9DD6_11D3_B055_DA618E836B1D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class TFigure : public GPlane
{
// Constructions/Destruction
public:
TFigure( TMap * pmap = NULL, BYTE * pfigure = NULL,
BYTE figurewidth = 0, BYTE figureheight = 0 );
virtual ~TFigure();
// Member functions
public:
void Initialize();
void Destroy();
BOOL Create( BYTE * pfigure, BYTE width, BYTE height );
void SetFigure();
void SetMap( TMap * pmap );
void MoveRight();
void MoveLeft();
BOOL MoveDown();
void Rotate( BOOL bclockwise = TRUE );
void SetKeys( BYTE left = VK_LEFT, BYTE right = VK_RIGHT,
BYTE up = VK_UP, BYTE down = VK_DOWN );
void LoadBlocksBitmap( const char * filename, unsigned int width,
unsigned int height, unsigned int nxblocks = 1,
unsigned int nyblocks = 1, unsigned char bpp = 0 );
void CopyFigureToMap();
virtual void Run( void * parg );
// Member variables
protected:
GSurface gsBlocks; // A surface containing the bitmaps
// of the figures
TMap * pMap; // The owner map
BYTE * pFigure; // A pointer to a memory containing
// the indexes of the blocks of
// the figure
int XPos, YPos, // The position of the figure in
// block unit
FigureWidth, FigureHeight; // The width and the height of the
// the figure and block unit
BYTE Keys[4]; // The keys that use to move
// the figure
DWORD PrevTime; // This DWORD is used to make
// a timer that run each 1 second
// timeGetTime() - PrevTime > 1000
// This timer will move the figure
// down when it run
DWORD RotatePrevTime; // This DWORD is used to make
// a timer that run each 250 ms
// timeGetTime() - PrevTime > 250
// This timer is used to check
// if the player press rotate key
int NextFigure;
};
#endif // !defined(AFX_TFIGURE_H__CDCB6EE6_9DD6_11D3_B055_DA618E836B1D__INCLUDED_)