Skip to content

A text-based RPG game where you must defeat the dragon that is preventing people from leaving the town. Created as part of the FreeCodeCamp JavaScript Algorithms and Data Structures certification.

License

Notifications You must be signed in to change notification settings

mihailocv/RPG-freecodecamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dragon Repeller

Welcome to Dragon Repeller, a text-based RPG game where you must defeat the dragon that is preventing people from leaving the town. This project was created as part of the FreeCodeCamp curriculum for the JavaScript Algorithms and Data Structures certification.

Project Description

JavaScript is a powerful scripting language that you can use to make web pages interactive. It's one of the core technologies of the web, along with HTML and CSS. All modern browsers support JavaScript.

In this practice project, you'll learn fundamental programming concepts in JavaScript by coding your own Role Playing Game. You'll learn how to work with arrays, strings, objects, functions, loops, if/else statements, and more.

How to Play

In Dragon Repeller, you navigate through different locations, fight monsters, manage your resources, and ultimately aim to defeat the dragon. The game is controlled using three buttons that allow you to make decisions and take actions.

Starting the Game

You begin the game in the town square with the following initial stats:

  • XP: 0
  • Health: 100
  • Gold: 50
  • Weapon: Stick

Locations

  1. Town Square: The starting point of your adventure.

    • Options: Go to store, Go to cave, Fight dragon
  2. Store: Buy health or weapons.

    • Options: Buy 10 health (10 gold), Buy weapon (30 gold), Go to town square
  3. Cave: Fight different monsters.

    • Options: Fight slime, Fight fanged beast, Go to town square

Actions

  • Buy Health: Purchase 10 health points for 10 gold.
  • Buy Weapon: Purchase a new weapon for 30 gold (if available).
  • Sell Weapon: Sell your current weapon for 15 gold (if you have more than one weapon).
  • Fight Monsters: Engage in combat with different monsters (slime, fanged beast, dragon).
  • Attack: Attack the monster with your current weapon.
  • Dodge: Attempt to dodge the monster's attack.
  • Run: Escape the fight and return to the town square.
  • Easter Egg Game: Guess a number and see if it matches one of the randomly chosen numbers to win gold or lose health.

Project Structure

  • index.html: The main HTML file that contains the structure of the game.
  • styles.css: The CSS file that styles the game.
  • script.js: The JavaScript file that adds functionality to the game.

Learning Outcomes

By completing this project, you will:

  • Gain a deeper understanding of fundamental programming concepts in JavaScript.
  • Learn how to work with arrays, strings, objects, functions, loops, and if/else statements.
  • Understand how to manage game state and user interactions.
  • Learn how to dynamically update the user interface based on the current state.

Acknowledgements

This project is part of the freeCodeCamp curriculum. For more information, visit freeCodeCamp.

About

A text-based RPG game where you must defeat the dragon that is preventing people from leaving the town. Created as part of the FreeCodeCamp JavaScript Algorithms and Data Structures certification.

Topics

Resources

License

Stars

Watchers

Forks