#pragma once #include "hd2d/Camera.h" #include "hd2d/Scene.h" #include "hd2d/SpriteAtlas.h" #include "hd2d/Weather.h" #include #include #include #include // Meadow diorama: terraced grass, a cliff ridge with steps, a pond crossed by // a stone bridge with burning braziers, 3D trees/bushes/rocks, weather and a // WASD-controlled pixel-art player sprite. class DemoScene { public: bool load(const std::string& assetDir); // `move`: x = screen right, y = screen up (camera-relative), length <= 1. void update(float dt, float time, glm::vec2 move, const hd2d::Camera& camera); void placePlayer(glm::vec2 xz); hd2d::Scene scene; glm::vec3 playerPos{0.0f}; hd2d::Weather weather; // call weather.update() each frame before rendering // Billboard feature test (`--sprite-test`; set before load()): a row of // atlas / sprite-sheet sprites behind the player exercising sub-rect // frames, flip, turn, alpha dither and flash. Labels are world-space // points (sprite tops) for the caller to draw. bool spriteTest = false; struct Label { glm::vec3 pos; const char* text; }; std::vector