From 7173d65263ea85789dfd7c5e64057eea5be2b7b6 Mon Sep 17 00:00:00 2001 From: Noel Berry Date: Mon, 4 Jan 2021 18:55:26 -0800 Subject: [PATCH] added some documentation & explanations --- content/map/readme.md | 3 +++ content/sprites/readme.md | 5 +++++ content/tilesets/readme.md | 1 + src/components/ghost_frog.h | 9 +++++++++ src/components/hurtable.h | 3 +++ src/factory.h | 2 ++ src/masks.h | 2 ++ src/world.h | 5 +++++ 8 files changed, 30 insertions(+) create mode 100644 content/map/readme.md create mode 100644 content/sprites/readme.md create mode 100644 content/tilesets/readme.md diff --git a/content/map/readme.md b/content/map/readme.md new file mode 100644 index 0000000..909ffb3 --- /dev/null +++ b/content/map/readme.md @@ -0,0 +1,3 @@ +Due to making this game under heavy time constraints, I opted not to make or use a level editor. Instead, each object is assigned a color and I used a generic paint tool to design the levels. + +Under normal circumstances, I would argue against this method and instead use something like Ogmo Editor or Tiled. It's really hard to remember what object is what color! \ No newline at end of file diff --git a/content/sprites/readme.md b/content/sprites/readme.md new file mode 100644 index 0000000..1dbf2ab --- /dev/null +++ b/content/sprites/readme.md @@ -0,0 +1,5 @@ +The sprites are stored in the [Aseprite](https://www.aseprite.org/) format, and you'll need Aseprite to edit them. + +A few other notes: + - Animations are loaded automatically using Aseprite's `Tag` feature. Each tag is a unique animation + - Sprite Origin points use Aseprite's hidden `Slice` feature, which can be used with Shift+C. You can draw slices and give them a pivot point, which we're using to set the origin point of the sprite. \ No newline at end of file diff --git a/content/tilesets/readme.md b/content/tilesets/readme.md new file mode 100644 index 0000000..7ee2e6a --- /dev/null +++ b/content/tilesets/readme.md @@ -0,0 +1 @@ +The tilesets are stored in the [Aseprite](https://www.aseprite.org/) format, and you'll need Aseprite to edit them. \ No newline at end of file diff --git a/src/components/ghost_frog.h b/src/components/ghost_frog.h index ead3b84..6f97c0c 100644 --- a/src/components/ghost_frog.h +++ b/src/components/ghost_frog.h @@ -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(); diff --git a/src/components/hurtable.h b/src/components/hurtable.h index 947c20f..d983e69 100644 --- a/src/components/hurtable.h +++ b/src/components/hurtable.h @@ -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: diff --git a/src/factory.h b/src/factory.h index 2bf4807..6016120 100644 --- a/src/factory.h +++ b/src/factory.h @@ -6,6 +6,8 @@ using namespace Blah; namespace TL { + // Factory to create game objects + namespace Factory { Entity* player(World* world, Point position); diff --git a/src/masks.h b/src/masks.h index 30d6220..e6cdfd2 100644 --- a/src/masks.h +++ b/src/masks.h @@ -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; diff --git a/src/world.h b/src/world.h index 834a5c0..8229eb7 100644 --- a/src/world.h +++ b/src/world.h @@ -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;