December 2004
Beginner
432 pages
10h 17m
English
Before you create the player object, do you remember back a few chapters ago when you were first rendering the sky box for the level? Well, the code is probably still there in the OnCreateDevice method of the game engine, but that probably isn't where it should be. You don't need to create the sky box, or the player, or the level until the user selects the character he will be using in the game. You left the event handler for this user interface screen “empty” before, so you should fill it now, using the method in Listing 9.1.
private void OnLoopySelected(object sender, EventArgs e) { SelectLoopyScreen screen = sender as SelectLoopyScreen; System.Diagnostics.Debug.Assert(screen ... |
Read now
Unlock full access