소개글
Visual C++ 6.0 으로 만든 간단한 테트리스 게임 소스입니다.컴파일 실행환경
Visual C++ 6.0 에서 컴파일합니다.본문내용
#define mat_height 20#define mat_width 10
#define ELAPSE_KEY 50
#define margin_x 20
#define margin_y 40
/////////////////////////////////////////////////////////////////////////////
// CTetrisDlg dialog
struct Locations
{
int x;
int y;
};
class CTetrisDlg : public CDialog
{
// Construction
public:
bool bMoveDown;
bool bMoveRight;
bool bMoveLeft;
bool GameIsEnded;
int KilledLine;
void StageGame();
int DestroyLine;
int box_width;
int box_height;
void Chk_Game_Style();
int tmp_Level;
int GameSpeed;
void EraseLine();
void ReDrawing();
void Changing();
byte BLK_TYPE_OLD;
Locations Loc_blk_old[4];
void CalPos();
void Moving(byte dir);
void DrawNextBlock();
byte BLK_TYPE;
void Starting();
Locations Loc_blk[4];
Locations Loc_base;
COLORREF BLK_CLR[7];
byte NextBlock;
byte Matrix[20][10];
CSetGame SetDlg;
CTetrisDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTetrisDlg)
enum { IDD = IDD_TETRIS_DIALOG };
CStatic m_Score_static;
CStatic m_Next_static;
CEdit m_Edit;
CStatic m_Level_static;
CButton m_Start;
int m_Score;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTetrisDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CTetrisDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnStart();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
압축파일 내 파일목록
StdAfx.h
Tetris.aps
Tetris.clw
Tetris.cpp
Tetris.dep
Tetris.dsp
Tetris.dsw
Tetris.h
Tetris.mak
Tetris.ncb
Tetris.opt
Tetris.plg
Tetris.rc
TetrisDlg.cpp
TetrisDlg.h
ReadMe.txt
resource.h
SetGame.cpp
SetGame.h
StdAfx.cpp
Release/Tetris.exe
res/Tetris.ico
res/Tetris.rc2
res/Thumbs.db
Tetris.aps
Tetris.clw
Tetris.cpp
Tetris.dep
Tetris.dsp
Tetris.dsw
Tetris.h
Tetris.mak
Tetris.ncb
Tetris.opt
Tetris.plg
Tetris.rc
TetrisDlg.cpp
TetrisDlg.h
ReadMe.txt
resource.h
SetGame.cpp
SetGame.h
StdAfx.cpp
Release/Tetris.exe
res/Tetris.ico
res/Tetris.rc2
res/Thumbs.db
참고 자료
없음프로그램소스 연관자료
이 자료와 함께 구매한 자료
- 테트리스 0페이지
- (VC++) 퍼즐 게임 프로그램 0페이지
- [VC] 오델로(Othello) 게임 프로그램 소스 58페이지
- [게임프로그래밍] [자바]퍼즐 소스 15페이지
- [VC] 멀티 채팅 서버-클라이언트 프로그램 0페이지