Event and Input Managers

By Austin Leskin


For this week I put a hold on working on AI and started working on the Event Manager and the Input Manager. In the event manager I created a system where if a key is pressed I send out an event to whoever subscribed to it, at that point the class that is subscribed will take the key code that I passed to them and do what they want with it, such as moving the camera and player. In creating this system I got to learn about some cool functions such a std::function, std::bind, and std::placeholder. When making the input manager I set up some bit sets that hold the previous frames key bools (whether they where pressed or not) and the current. Based on that I sent out 3 total events, KeyDown, OnKeyDown, and OnkeyUp. I also got to use Gatwares Ginput class know when a key is pressed.

Comments

Popular Posts