diff --git a/src/Insallah/Player/Player.php b/src/Insallah/Player/Player.php new file mode 100644 index 0000000..1687f9d --- /dev/null +++ b/src/Insallah/Player/Player.php @@ -0,0 +1,45 @@ += 0) { + $_SESSION['x'] += $x_pos; + } + } + + /** + * @param int $y_pos + */ + public static function modYPos(int $y_pos): void + { + if ($_SESSION['y'] + $y_pos >= 0) { + $_SESSION['y'] += $y_pos; + } + } + + public static function clear() + { + session_destroy(); + header('Location: ' . $_SERVER['REQUEST_URI']); + } +} \ No newline at end of file