Simulate the behavior of an electric car with basic controls using Python.
This Python script simulates the behavior of an electric car, allowing users to control acceleration, braking, and sudden braking. The simulation includes a visual representation of battery status, acceleration, and speed.
- Real-time simulation of an electric car
- Visual representation of battery status and acceleration
- Adjustable parameters for battery capacity, maximum speed, and control rates
-
Clone the repository:
git clone https://github.com/your-username/electric-car-simulation.git
Navigate to the project directory:
cd electric-car-simulation Run the script:
python electric_car_simulation.py Dependencies The script uses the pynput library for handling keyboard inputs. You can install it using:
pip install pynput How to Run Ensure you have Python installed on your system.
Install the required dependencies:
pip install -r requirements.txt Run the script:
python electric_car_simulation.py Controls W: Accelerate S: Brake Space: Sudden Brake Esc: Exit the simulation Contributing Contributions are welcome! Please fork the repository and submit a pull request.