Part II. C# Lab: The Quest

Name:

____________________

Date:

____________________

This lab gives you a spec that describes a program for you to build, using the knowledge you’ve gained over the last few chapters.

This project is bigger than the ones you’ve seen so far. So read the whole thing before you get started, and give yourself a little time. And don’t worry if you get stuck—there’s nothing new in here, so you can move on in the book and come back to the lab later.

We’ve filled in a few design details for you, and we’ve made sure you’ve got all the pieces you need...and nothing else.

It’s up to you to finish the job. There are too many ways to build this lab for us to you a “right” answer. But if you need a hint, other readers have claimed their bragging rights by publishing their solutions on CodePlex, GitHub, and other collaborative source code hosting sites.

The spec: build an adventure game

Your job is to build an adventure game where a mighty adventurer is on a quest to defeat level after level of deadly enemies. You’ll build a turn-based system, which means the player makes one move and then the enemies make one move. The player can move or attack, and then each enemy gets a chance to move and attack. The game keeps going until the player either defeats all the enemies on all seven levels or dies.

It’s possible to build Windows Desktop programs that automatically scale to any size display, but that’s beyond the scope of what we’re teaching. (You’ll learn all about how to do that ...

Get Head First C#, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.