Hello,
I am wondering how to structure a game using Irrlicht. Let's say the game loop contains these functions
UpdatePlayer()
UpdateMap()
UpdateNPCs()
UpdateDisplay()
Where should they be placed?
The use of callbacks for input etc makes me confused as to where to put things. eg, should I read from the keyboard somehow during UpdatePlayer, or should I respond to a callback event in the callback class?
I would find the source to even a very simple game very helpful.
How to structure a game with Irrlicht?
-
- Posts: 64
- Joined: Mon Sep 08, 2003 8:21 am
- Location: Paris, France
Hi,
Updates can be conditionned by :
- time
- events
- actions
you don't put updates in the same place together with this theory.
for example :
A timer bomb is linked by time, in this case the periodic update is necessary.
A displacement of player is conditionned by the events of keyboard, periodic update is useless in this case.
That why, i think that irrlicht framework is really good, you have :
- a event receiver function
- a main loop (while(device->run())
It's really important to write your idea on paper, make a diagramm is important too, and check the interaction between class...
bye
Updates can be conditionned by :
- time
- events
- actions
you don't put updates in the same place together with this theory.
for example :
A timer bomb is linked by time, in this case the periodic update is necessary.
A displacement of player is conditionned by the events of keyboard, periodic update is useless in this case.
That why, i think that irrlicht framework is really good, you have :
- a event receiver function
- a main loop (while(device->run())
It's really important to write your idea on paper, make a diagramm is important too, and check the interaction between class...
bye
-
- Posts: 64
- Joined: Mon Sep 08, 2003 8:21 am
- Location: Paris, France
-
- Posts: 64
- Joined: Mon Sep 08, 2003 8:21 am
- Location: Paris, France