JavaScript Pokemon Game

Hey, coders, today’s project is something I’ve been working on for a few days now, which is a pokemon game. It’s a simple game using the OG Kanto region starters minus Pikachu. I simply used the animation sprites from a pokemon database website

The first things set up was the HTML and CSS for the layout, then created 2 views for this project. The first view is the stage for choosing your character and the second stage is for battle.

Next was to create a function for when a user selects a pokemon, along with that came with a function to keep track of the game state. With those two things created I just had to create a function for the CPU to pick a pokemon as well.

Earlier I set up the two views of the game, this time I created a function to change stages when you click a character. After that, I had to set up the pokemon database which was just done in the Javascript code as an array nothing fancy. I got this information in the Pokedex of smogen as well.

Now with the database set up, I created a function for changing characters in the battle screen. Then I just cleaned the code a bit with better comments etc of each function that I described in this blog post.

This Pokemon game is a mix of rock, paper, scissors for the ease of battle logic. So I set up choosing attacks which are rock, paper, scissors and created the logic for which combinations win or lose.

One thought on “JavaScript Pokemon Game

Add yours

  1. Interesting project. Two things I really love: JS and Pokemon! Do you happen to have a repository for it? I’d be interested to take a look at the source code (if you don’t mind, of course). Cheers!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Up ↑

%d bloggers like this: