to the world
very mystery and interesting
C++博客
首页
新随笔
联系
聚合
管理
11 Posts :: 0 Stories :: 5 Comments :: 0 Trackbacks
公告
HI,nice to meet you,and i am a c++ beginer,and hope you can give me some help to help me to improve my c++ level. thank you.
常用链接
我的随笔
我的评论
我参与的随笔
留言簿
(1)
给我留言
查看公开留言
查看私人留言
随笔分类
tears
随笔档案
2006年4月 (1)
2006年2月 (1)
2006年1月 (9)
文章分类
to the world
相册
WANNA SEE YOU
收藏夹
Happy to the world
搜索
积分与排名
积分 - 2738
排名 - 1865
最新评论
1. re: 字符串
评论内容较长,点击标题查看
--小虫
2. re: 字符的输出
请不要在首页提问, 下次再发现, 你的帐户将被停用!
--dudu
3. re: 字符串
不是吧?我感觉不是这样的
书上好象不是那样的,我是个外行。
--hacken
4. re: 字符串
评论内容较长,点击标题查看
--tony
5. re: 字符的输出
评论内容较长,点击标题查看
--小虫
阅读排行榜
1. Game(368)
2. 字符串(366)
3. 字符的输出(325)
4. game(298)
5. null(209)
评论排行榜
1. 字符串(3)
2. 字符的输出(2)
3. 字符输出(0)
4. null(0)
5. Long time wanna forget(0)
Game
//
---------------------------------------------------------------------------
#ifndef UnitTetrisH
#define
UnitTetrisH
//
---------------------------------------------------------------------------
#ifndef STRICT
# define STRICT
#endif
//
---------------------------------------------------------------------------
#include
<
Classes.hpp
>
#include
<
Controls.hpp
>
#include
<
StdCtrls.hpp
>
#include
<
Forms.hpp
>
#include
"
TetrisData.h
"
#include
<
ExtCtrls.hpp
>
#include
<
ActnList.hpp
>
#include
<
Menus.hpp
>
#include
<
AppEvnts.hpp
>
#include
"
VictorDDraw8.h
"
//
---------------------------------------------------------------------------
class
TFormTetris :
public
TForm
{
__published:
//
IDE-managed Components
TMainMenu
*
MainMenu1;
TActionList
*
ActionList1;
TAction
*
AnNew;
TAction
*
AnPause;
TAction
*
AnHScore;
TAction
*
AnExit;
TMenuItem
*
MmFile;
TMenuItem
*
New1;
TMenuItem
*
Pause1;
TMenuItem
*
HighScore1;
TMenuItem
*
Exit1;
TMenuItem
*
N1;
TApplicationEvents
*
ApplicationEvents1;
TMenuItem
*
H1;
TAction
*
AnHelp;
TAction
*
AnAbout;
TMenuItem
*
AnHelp1;
TMenuItem
*
AnAbout1;
TAction
*
AnSingle;
TMenuItem
*
S1;
TMenuItem
*
Speedset;
TMenuItem
*
N2;
TAction
*
AnSpeed;
TVictorDDraw8
*
VictorDDraw81;
void
__fastcall FormKeyDown(TObject
*
Sender, WORD
&
Key,
TShiftState Shift);
void
__fastcall AnNewExecute(TObject
*
Sender);
void
__fastcall AnPauseExecute(TObject
*
Sender);
void
__fastcall AnHScoreExecute(TObject
*
Sender);
void
__fastcall AnExitExecute(TObject
*
Sender);
void
__fastcall ApplicationEvents1Deactivate(TObject
*
Sender);
void
__fastcall LabelHomeClick(TObject
*
Sender);
void
__fastcall AnHelpExecute(TObject
*
Sender);
void
__fastcall AnAboutExecute(TObject
*
Sender);
void
__fastcall AnSingleExecute(TObject
*
Sender);
void
__fastcall FormKeyUp(TObject
*
Sender, WORD
&
Key, TShiftState Shift);
void
__fastcall AnSpeedExecute(TObject
*
Sender);
void
__fastcall ApplicationEvents1Idle(TObject
*
Sender,
bool
&
Done);
void
__fastcall VictorDDraw81DispFrame(TCustomDDraw8
*
Sender);
void
__fastcall VictorDDraw81RestoreFrame(TCustomDDraw8
*
Sender);
void
__fastcall ApplicationEvents1Restore(TObject
*
Sender);
void
__fastcall ApplicationEvents1Activate(TObject
*
Sender);
public
:
static
const
NumScores
=
5
;
#pragma pack(push,
1
)
typedef
struct
{
int
Score;
char
Name[
32
];
}
TScoreItem;
typedef union
{
struct
{
TScoreItem Scores[NumScores];
int
Speed;
}
;
char
Buffer[
512
];
}
TTetrisParams;
#pragma pack(pop)
private
:
//
User declarations
__property
bool
Paused
=
{ read
=
_bPaused, write
=
SetPause }
;
static
const
BlockSize
=
20
, BlockTop
=
10
, BlockLL
=
10
, BlockRL
=
298
, BlockIL
=
206
;
bool
_bPaused, _bSingle, _bGameOverL, _bGameOverR;
TBaseTetris TetrisLeft, TetrisRight;
TTetrisParams TetrisParams;
//
Graphics::TBitmap *TtBmp, *PsBmp, *OvBmp, *SgBmp, *BkBmp, *KkBmp, *MaskBmp;
TDDrawSurface
*
TtSur,
*
PsSur,
*
OvSur,
*
SgSur,
*
BkSur;
int
iSurfaceWidth, iSurfaceHeight;
bool
bDisplayEnabled;
int
iFrames,iFrmCnt;
char
Str_L_Lines[
64
], Str_L_Score[
64
], Str_R_Lines[
64
], Str_R_Score[
64
], Str_Speed[
64
], Str_HighScore[
64
], Str_Fps[
64
];
int
LnLeft, LnRight, _iKeyDelay;
int
_iLeftDown, _iRightDown;
int
_iLeftLeft, _iLeftRight;
int
_iRightLeft, _iRightRight;
unsigned
int
nSysTimeInterval;
int
nTimerMainInterval, nTimerDownInterval;
int
iTimerMainC0, iTimerMainC1, iTimerDownC0, iTimerDownC1;
void
__fastcall EvTimerMainTimer(
void
);
void
__fastcall EvTimerDownTimer(
void
);
void
__fastcall InitSurfaces(
void
);
void
__fastcall LoadSurfaces(
void
);
int
__fastcall GetInitSpeed(
void
);
void
__fastcall SetInitSpeed(
int
iSpd);
int
__fastcall GetInitBackground(
void
);
//
void
__fastcall SetInitBackground(
int
iBkg);
//
void
__fastcall SetPause(
bool
);
void
__fastcall CheckGameStatus(
void
);
void
__fastcall RefreshDisplay(
void
);
bool
__fastcall TestKeyDown(
int
&
iKey);
void
__fastcall DrawTetris(TDDrawDisplay
*
lpDisplay, TBaseTetris
*
lpTetris,
int
x0,
int
y0,
bool
bPlaySingle);
void
__fastcall DrawIncoming(TDDrawDisplay
*
lpDisplay, TBaseTetris
*
lpTetris,
int
x0,
int
y0);
void
LoadParams(
void
);
void
SaveParams(
void
);
void
GetPlayerName(
char
*
lpName);
void
ShowHighScores(
void
);
public
:
//
User declarations
__fastcall TFormTetris(TComponent
*
Owner);
__fastcall
~
TFormTetris();
__property
int
InitSpeed
=
{ read
=
GetInitSpeed, write
=
SetInitSpeed }
;
__property
int
InitBackground
=
{ read
=
GetInitBackground, write
=
SetInitBackground }
;
//
protected
:
void
__fastcall WndProc(Messages::TMessage
&
Message);
}
;
//
---------------------------------------------------------------------------
extern
PACKAGE TFormTetris
*
FormTetris;
//
---------------------------------------------------------------------------
#endif
posted on 2006-01-17 18:10
hacken
阅读(368)
评论(0)
编辑
收藏
引用
只有注册用户
登录
后才能发表评论。
【推荐】100%开源!大型工业跨平台软件C++源码提供,建模,组态!
网站导航:
博客园
IT新闻
BlogJava
知识库
博问
管理
Powered by:
C++博客
Copyright © hacken