Building XNA 2.0 Games- P3: I would like to acknowledge John Sedlak, who saved this book from certain doom, as well asall of the great guys in the XNA community and Microsoft XNA team, who helped me with allof my stupid programming questions. (That is actually the term used—“stupid programmingquestion”—and it is a question that one should not have to ask if one has been approached towrite a book about the subject.)
Nội dung trích xuất từ tài liệu:
Building XNA 2.0 Games- P3 CHAPTER 3 ■ PLANNING YOUR GAME 47 We have some very rough mockups of a hero and some combat. Let’s round this out witha level mockup. We inadvertently created a protagonist who looks just made for a zombie-smashing epic.This means that zombies are bound to be the antagonists, and high-octane wrench-and-revolversmashing will become the game play. The setting, keeping in line with a game that is just makingitself at this point, will have to be a cemetery, as shown in Figure 3-6.Figure 3-6. Concept art: maps There we have it! We think we’ve pretty much nailed the look and feel of this game withminimal effort. We haven’t gotten into power-ups, enemy design, specific maps, health, deathand dying, or any of that fun stuff, but we’ve made tremendous headway. The details will fallinto place eventually.Tool PlanningSo far, we’ve made some basic decisions about how the game will look and feel, but in order toget one step closer to actually building the game, we need to broach the concept of tools. Toolswill help us be more efficient at developing new level and character designs, and implantingthem into the game without the need to change source code. Creating tools can be essential inthe later stages of a game’s development cycle, since they allow you to focus on what reallymatters: the drooling, brain-eating, out-to-get-you zombies! The next couple of chapters will be specifically on creating the tools we’ll be using, andeven beyond that, we’ll be tweaking them as new needs arise. In the meantime, we’ll need to bepretty clear on the data formats for the two areas where we’ll be creating all of the content:characters and maps.48 CHAPTER 3 ■ PLANNING YOUR GAME Map Editor Because we are building a tool, we can go back to a more event-based model, where the appli- cation waits for the user to do something before proceeding. Since we are designing a tool that can handle the generation of maps, it makes sense to model it after a jigsaw puzzle. Much like with a jigsaw puzzle, we’ll drag pieces from a bin area to the map area, fitting them in just where they need to be. In the mockup of the map editor, shown in Figure 3-7, you can see the map, minus the bounding boxes, as it should be rendered on the left side, and the map segment palette on the right side. The map is composed of map segments that are dragged and dropped, allowing us to give the map a more organic feel than if we used a 16-bit-era grid. Figure 3-7. Concept art: map editor Character Editor The character tool format will use a concept similar to the map editor. We’ll divide the characters into parts, like arms, torsos, legs, and so on, and then create frames of animation by combining parts. Figure 3-8 shows the character editor mockup. We’ll allow ourselves to rotate parts and move them around. This technique allows for some pretty flexible animation and is what was used in The Dishwasher: Dead Samurai game. Animations will be made up of frames, and we’ll throw in a scripting system for combos and animation control. We’ll dwell much more on this in Chapter 5, where we build the character editor, but this should suffice for planning purposes. CHAPTER 3 ■ PLANNING YOUR GAME 49Figure 3-8. Concept art: character editorNaming the GameGame naming is an aspect of planning that barely deserves its own section. For one thing, youdon’t even have to give your game a name yet.■Note When James created the solution for The Dishwasher: Dead Samurai, it was simply named ProjectDish1.Prior to The Dishwasher, there was ZSX3: Ninjastarmageddon (later renamed Manic Space), which wasoriginally called ProjectNova. Long story short: it doesn’t matter what you call your game, but giving it a ProjectX codename is always fun. Regardless, let’ go ahead and christen this project Zombie Smashers XNA.A Game PlanIt’s probably a good idea to formulate some approximate plan of attack before you blindlyjump into any development. Doing so will help organize your thoughts and prevent you fromfeeling overwhelmed. Here’s a rough rundown of the game plan for our Zombie Smashers XNAproject: • Create a map editor. • Create a character editor. • Create some map and character art. • Create some maps and characters.50 CHAPTER 3 ■ PLANNING YOUR GAME • Create the game. • Bring the map and character functionality into the game. • Add character movement and collision functionality. • Add combat functionality. • And take it from there! Now we have some structure. It is a little disheartening that we don’t get to the act ...