Академический Документы
Профессиональный Документы
Культура Документы
Initialization
Instantiate graphics device
manager object.
Update()
called once per
frame
HandleInputs()
Checks for user
exit from program
UpdateMenuScreen()
No Yes
Displays options to Is network session
UpdateNetworkSession()
create/join a active?
systemlink game
base.Update()
calls Draw() which draws the
current game state onto the screen
UpdateMenuScreen()
Is game active? No No No
Is there a signed in local
(not minimized & input Is A key pressed? Is B key pressed?
gamer?
focus)
RETURN
If host
networkSession.Update()
For each UpdateServer()
UpdateNetworkSession() updates the state of the multiplayer
LocalNetworkGamer update simulation on server
session.
and send updates to clients
UpdateLocalGamer()
read player inputs and Is Host?
send to server
ServerReadInputFromClients() ClientReadGameStateFromServer()
Server reads network packets from Client reads network packets from the
clients(user updates) and stores the updates server that contain current state of each
on the corresponding gamer.tag object gamer.tag object. The client then updates
(does not simulate with new inputs yet) the gamer.tag objects.
RETURN