mniik / php-race-game

CLI-Based Two-Player Vehicle Racing Game in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLI-Based Two-Player Vehicle Racing Game in PHP

Project Brief:
The game begins with the players choosing a vehicle from a list provided in a vehicles.json file. Each vehicle has a maximum speed. The application will calculate the time taken by each vehicle to complete a given distance based on its speed, and then declare the winner.

Core Features:

  1. Load the list of available vehicles from a vehicles.json file.
  2. Allow two players to select a vehicle each from this list.
  3. Run a race using the selected vehicles.
  4. Calculate the time taken by each vehicle to complete the race based on vehicle's speed.
  5. Determine and display the winner.
  6. Display the time taken by each vehicle to finish the race.

How to run Project:
Provide php and composer environment and run following commands:

  1. composer install
  2. php src/index.php

About

CLI-Based Two-Player Vehicle Racing Game in PHP


Languages

Language:PHP 100.0%