Introduction
Creating your own game is an exciting way to practice your programming skills. Games rely heavily on processing user input to make dynamic decisions. Every game must also have a set of defined rules that determine actions and events in the game.
Suppose you want to create your own game. You might not be ready to develop a fully featured game, so you decide to start as small as possible. You want to move a character across the screen and make it consume an object. The object consume can affect the state of the player. To keep the game going, you wanted to regenerate the object in a new location once it has been consumed. You decide that you'll need to use methods to keep your game code organized.
In this module, you'll develop the following features of a mini-game application:
- A feature to determine if the player consumed the food
- A feature that updates player status depending on the food consumed
- A feature that pauses movement speed depending on the food consumed
- A feature to regenerate food in a new location
- An option to terminate the game if an unsupported character is pressed
- A feature to terminate the game if the Terminal window was resized
By the end of this module, you'll create a playable mini-game application!
Note
This is a challenge project module where you'll complete an end-to-end project from a specification. This module is intended to be a test of your skills; there’s little guidance and no step-by-step instructions.
Learning objectives
In this module, you'll demonstrate your ability to:
- Use Visual Studio Code to develop a C# console application that uses methods to implement logical workflows.
- Understand existing code and make informed changes to design.
- Create return values and methods with required and optional parameters.
Prerequisites
- Experience using Visual Studio Code to develop, build, and run C# console applications that include console I/O and access the methods of .NET classes.
- Experience using C# data types including
int
,string
, and arrays - Experience using
switch
statements, if-else statements, andfor
loops - Experience using the
Random
class to generate a random number. - Basic understanding of C# methods