프로젝트 기타/마리오게임 코드
C++ 마리오게임4 (ObjectManager.h, ObjectManager.cpp)
ohksj77
2021. 8. 30. 16:43
마리오 게임을 구현해 보았다. 유튜브를 참고하였고, 내가 수정한 부분들도 있다. 유튜브 링크는:
https://www.youtube.com/watch?v=nD5OuMdS9FU 이다.
ObjectManager.h
#pragma once
#include "Stage.h"
#include "value.h"
class Cstage;
class CMapManager
{
private:
CMapManager();
~CMapManager();
static CMapManager* m_pInst;
CStage* m_pStage[STAGE_MAX_COUNT];
int m_iEnableStage;
bool Stop = false;
public:
static CMapManager* GetInst();
static void DestroyInst();
bool Init();
void Run(int iStage);
void Render();
CStage* GetStage() { return m_pStage[m_iEnableStage]; }
bool SetStop() { Stop = true; return Stop; }
bool GetStop() { return Stop; }
};
ObjectManager.cpp
#include "ObjectManager.h"
#include "Player.h "
CObjectManager* CObjectManager::m_pInst = NULL;
CObjectManager::CObjectManager():m_pPlayer(NULL) {
}
CObjectManager::~CObjectManager() {
SAFE_DELETE(m_pPlayer);
}
bool CObjectManager::Init() {
m_pPlayer = new CPlayer;
m_pPlayer->Init();
return true;
}