2021-01-03 05:51:50 +08:00
|
|
|
#pragma once
|
|
|
|
#include <blah.h>
|
|
|
|
#include "world.h"
|
|
|
|
|
|
|
|
using namespace Blah;
|
|
|
|
|
|
|
|
namespace TL
|
|
|
|
{
|
|
|
|
class Game
|
|
|
|
{
|
|
|
|
public:
|
2021-01-04 05:04:11 +08:00
|
|
|
static constexpr int width = 240;
|
|
|
|
static constexpr int height = 135;
|
2021-01-03 09:50:25 +08:00
|
|
|
static constexpr int tile_width = 8;
|
|
|
|
static constexpr int tile_height = 8;
|
2021-01-04 05:04:11 +08:00
|
|
|
static constexpr int columns = width / tile_width;
|
|
|
|
static constexpr int rows = height / tile_height + 1;
|
2021-01-03 09:50:25 +08:00
|
|
|
|
2021-01-03 05:51:50 +08:00
|
|
|
World world;
|
|
|
|
FrameBufferRef buffer;
|
|
|
|
Batch batch;
|
2021-01-04 05:04:11 +08:00
|
|
|
Point room;
|
2021-01-04 06:08:22 +08:00
|
|
|
Vec2 camera;
|
2021-01-03 05:51:50 +08:00
|
|
|
|
2021-01-04 05:04:11 +08:00
|
|
|
void load_room(Point cell);
|
2021-01-03 05:51:50 +08:00
|
|
|
void startup();
|
|
|
|
void shutdown();
|
|
|
|
void update();
|
|
|
|
void render();
|
2021-01-03 08:20:01 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_draw_colliders;
|
2021-01-04 06:08:22 +08:00
|
|
|
bool m_transition = false;
|
|
|
|
float m_next_ease;
|
|
|
|
Point m_next_room;
|
|
|
|
Point m_last_room;
|
|
|
|
Vector<Entity*> m_last_entities;
|
2021-01-03 05:51:50 +08:00
|
|
|
};
|
|
|
|
}
|