📄 cwall.hpp
字号:
//////////////////////////////////////////////////////////////////////////////////////////////////
// # # //
// # * File Name: CWall.cpp # //
// # # //
// # * Function: the engine of the game # //
// # # //
// # * Instruction: Created by JIAN NAN FEI 2008 8 29 # //
// # # //
///////////////////////////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------------------------//
// DEFINES REFERENCES HERE //
//----------------------------------------------------------------------------------------------//
#define _TANK_GAME_WALL
#ifdef _TANK_GAME_WALL
//----------------------------------------------------------------------------------------------//
// HEADFILES REFERENCES HERE //
//----------------------------------------------------------------------------------------------//
#include "CWall.h"
//----------------------------------------------------------------------------------------------//
// GLOBAL MEMBER VARIAYS REFERENCES HERE //
//----------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------//
// FUNCTION MEMBERS REFERENCES HERE //
//----------------------------------------------------------------------------------------------//
//-----------------------------------------------------------------------------
//
// Name: CWALL
// Disc: the member function of the class of the WALL
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//
// Name: CWALL
// Disc: the member function of the class of the WALL
//-----------------------------------------------------------------------------
CWall::CWall()
{
SetWallRect(0,0,0,0);
SetNowPos(-100,-100);
SetLifeState(FALSE);
SetWallState(FALSE);
SetLifeCount(0);
SetType(-1);
}
CWall::CWall( int type,int lifecount,POINT point,int top,int bottom,int left,int right)
{
SetWallRect(top,bottom,left,right);
SetNowPos(point.x,point.y);
SetLifeState(FALSE);
SetWallState(FALSE);
SetLifeCount(0);
SetType(-1);
}
void CWall::BeAttacked(int power)
{
m_wWall.m_nLifeCount-=power;
if(m_wWall.m_nLifeCount<=0)
{
SetWallState(FALSE);
SetLifeState(FALSE);
}
}
void CWall::SetWall(POINT point,int type)
{
SetWallRect(0,WALL_HEIGHT,0,WALL_WIDTH);
SetLifeCount(type*WALL_BASIC_STRENGTH);
SetWallState(WALL_STATE_VISIBLE);
SetNowPos(point.x,point.y);
SetLifeState(TRUE);
SetType(type);
}
//----------------------------------------------------------------------------------------------//
// COMPLISHMENT OF THE FILE //
//----------------------------------------------------------------------------------------------//
#endif //_TANK_GAME_WALL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -