mirror of
https://github.com/NoelFB/tiny_link.git
synced 2025-06-30 19:35:26 +08:00
added some documentation & explanations
This commit is contained in:
@ -21,9 +21,18 @@ namespace TL
|
||||
static constexpr int st_reflect = 5;
|
||||
static constexpr int st_dead_state = 6;
|
||||
|
||||
// health during our first phase
|
||||
static constexpr int max_health_1 = 10;
|
||||
|
||||
// health during our second phase
|
||||
static constexpr int max_health_2 = 3;
|
||||
|
||||
// current health value (assigned to phase 1 health to start)
|
||||
int health = max_health_1;
|
||||
|
||||
// phase 0 or 1
|
||||
// 0 = running along the ground and slicing
|
||||
// 1 = flying around in the air shooting orbs
|
||||
int phase = 0;
|
||||
|
||||
GhostFrog();
|
||||
|
@ -8,6 +8,9 @@ using namespace Blah;
|
||||
|
||||
namespace TL
|
||||
{
|
||||
// Automatically checks if the provided collider ever overlaps
|
||||
// with something in the `hurt_by` mask. Makes it easy for enemies
|
||||
// to check if they were hit by `Mask::player_attack`
|
||||
class Hurtable : public Component
|
||||
{
|
||||
public:
|
||||
|
@ -6,6 +6,8 @@ using namespace Blah;
|
||||
|
||||
namespace TL
|
||||
{
|
||||
// Factory to create game objects
|
||||
|
||||
namespace Factory
|
||||
{
|
||||
Entity* player(World* world, Point position);
|
||||
|
@ -5,6 +5,8 @@ namespace TL
|
||||
{
|
||||
struct Mask
|
||||
{
|
||||
// bitfield masks for collision types
|
||||
|
||||
static constexpr uint32_t solid = 1 << 0;
|
||||
static constexpr uint32_t jumpthru = 1 << 1;
|
||||
static constexpr uint32_t player_attack = 1 << 2;
|
||||
|
@ -111,6 +111,11 @@ namespace TL
|
||||
public:
|
||||
static constexpr int max_component_types = 256;
|
||||
|
||||
// NOTE:
|
||||
// I tossed this reference here at the very end of making the game,
|
||||
// just so that the boss could tell the game to shake the screen.
|
||||
// Ideally I think there should be a Camera component that handles
|
||||
// that instead.
|
||||
Game* game;
|
||||
|
||||
World() = default;
|
||||
|
Reference in New Issue
Block a user