feat(effects): polvet transitori al despegue i a l'aterratge
This commit is contained in:
1 parent
c38c80753a
commit
3e379ce129
11 files changed
+209
-1
No files matched your search
@@ -41,9 +41,17 @@ struct PaintedTile {
|
||||
int tile_index{-1};
|
||||
};
|
||||
|
||||
// Coordenades en píxels al canvas. Payload genèric per a events que
|
||||
// volen indicar "una cosa ha passat aquí" — actualment `player_jumped`
|
||||
// i `player_landed`, que el GameScene escolta per spawnejar polvet.
|
||||
struct WorldPos {
|
||||
float x{0.0F};
|
||||
float y{0.0F};
|
||||
};
|
||||
|
||||
struct Event {
|
||||
std::string name;
|
||||
using Payload = std::variant<std::monostate, int, std::string, Entity*, TilePos, PaintedTile>;
|
||||
using Payload = std::variant<std::monostate, int, std::string, Entity*, TilePos, PaintedTile, WorldPos>;
|
||||
Payload payload;
|
||||
// Jugador que ha originat (o provocat) l'event. -1 = sense jugador
|
||||
// associat (events del món, com `sarcophagus_opened` des de la pròpia
|
||||
@@ -90,6 +98,9 @@ class EventBus {
|
||||
void publish(const std::string& name, PaintedTile painted) {
|
||||
publish(Event{.name = name, .payload = painted});
|
||||
}
|
||||
void publish(const std::string& name, WorldPos pos) {
|
||||
publish(Event{.name = name, .payload = pos});
|
||||
}
|
||||
|
||||
private:
|
||||
struct Subscription {
|
||||
|
||||
Reference in new issue
Block a user