PT

Elfs & Orcs Tower Defense

por malabke · Estratégia
5,0 (1)
▶ Jogar 💬 Avaliações Código-fonte 🕘 Versões Editar GitHub
games/elfs-orcs-tower-defense / src / View3d / FlatView.php · commit 65500d9
<?phpnamespace App\View3d;/** The 2D fallback (no WebGL): the map is drawn flat under the top bar. */final class FlatView implements Projection{    public function __construct(private float $top = 30.0)    {    }    public function screen(float $x, float $y, float $height = 0.0): array    {        return [$x, $y + $this->top - $height * 0.5];    }    public function world(float $sx, float $sy): array    {        return [$sx, $sy - $this->top];    }    public function scale(float $x, float $y): float    {        return 1.0;    }}