Sample Video Frame

Created by Zed A. Shaw Updated 2024-11-15 13:50:32
 

20: First Game

In this exercise you will begin to write your very first game. This game will teach you how to use functions and if statements together. I am going to write half of the game, and then you must finish the game using my same style. You can finish the game in any way you want, so long as you have the same number of rooms and those rooms are in functions. It would be a good idea to make sure that you completely understand the game as I have written it before you begin to write your additions.

The Code

Remember that this code is not complete. I start you off with the basic code you need to make the game work, the first room, and how to select random hit points. After that you create your rooms similar to mine.

View Source file code.js Only

Previous Lesson Next Lesson

Register for Learn JavaScript the Hard Way

Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.