Submission 1: Input and Output
Objective:
Establish the foundation of your text-based adventure game by focusing on input and output operations. This week aims to familiarize you with how to interact with the user through the console, a fundamental skill in programming. You'll learn how to display messages to the player and receive input from them, setting the stage for interactive gameplay.
Instructions:
Game Introduction:
Display a Welcome Message:
Craft a friendly and engaging welcome message to greet the player when the game starts. This message should set the tone for the adventure and capture the player's interest.
Introduce the Game's Setting:
Provide a brief narrative that immerses the player in the game's world. Describe the environment, the overarching theme, or any backstory that is relevant to the adventure.
Player Interaction:
Prompt for the Player's Name:
Ask the player to enter their name using a clear and inviting prompt. This personalizes the game experience and makes subsequent interactions more engaging.
Greet the Player:
Use the player's inputted name to address them directly in a greeting message. This enhances the connection between the player and the game.
Initial Choice:
Present a Simple Scenario:
Create an opening scenario where the player must make a decision that influences the direction of the game. This choice should be clear and straightforward, offering two distinct paths or options.
Read and Store Player's Choice:
Accept the player's input for their choice and store it in an appropriate variable. Ensure the prompt is easy to understand so the player knows how to respond.
Display Choice Confirmation:
Acknowledge the Player's Choice:
Confirm the player's selection by displaying a message that reflects their decision. This feedback assures the player that their input was received and sets expectations for what comes next.
Submission Requirements:
A C++ program that compiles and runs without errors.
Utilizes console input and output to interact with the player.
Source code is well-commented to explain the purpose of each section.
The program is neatly formatted to enhance readability.
By completing this code, you've set the groundwork for your text-based adventure game. This is a solid starting point for the enhancements and features you'll add in the coming submission.
Example Output:
Starter Code:
// Section One - Course Project
// Created by <Your name> on <date>.
// Purpose: This code displays a welcome message, introducing the game's setting, interacting with the
// player to get their name, presenting an initial choice, and confirming the player's selection.
#include <iostream>
#include <string>
using namespace std;
int main() {
// Variables for Program
// Display a Welcome Message
// Introduce the Game's Setting
// Prompt the user for the Player's Name
// Greet the Player
// Present a Simple Scenario
// Read and Store Player's Choice
// Display Choice Confirmation
return 0;
}
COSC-1336 / ITSE-1302 Computer Science - Author: Dr. Kevin Roark