Project: Text Adventure
In this project we'll write our first game, a classic text adventure game. Text adventures were one of the first video games & have a historic place both in computer game history & computer science history.
By the end of this project you'll be able to:
- Learn about buffer overflows & how we can avoid them
- Learn about the struct type
- Add a game loop that will allow our program to keep running forever until the user quits
Lesson 1: Writing the entry point to our program & setting up the basic structure
In this lesson we setup a new project, add the main entry point to our program, make use of the printf & scanf functions & add a while loop (commonly called the game loop) that will keep our program running. We will also implement our own string match function, to see if two strings equal each other.
Lesson 2: Replace scanf with fgets, write a function to remove newline characters & add Room data structure
In this video we continue with our text adventure. We start by replacing scanf with fgets since it is more memory safe. We then implement a function that will remove the newline character at the end of fgets. We then lay the groundwork for creating rooms in our game.