Git Product home page Git Product logo

dueling-wizards's Introduction

Dueling Wizards

This is a variation of a basic, computer-game version of the hand game Rock, Paper, Scissors (also known as Rochambeau or as Stone, Paper, Scissors). The wizard name Osmanwic referenced in the game's introduction paragraph is a partial anagram of Mac Win OS.

Motivation

Using HTML, CSS, and JavaScript, to create a simple game in the DOM that is two player (the player versus the computer), has a win state and lose state, and includes multiple rounds.

Wireframe

dueling-wizards-wireframe

(back to top)

Damage Table

dueling-wizards-damage-table

(back to top)

Build With

HTML5 | CSS3 | JavaScript

(back to top)

Tools Used

Visual Studio Code | GitHub

(back to top)

Approach Used

First in the global scope, the game's default values are assigned to variables--ie, for the Player's and Computer's Health Levels (16 each) and the number of rounds remaining (5)--, variables are declared for HTML elements that will be manipulated, event listenrs are added to the Spell Buttons, and the Play Again button is hidden with document.querySelector('.playAgainButton').style.display = 'none';.

Game play is all within a single function. The Play Again button's event listener is added within that function. Also within the function is the condition statement to end the game, if (roundsRemaining === 0) and relevant end-of-game code, eg, making making the Play Again button appear.

(back to top)

Live Site

Dueling Wizards

Enhancements Roadmap

  • Add a button the player can click to disable spell sound effects.
  • When the game ends, reduce opacity property of Spell Buttons to ~0.6 to show the buttons are disabled.
  • Add an alternative game-ends condition of when Player or Computer's Health Level is <= 0, and increase default Health Levels and default Rounds Remaining, so that Computer or Player death is possible, with the appropriate alternative gameResult text printed to the DOM.
  • Enhance the styling. Eg,
    • adding emoji or animated GIFs for the Elemental categories;
    • replace Damage Table image file with a dynamic table, eg, the table cells corresponding to the round's userSpell and, after a slight delay, computerSpell change background color, as does, after a second slight delay, the appropriate cell that states the damage.
  • Add a Spell Conduit choice; user selects Scroll, Wand, Staff, or Amulet, which is compared against the Computer's randomly selected Conduit and Health Points deducted in accordance with a Conduit Power Table. Default Health Levels should be raised since the potential total damage per round will be a larger number by introducing the Spell Conduit choice. Player and Computer Conduit choices and damage would need to appear in the DOM.
  • Add a way for the Player to choose when to drink a potion that increase Health Level. (Possibly randomize the Health Level increase as 1, 2, or 3 Health Level points.) Randomize Computer decision as to whether or not, in each round, the Computer drinks the potion.

(back to top)

Contribute

Suggestions for enchancements are welcome! Simply open an issue with the tag "enhancement". Please give the project a star...I would be very grateful! Thank you!

(back to top)

Contact

Scott Isebrand - @isebrand

Project Link: https://github.com/ScottIsebrand/dueling-wizards

(back to top)

Acknowledgements/Credits

Design

Fonts:

  • Balthazar. Google Fonts. Accessed February 28, 2023.

Background Image:

Flickr

Audio

Freesound.org [Creative Commons 4.0]

Code

GeeksForGeeks

Stack Overflow

Wireframe

Figma

README.md:

Template:

Badges:

(back to top)

dueling-wizards's People

Contributors

scottisebrand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.