php-snake
php-snake copied to clipboard
Popular snake game implementation in PHP and running in CLI.
PHP-Snake
Popular snake game implementation in PHP and running in CLI.
PHP-ML requires PHP >= 7.0.
╔══════════════════════════════════════════════════════════════╗
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ░ ║
║ ░ $ ║
║ ░ ║
║ ░ ║
║ ░ ║
║ ░░░░░░░░░░░░░░█ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
╚══════════════════════════════════════════════════════════════╝
Requirements
- PHP >= 7.0.0
- Composer
Install
Clone from GitHub:
git clone [email protected]:itcraftsmanpl/php-snake.git
cd php-snake
composer install --no-dev
Launch
Run simple command in CLI:
php snake.php
Keys:
w - move up
a - move left
s - move down
d - move right
References
These publications have helped me in creating PHP-Snake game:
- Box drawing in PHP
- Terminal Control Escape Sequences
- Beautiful PHP CLI Scripts
- readline_callback_handler_install
License
PHP-Snake is released under the MIT Licence. See the bundled LICENSE file for details.
Author
Arkadiusz Kondas (@ArkadiuszKondas)