Timeline for Handling input with callback functions
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 24, 2015 at 18:21 | vote | accept | Daniel Martin | ||
| Apr 24, 2015 at 18:21 | comment | added | Daniel Martin | Good read! While it's not exactly what I'm looking for, it's definitely helped. I want to be able to assign different "actions" for different characters/allow the user to set up the controller/keyboard to whatever suits them best, which is why I was initially leaning towards function pointers. However, the Observer pattern mixed with Polling might just be what I should be looking in to. | |
| Apr 24, 2015 at 9:25 | comment | added | Jon | +1 nice. More often than not, I end up with 50% of my input going to either "the camera" (3D) or "the interface" (2D). As such, the two top-level buckets tend towards polling, which then validate and turn the input into specific dispatches, as you've described. I tend to divide them only because the respective buckets have better access to 2D-/3D-specific implementation details. i.e. CheckCollision(Vector2) vs. CheckCollision(Ray) | |
| Apr 23, 2015 at 16:25 | history | answered | Naros | CC BY-SA 3.0 |