aj-r / uwgame

An RPG in which the player runs around the University of Waterloo campus and does awesome things.
0 stars 1 forks source link

Refactor Input Event Handler to handle multiple layers #12

Closed Christofosho closed 9 years ago

Christofosho commented 10 years ago

Input.js currently only executes functions from one map of inputEventHandler functions. Specifically, right now map functions are the values to the input keys. If we want to execute a function from the player module, using the inputEventHandler object, we would end up overwriting the current function.

We need to look into asynchronous concurrent execution to assure the player movement is drawn at the same time as the map movement, as well as object and npc movement.

galoompa commented 10 years ago

I don't think we should do this... we only want one function to handle the input events.

aj-r commented 10 years ago

I agree with Peter. For the player layer, we've created a new MAP_UPDATE event that you can use to determine where the map is moving, so you shouldn't need the inputEventHandlers