02 03 04 05 06 07 08 09 10 11 12 13 14 15 16

Nov 14, 2014

First week of programming: Making a text adventure game

The programming course has begun. Since I already know most things taught in class, I decide to brush up on the subject in my own way.

The lectures we've had this week mainly consisted of learning control statements like the for statement which loops and the if statement which checks for certain conditions. This is basic stuff I learned in high-school, so I did a little exercise of my own.


This is my text adventure game. It doesn't have a name and is still a work in progress, but it works! The main features I use in the game is switch statements, which looks at where the player wants to go and sends him/her on their way to that part.
EXAMPLE: "Where do you want to go?" "1. Left, 2. Right" input=1, goto left.

The second feature I use is the if statements, which triggers at certain choices if the player has visited other locations.
EXAMPLE: if(Player_has_visited_left) then he goes right.

It's a simple game with simple code. It's not the most optimized and there are a lot of manual edge cases. But that's where the next part comes in. I'll keep this going throughout the weeks, adding new things every week.

See you next week!

No comments:

Post a Comment