In these tutorials we'll write an old skool adventure game. You can use these games to explore all kinds of things, from walking round your neighbourhood during a historical time, to bringing your favourite book or film come to life, to helping people confront their fears or explore decisions they need to make.
We're going to build a game set set in a dungeon - the kind of Dungeons and Dragons thing they played on Stranger Things. Even if you don't like fantasy games, work along for the moment; I promise, we'll come to making your own game once we've got the core ideas down.
So, let's start our game. We already know the most important part: the "print
" statement, which puts text on
the screen:
print("hello world")
We call text in coding a string because it's a set of letters (or, as we call them, characters) strung together. We put the string we want printing in parentheses "()" after the print command. It's quite common to send information to commands by putting itt in parentheses like this.
We can use print statements like this to tell a story.
Change your code so it prints "---Welcome to the game---".
Once you've got that working, move on to look at "print" in more detail...