BosseBL

Members
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

102 Neutral

About BosseBL

  • Rank
    Newbie
  1. So I have started working on a light weight "engine" to help me design a game easy and got an idea that I want some guidance with. To explain my idea, let us take an input manager for example. I would like to be able to store events and functions together in the following way: class InputManager { private: map<int eventID, void(*function)()> eventActions public: void bind(int eventID, void(*function)()); void handleEvent(); }; so that I can write the actual game code in the form of a bunch of functions that I can bind to an event. Then all I have to do is call the handleEvent(), and it will detect events and call their corresponding function. What I don't get is how I would go by and organize the code so that all functions I write has access to all the resources like TextureManager, SoundManager, EntityManager. Is this possible to do? Is it a good way of coding games? Can I do it better differently? thx for all the answers and sorry for a somewhat misleading title.