Project-Rekt / engine

Game Engine - Currently on version MASON
https://project-rekt.github.io/engine/index.html
Apache License 2.0
1 stars 3 forks source link

Created InputHandler.js #5

Closed elijah-t closed 4 years ago

elijah-t commented 4 years ago

The InputHandler is mostly finished, although there may be things missing or not tested.

edit: InputHandler, not InputCreator

Squishy123 commented 4 years ago

Added a few changes to the class:

  1. We can actually avoid having to manually bind the "this" scope to each class function by using arrow functions:

e.g.

classFunct = (param) => {
...
}
  1. You can export the classes in 1 line:
    export default class ClassName {
    ...
    }

Also a general heads-up,

elijah-t commented 4 years ago

Alright cool, I'll keep that in mind as well 👍

Squishy123 commented 4 years ago

Gonna get you to write some tests for practice. Just create a demo in the /tests/inputHandlerTest.js to test keyboard and mouse input. You can write stuff to the console or display elements on the page if you want.