Adding Mobile Touch and Mouse Input (part 1)
We want our future games to be playable on the widest variety of devices. This includes support for keyboard (which we have already added a couple of posts ago), as well as Mouse input and mobile Touch input. If our games respond to any and all types of player input, then our games will be more widely enjoyed and shared. So, it's time to add support for Mouse and mobile Touch input. As we saw with keyboard input, we could try to develop a helper library from scratch that handles all the various types of events for both Mouse and Mobile devices. But why re-invent the wheel? If there is already an existing library in place that we could use, let's use it! Once again we turn to Jerome Etienne from Paris, France. Remember he's the one who developed the 'keyboardstate.js' helper that we used a couple of posts back. Well, it just so happens that Jerome also has a nifty helper file for adding Touch input as well ...