Code Monkey home page Code Monkey logo

js-battle's Introduction

#js-battle Your mission is to create an arena where two characters battle. Each character has properties that determine its effectiveness.

##Character Requirements

  • Name
  • Attack (The base attack value)
  • Defense (The base defense value)
  • Health (Starting/Max health)

##Character Stretch

  • Attack 1 (An attack that has a 70% chance to launch and does (Attack x1) damage)
  • Attack 2 (An attack that has a 25% chance to launch and does (Attack x2)damage)
  • Special Attack (An attack that has a 5% chance to launch and is does (Strength x6) damage)
  • Last Words (A phrase that is displayed when the fight is over)

##Arena MVP

  • Calculate the damage that a particular attack would do using the following formula:
damage = 50 * (attack/defense) * effectiveness

attack = an attack value defense = the opponent's defense value effectiveness = the effectiveness of the attack based on the type matchup (see explanation below)

  • Attacks can be super effective, neutral, or not very effective depending on the matchup. For example, water would be super effective against fire, but not very effective against grass.
Super effective: 2x damage
Neutral: 1x damage
Not very effective: 0.5x damage

Here is an example of effectiveness of each matchup:

fire > grass
fire < water
fire = electric
water < grass
water < electric
grass = electric

  • Any type against itself is not very effective. Also, assume that the relationships between different types are symmetric (if a is super effective against b, then b is not very effective against a).

  • Log all events in the console

    • Events are as follows: Characters entering battle, attacks(displaying name, health, attack, last words)
  • Invoke the fight function with the two characters as input

##Arena Stretch

  • Print events to HTML
  • Have a turn by turn attack environment
    • Have buttons that can initiate attacks
  • Have images to represent characters and attacks
  • Use CSS to have the arena look like a Gameboy (screen, A button, B button, Start, and numpad)
  • Use HTML forms to add new characters to the arena

##Reminder

  • This is a creative exercise that is meant to be fun!
  • Use your imagination but stick to the core principals of the exercise

##Work Flow

  • Understand the problem
  • Devise a plan
  • Carry out the plan
  • Look back

js-battle's People

Contributors

chrisman avatar bpjackson avatar

Watchers

James Cloos 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.