Commit 67be4b9a authored by Konrad McClure's avatar Konrad McClure
Browse files

Added main menu and snake game satates (nonfunctional)

parent 9a831bdc
#include <iostream>
#include "MainMenuState.h"
// #include "TestState2.h"
// #include "TestState3.h"
#include "2048GameState.h"
CMainMenuState CMainMenuState::m_MainMenuState;
void CMainMenuState::Init()
{
cout << " MainMenuState Init" << endl;
stateName = "MainMenuState";
}
void CMainMenuState::Pause()
{
cout << " MainMenuState Pause" << endl;
}
void CMainMenuState::Resume()
{
cout << " MainMenuState Resume" << endl;
}
void CMainMenuState::Cleanup()
{
cout << " MainMenuState Cleanup" << endl;
}
void CMainMenuState::HandleEvents(CGameEngine* game)
{
cout << " MainMenuState Handle Events" << endl;
}
void CMainMenuState::Update(CGameEngine* game)
{
cout << " MainMenuState Update" << endl;
game->ChangeState(C2048GameState::Instance());
}
void CMainMenuState::Draw(CGameEngine* game)
{
cout << " MainMenuState Draw" << endl;
}
#ifndef MAINMENU_H
#define MAINMENU_H
#include "GameState.h"
#include <iostream>
class CMainMenuState : public CGameState
{
public:
void Init();
void Cleanup();
void Pause();
void Resume();
void HandleEvents(CGameEngine* game);
void Update(CGameEngine* game);
void Draw(CGameEngine* game);
static CMainMenuState* Instance() { return &m_MainMenuState; }
protected:
CMainMenuState() {}
private:
static CMainMenuState m_MainMenuState;
int runtimes = 0;
};
#endif
\ No newline at end of file
#include <iostream>
#include "SnakeState.h"
// #include "TestState2.h"
// #include "TestState3.h"
#include "2048GameState.h"
CSnakeState CSnakeState::m_SnakeState;
void CSnakeState::Init()
{
cout << " SnakeState Init" << endl;
stateName = "SnakeState";
}
void CSnakeState::Pause()
{
cout << " SnakeState Pause" << endl;
}
void CSnakeState::Resume()
{
cout << " SnakeState Resume" << endl;
}
void CSnakeState::Cleanup()
{
cout << " SnakeState Cleanup" << endl;
}
void CSnakeState::HandleEvents(CGameEngine* game)
{
cout << " SnakeState Handle Events" << endl;
}
void CSnakeState::Update(CGameEngine* game)
{
cout << " SnakeState Update" << endl;
game->ChangeState(C2048GameState::Instance());
}
void CSnakeState::Draw(CGameEngine* game)
{
cout << " SnakeState Draw" << endl;
}
#ifndef SNAKESTATE_H
#define SNAKESTATE_H
#include "GameState.h"
#include <iostream>
class CSnakeState : public CGameState
{
public:
void Init();
void Cleanup();
void Pause();
void Resume();
void HandleEvents(CGameEngine* game);
void Update(CGameEngine* game);
void Draw(CGameEngine* game);
static CSnakeState* Instance() { return &m_SnakeState; }
protected:
CSnakeState() {}
private:
static CSnakeState m_SnakeState;
};
#endif
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment