antfarmar / Unity-3D-Asteroids

A simple Asteroids clone. In 3D.
The Unlicense
65 stars 15 forks source link

Refactor ship input #14

Closed ghost closed 8 years ago

ghost commented 8 years ago

User input controlling the ship has been moved to ShipInput.cs This groups all code related to input in one place which serve a few benefits:

New project members can easily find all ship input code in a single location. This makes it easier to understand which buttons to press.

Input specific logic can be placed in ShipInput. For instance, GetForwardThrust only return values in the range (0, 1). Ship logic code doesn't have to worry about sanitizing ship input.