A simplified version of pokemon! Player 1 battles Player 2 for a fight to the death victory.
Each player takes turns choosing 5 different pokemon. Once completed, press battle to begin. Choose your pokemon and make an attack. Then the other opponent will do the same. Be careful not to get attacked or you can watch your health points get deleted. Play the game until all you have killed all 5 of the opponents pokemon.
- A
Pokemonconstructor function creates new pokemon that have name, health , magic and a bunch of skills. - An
AttackSkillconstructor creates new attacks. Attacks consumes the pokemon's magic to cause damage to other pokemons. Each individual pokemon has a specific set of attacks. TheAttackSkillmethod takes in three arguments: the name of the attack, the amount of damage the attack does, and the amount of magic the attack requires. - A pokemon has no skills when created. it uses the method
learnAttackSkillto learn a new skill.learnAttackSkilltakes an attack object as an argument. The specific attacks are created using theattackSkillconstructor function, and then internally added to that Pokemon's 'skills' array. Here is an example of first creating a skill, then adding it to a Pokemon:var lightning = new AttackSkill("lightning", 40, 30); pikachu.learnAttackSkill(lightning); - Each pokemon has a method called
showStatusthat logs its status (how much health, magic left) - Each pokemon has a method called
attackwhich picks one of the pokemon's attack skills to attack another pokemon. This is its most important method! - A method called
getMagichelps your pokemon add some magic back to your Pokemon.
A simple website (using HTML, CSS, and jQuery) that lets two people battle each other.