I am new to game design.
For multithreading, is this the way its done?
class SomeGame
{
data
constructor
threaded methods
}
In the constructor you call the methods to set the application's initial data state and play any intros that you need to and start the threaded methods.
In the data section you create lists for sound effects, songs, game objects, effects, and other game data.
The threaded methods are the individual processes with their own responsibilites. Sounds, Music, File I/O, User Interface, Camera, continuous calculations(like position calculations).
I'm an trying to understand the overall program structure. I know in XNA we have an update method and a draw method. Would it be practicle to spin off threaded methods so that we can have multiple updating methods like explained above? And, can we do away with the update then draw routine and instead spin off draw into its own thread that is either triggered or monitors the game data and renders the new scene as the data is updated?
in XNA for windows, is this possible:
class Game
{
// data
list: game objects (could be multiple lists for different types)
list: sound effects
game time
music file
general lighting data
other game state data...
// Methods
initialize method
thread: dynamic load content
thread: dynamic unload content
thread: built-in Update( updates gametime)
built-in Draw(empty or removed from the game loop)
thread: user interface reader
thread: sound effect player
thread: music player
thread: camera
thread: NPC AIs
thread: draw
etc.
}
Would this be a good design and is it possible with XNA?
James Tyler