프로젝트 기타/마리오게임 코드
C++ 마리오게임7 (Value.h, Running.cpp)
ohksj77
2021. 8. 30. 16:48
마리오 게임을 구현해 보았다. 유튜브를 참고하였고, 내가 수정한 부분들도 있다. 유튜브 링크는:
https://www.youtube.com/watch?v=nD5OuMdS9FU 이다.
Value.h
#pragma once
#include <iostream>
#include <Windows.h>
using namespace std;
#define SAFE_DELETE(p) if(p){delete p; p = NULL;}
#define STAGE_MAX_COUNT 3
#define BLOCK_X 50
#define BLOCK_Y 10
#define RENDER_BLOCK_X 20
#define RENDER_BLOCK_Y 5
static int InputInt() {
int iInput;
cin >> iInput;
if (cin.fail()) {
cin.clear();
cin.ignore(1024, '\n');
return INT_MAX;
}
return iInput;
}
Running.cpp
#include "Core.h"
int main() {
if (!CCore::GetInst()->Init()) {
cout << "게임 초기화 실패!!" << endl;
CCore::DestroyInst();
return 0;
}
CCore::GetInst()->Run();
CCore::DestroyInst();
return 0;
}