O'Reilly logo

Head First C#, 2nd Edition by Jennifer Greene, Andrew Stellman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. You can download an executable for this lab from the website...but we won’t give you the code for the answer.

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.

Note

The enemies get a bit of an advantage—they move every turn, and after they move they’ll attack the player if he’s in range.

image with no caption

The player picks up weapons...

There are weapons and potions scattered around the dungeon that the player ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required