zydgyy at October 19th, 2011 04:13 — #1
I read a lot about,game is something like discrete events simulation,update a game world,just take the states at previous time t-dt,some events just happened right now at time t,and dt(time step) as imputs to update method,then the method use them to determine states at time t,use the new states at time t to go physics simulation,collision detection,and so on,and then render the new game world at time t,repeat this process until we want to exit!Update method just a event handler!
So do i think right?How do i implement this!Any suggestions?!
a new guy thank you!
alphadog at October 19th, 2011 16:25 — #2
I don't understand what you are asking. Are you asking how to implement an event-based architecture in a game?
fireside at October 19th, 2011 21:48 — #3
If you use an object oriented approach, you can put an abstract update in the base level object and extend all your classes from it. If they are in a collection of some type, you can cycle through them and update. Events are usually based on collision and input, or some type of alarm, and notify the objects. The objects make the appropriate response to the event in their own update function.