GithubHelp home page GithubHelp logo

pokemilton-oop's Introduction

Pokemilton is a JavaScript-based terminal game inspired by Pokémon. This project was developed solo by [votre nom] as a 5-day challenge to learn object-oriented programming principles.

Game Overview

Pokemilton allows players to:

Choose and train a Pokémon.
Battle against computer-controlled opponents.
Explore different locations within the game world.
Capture wild Pokémon and add them to their team.

#####The objective is to become a Pokémon Master by defeating gym leaders and ultimately challenging the Elite Four.

Technologies Used

JavaScript: Implemented using object-oriented programming (OOP) principles.
Terminal: Runs entirely within the command line interface.
Node.js: Used for environment setup and running JavaScript files.

Features

Player and Pokémon Classes: Object-oriented design for defining player actions and Pokémon attributes.
Turn-Based Battles: Combat system with attack moves, health points (HP), and status effects.
Location Navigation: Ability to move between different game locations.
Capture Mechanism: Random encounters and capture mechanics for wild Pokémon.

Screenshots

image image

Here is the exercise statement for the task.

Review Assignment Due Date

POKEMILTON™™ Challenge

Overview

Welcome to the Pokemilton™ Challenge! In this challenge, you will be creating a simplified version of the classic Pokémon game, running in the terminal. Your task is to define a JavaScript class called "Pokemilton™" with specific attributes and behaviors.

The Goal of this challenge is to provide you with a canvas for you to apply what we learned so far in the bootcamp.

It will serves are a way for you to practice your skills and to show me what you can do.

So, please go the extra mile and have fun!

Part one, The Pokemilton™ class.

In your coding adventures you will encounter many diferent Pokemilton™S™. they will be your best friends and be able to fight for you!

Class: Pokemilton™

A Pokemilton™ is a unique creature with the following attributes:

  • Name: Generated by combining two students' names randomly (provided in an array) EG => Nico & Diogo can create "Dico" or "Nigo".
  • Level: Starts at 1.
  • Experience Meter: Starts at 0.
  • Attack Range: Randomly generated between 1 and 8.
  • Defense Range: Randomly generated between 1 and 3.
  • Health Pool: Randomly generated between 10 and 30.
  • Catch Phrase: A unique string.

A Pokemilton™ has the following behaviors:

  • Attack: A Pokemilton™ can attack another Pokemilton™. The damage done is a random number between the attacker's attack range times its current level and reduced by the defender's defense range. The defender's health pool is reduced by this amount.
  • Gain Experience: A Pokemilton™ can gain experience. The experience meter is increased by a random number between 1 and 5 times the opposite Pokemilton™'s level.
  • Catch Phrase: A Pokemilton™ can say its catch phrase.
  • Evolve: When the experience level of a Pokemilton™ equals its current level times 100, it can evolve. This increases its level by 1 and increases its attack range, defense range, and health pool by a random number between 1 and 5.

Part Two, Become the ultimate Pokemilton™ master!

Class: Pokemilton™Master

A Pokemilton™Master is a person who has a collection of Pokemilton™s. It has the following attributes:

  • Name: The name of the Pokemilton™Master.
  • Pokemilton™ Collection: An array of Pokemilton™s.
  • Healing Items: a number of healing items.
  • Revive Items: a number of revive items.
  • JOHNEBALLS: a number of johneballs.

A Pokemilton™Master has the following behaviors:

  • Heal Pokemilton™: A Pokemilton™Master can heal a Pokemilton™ in its collection. This restores the Pokemilton™'s health pool to its original value.
  • Revive Pokemilton™: A Pokemilton™Master can revive a Pokemilton™ in its collection. This restores the Pokemilton™'s health pool to its original value.
  • Catch Pokemilton™: A Pokemilton™Master can catch a Pokemilton™. This adds the Pokemilton™ to the Pokemilton™Master's collection.
  • Release Pokemilton™: A Pokemilton™Master can release a Pokemilton™ from its collection. This removes the Pokemilton™ from the Pokemilton™Master's collection.
  • Show Collection: The Pokemilton™Master's collection is displayed in the console.

Part Three, The Pokemilton™ World!

Class: Pokemilton™World

A Pokemilton™World is a place where Pokemilton™Masters can battle each other. It has the following attributes:

  • day: the current day.
  • logs: an array of strings that represent the events of the day.

A Pokemilton™World has the following behaviors:

  • One Day Passes: The day is increased by 1.
  • addLog: A string is added to the logs array. with the structure: "Day ${day}: ${log}". Each time that a console.log is showned to the user, it should also be saved in the logs

Part Four, let's start the game.

Let's use the classes we created to start the game! Our game will be only running in the console, so we will need to handle all the interactions with the user.

First, let's create a Pokemilton™World.

then, let's create a Pokemilton™Master. We will use the name of the user as a parameter.

The terminal will ask the user what's his name and create a Pokemilton™Master with that name.

Then it will present the the User with Three random Pokemilton™ and ask the user to choose it first Pokemilton™.

Screen-01.mov

After that the game will start, but before, let's create a save state so that we can quit and load the game.

Part Four the Save.json file

We will generate a save.json file that will contain ourr data for each step of the way.

After the User chooses his first POKEMILTON, the game will save the state in the save.json file.

under the following format:

{
	"saved_on": "2020-04-29T15:52:00.000Z",
	"PokemiltonMaster": {
		"name": "John",
		"pokemilton™Collection": [
			{
				"name": "JohnJohn",
				"level": 1,
				"experienceMeter": 0,
				"attackRange": 6,
				"defenseRange": 2,
				"healthPool": 14,
				"catchPhrase": "I'm JohnJohn!"

			},
		],
		"healingItems": 0,
		"reviveItems": 0,
		"POKEBALLS": 0
	},
	"day": 1,
	"logs": [
		"JohnJohn has been added to your collection!",
	]
}
Screen-02.mov
image-01

Part Five, let's load the game.

When starting a new game by running the command

node Game.js

We want to be sure to be offered the possibility of loading a previous game. If there is a save.json file, the game should ask the user if he wants to load it. if the user says yes, the game should load the save.json file and start from where the user left off. if the user says no, the game should start from the beginning.

Screen-03.mov

Part Six, A normal day in Pokemilton™Town

We will add a new behavior to the One Day Passes method of the Pokemilton™World class. each day, different actions will take place. First the Pokemilton™Master will be asked what he wants to do. The user will have the following options:

  • Heal Pokemilton™ (use one healing item to heal one Pokemilton™ to full health)
  • Revive Pokemilton™ (use one revive item to revive one Pokemilton™ to half health)
  • realease Pokemilton™ (release one Pokemilton™ from the collection)
  • rename Pokemilton™ (rename one Pokemilton™ in the collection)

After the user chooses an option, the game will ask the user to choose a Pokemilton™ from his collection.

After that, the game will generate a random event that will take place. for now these events will be:

  • Nothing happens today, the day passes.
  • A wild Pokemilton™ appears! (the user will be asked if he wants to fight it)
  1. if nothing happens, the day passes saves the data and the one day passes method is called again.

  2. If a wild Pokemilton™ appears, the user will be asked if he wants to fight it. if he says yes, the game will generate a random Pokemilton™ and start a fight.

Part Seven, let's fight! Class: Pokemilton™Arena

  • When A Pokemilton™Master fights a wild Pokemilton™, the game will create a Pokemilton™Arena and start the fight. each fight will be divised in several rounds:
  1. First the Wild Pokemilton™ will introduce itself to the user by telling.
A wild level X, XXXXXXX Appears, it has XX Health
  1. The user will be asked to choose a Pokemilton™ from his collection to fight the wild Pokemilton™.

  2. Once the user chose a Pokemilton™, the fight will start. Each round will be divised in two steps:

  3. The Pokemilton™Master will choose an action for his Pokemilton™. the options are: a. Attack (the chosen Pokemilton™ will perform an attack on the wild one) b. Try to catch (the master will try to catch the Pokemilton™ using one of his JOHNEBALLS, to know if he catches it you need to calculate the probability, and the probality is relative to its health EG => A Johnson with 20% of health remaining will have 80% chance to be catched) - if the Pokemilton™ is catched, the fight ends, if not, the wild Pokemilton™ will attack the Pokemilton™Master. c. Run away, it ends the fight.

  4. The wild Pokemilton™ will attack the Pokemilton™Master's Pokemilton™.

  5. The round ends, and the game will check if the fight is over, if not, it will start a new round.

  6. If the fight is over, the game will display the result of the fight, perform the gain experience action and save the data.

Sans.titre.mov

Notes

  1. I've provided you with a bunch of files and starter code, feel free to use it or not. You can change the names of files delete files, same for functions

  2. There's no tests for this challenge, my goal is to see how far you can go using all that we have seen so far.

Class Diagram of the game:

classDiagram

Bonus

Please feel free to add as many feature you want: but if you need inspiration:

  • After a certain level a Pokemilton™ evolve.
  • add more items to the game.
  • add more actions to the Pokemilton™Master.
  • add more events to the Pokemilton™World.
  • add more actions to the Pokemilton™Arena.
  • add some music that runs when you play the game.
  • add some colors to the console.
  • add some images to the console.
  • add some animations to the console.
  • add some sound effects to the console
  • add multiple attacks to each Pokemilton™.
  • add some special attacks to each Pokemilton™.
  • add a rarity system to the Pokemilton™.

pokemilton-oop's People

Contributors

dranhoc avatar

Watchers

 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.