feat(entities): fase 4 - moviment de la momia amb col·lisió, z-order per peus i contacte amb el jugador
This commit is contained in:
1 parent
e6b612d164
commit
ee8dc25181
17 files changed
+378
-66
No files matched your search
@@ -100,4 +100,8 @@ namespace Map {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto insidePlayfield(const SDL_FRect& box) -> bool {
|
||||
return box.x >= static_cast<float>(playfield_x) && box.y >= static_cast<float>(playfield_y) && box.x + box.w <= static_cast<float>(playfield_x + playfield_w) && box.y + box.h <= static_cast<float>(playfield_y + playfield_h);
|
||||
}
|
||||
|
||||
} // namespace Map
|
||||
@@ -67,4 +67,10 @@ namespace Map {
|
||||
// amb cap sarcòfag.
|
||||
[[nodiscard]] auto collides(const SDL_FRect& base_box) -> bool;
|
||||
|
||||
// true si la caixa `box` queda completament dins del playfield (zona
|
||||
// interior, sense tocar els murs exteriors). El Player ja té clamp
|
||||
// propi que aplica el mateix constrenyiment; això serveix a les
|
||||
// entitats dinàmiques per validar posicions candidates del seu step.
|
||||
[[nodiscard]] auto insidePlayfield(const SDL_FRect& box) -> bool;
|
||||
|
||||
} // namespace Map
|
||||
Reference in new issue
Block a user