abhijitnandy2011 / Age-of-Steam

A WebGL based train simulation
MIT License
0 stars 0 forks source link

Create controls for starting and stopping the train #11

Open abhijitnandy2011 opened 8 years ago

abhijitnandy2011 commented 8 years ago

There should be switches to add acceleration and reduce acceleration. This will do till we have a steam engine model. There should also be brake switches. There are no switches for speed directly as an engine works on the basis of force application which accelerates and adds speed.

The following keys can be there: w - Increase Acceleration s - Reduce Acceleration Acceleration is capped at some max at the higher end. Its negative only while braking. Other than at braking we do not allow negative acceleration. Negative acceleration is only during braking deceleration.

We never allow negative velocity or displacement. Negative values would imply reverse movement - this is achieved by reversing the direction of the movement of the train but keeping displacement, velocity and acceleration positive.

Brake switches: b - Apply normal braking deceleration Shift + b - release brakes e - Apply emergency braking deceleration Shift + e - Release emergency brakes