An open API service indexing awesome lists of open source software.

https://github.com/lessmore92/php-race-game

CLI-Based Two-Player Vehicle Racing Game in PHP
https://github.com/lessmore92/php-race-game

Last synced: about 1 year ago
JSON representation

CLI-Based Two-Player Vehicle Racing Game in PHP

Awesome Lists containing this project

README

          

# CLI-Based Two-Player Vehicle Racing Game in PHP

## Installation
```shell
composer install
```

## How To Start

Start the game:
```shell
php index.php
```

### Sample out-put
```shell
Welcome to the PHP Racing Game!
Please select a vehicle for each player from the list below:
1. Car - 150 km/h
2. Motorcycle - 200 km/h
3. Bus - 100 km/h
4. Bicycle - 30 km/h
5. Jet Ski - 50 km/h
6. Speed Boat - 70 km/h
7. Yacht - 20 km/h
8. Helicopter - 140 km/h
9. Airplane - 485 km/h
10. Hot Air Balloon - 5 km/h
What is the distance of the race track? [200]: 400
Player 1, enter the number of your vehicle: 4
Player 2, enter the number of your vehicle: 5

The race distance is 400 km
The race results are:

Place 1: Player 2 (Jet Ski) - 8 hours
Place 2: Player 1 (Bicycle) - 13.33 hours

The winner is Player 2 (Jet Ski)!
```