HC-06: rutes d'assets de GameScene a Defaults::Pyramid + Config
Afegits `Defaults::Pyramid::{MAP_YAML, PLAYER_SPRITE, PLAYER_YAML,
MUSIC_TRACK}` a utils/defaults.hpp. `GameScene` exposa `Config` i
`defaultConfig()`; el ctor accepta Config (default = Defaults::Pyramid)
i usa els camps enlloc dels literals. `Player` passa a rebre el anim_key
per constructor en lloc de cablejar "player.yaml". Cache key = basename
(convenció preexistent). Cada piràmide futura serà un Config distint.
This commit is contained in:
1 parent
e84d8cc535
commit
505e819af1
6 files changed
+60
-20
No files matched your search
@@ -36,7 +36,7 @@ class Player : public AnimatedSprite {
|
||||
// Ha de cridar-se abans d'instanciar Player; GameScene ho fa al ctor.
|
||||
static void loadFrom(const std::string& yaml_path);
|
||||
|
||||
Player(float x, float y, const Controls& controls);
|
||||
Player(const std::string& anim_key, float x, float y, const Controls& controls);
|
||||
|
||||
void update(float delta_time) override;
|
||||
|
||||
|
||||
Reference in new issue
Block a user