MegaSteve/MegaEngine.ixx

63 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

module;
#include <Windows.h>
#include <vector>
#include <wrl/client.h>
#include <chrono>
export module MegaEngine;
import Input;
import Graphics;
import GameObject;
import Steve;
2022-08-05 23:50:08 +08:00
import Obstacle;
import ScoreBoard;
import BackGround;
using namespace std;
using namespace std::chrono;
export class Game
{
public:
static constexpr LPCWSTR wndClassName = L"1mGameWnd";
static constexpr LPCWSTR gameTitle = L"1mGame";
static constexpr int wndHeight = 450;
static constexpr int wndWidth = 1050;
void Run();
private:
2022-08-05 23:50:08 +08:00
Texture image;
Steve steve;
2022-08-05 23:50:08 +08:00
Obstacle obs;
ScoreBoard score;
BackGround background;
steady_clock::time_point last;
float delta;
2022-08-05 23:50:08 +08:00
enum Status { Begin, Running, End } status;
HWND hwnd = nullptr;
bool done = false;
void StartUp();
void Update();
void Render();
void LaterUpdate();
void CleanUp();
void CreateWnd();
bool PeekMsg();
bool Done();
2022-08-05 23:50:08 +08:00
void GameOver();
void ReStart();
static LRESULT CALLBACK WndProcSetUp(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK WndProcThunk(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
};