297x Filetype PDF File size 1.60 MB Source: www.cs.cornell.edu
the
gamedesigninitiative
at cornell university
Lecture 8
Game Architecture
Revisited
Recall: The Game Loop
Receive player input
Update Process player actions
60 times/s Process NPC actions
= Interactions (e.g. physics)
16.7 ms Cull non-visible objects
Draw Transform visible objects
Draw to backing buffer
Display backing buffer
the
2 Architecture Revisited gamedesigninitiative
at cornell university
The Game Loop
Receive player input
Update Process player actions
Process NPC actions
Interactions (e.g. physics)
Almost everything is in loop
Draw Except asynchronous actions
Is enough for simple games
How do we organize this loop?
Do not want spaghetti code
Distribute over programmers
the
3 Architecture Revisited gamedesigninitiative
at cornell university
Model-View-Controller Pattern
Controller Calls the
• Updates model in methods of
response to events
• Updates view with
model changes
Model View
• Defines/manages • Displays model
the program data to the user/player
• Responds to the • Provides interface
controller requests for the controller
the
4 Architecture Revisited gamedesigninitiative
at cornell university
no reviews yet
Please Login to review.