!Pokémon or (Not Pokémon)
Tags: cpp, pokemon, game
Published: 2018-03-22 00:50:01

---
title: !Pokémon or (Not Pokémon)
published: true
description: C++ managed university project
tags: cpp, pokemon, game
---

######Not Pokémon (Pun intended)
A managed C++ Windows Forms game as my university project.

*By just showcasing this game in Computing, Electronics, and Mathematics Showcase NEW WIZARDS 2018, I wanted to put it here as well.*

Over the span of 8 weeks, we had to make a game in c++, alongside starting to learn c++ from scratch at the same time. 

What surprised me was - I did a lot of research making the game and every week we got introduced a new topic in university, I had already implemented the same concepts in the game. Starting from pointers and references to classes, structures and how to put those in a set.

I took the role as the project leader and led a group of 5 people. We took inspiration from Pokémon games, but funny enough - non of us had ever played an actual Pokémon game, we just had a brief idea of how the mechanics worked.

Non the less, I did have an awesome team:
-    *First one was responsible for Login/Register system;*
-    *Second one made an SQL database;*
-    *Third one made graphics and sounds to bring the game to life;*
-    *Fourth one implemented a shop system;*
-    _While I made classes for every object, a fight system, A* path finding algorithm, a map and a map creator._

![Login](https://thepracticaldev.s3.amazonaws.com/i/il2cicc1t4yt2fp40axi.PNG) 

After login you get presented with the info screen, which let's you select a Pokémon and so on... If you've gotten this far, that means you can read and I don't need to list all the buttons.

![Info](https://thepracticaldev.s3.amazonaws.com/i/h47cgjw29a8g0wy0qygz.PNG) 

The next big step comes after *"Start game"*. You get presented with a map dialog with a players character, a few enemies and obstacles such as trees. Since we wanted to implement some cool algorithms, we chose that the movement would work with a mouse double click on the screen, rather than just the arrow keys. It then uses A* path finding algorithm to find a route between your current location and the click, avoiding obstacles on the way.

![Map With Picture](https://thepracticaldev.s3.amazonaws.com/i/olpwx9xoa9at6hu6wrr3.png) 

Underneath the picture overlay, there are drawn boundaries to permit movement over obstacles. We toggle the picture with a *Shift* key and see the magic happening.

![Map with Obstacles](https://thepracticaldev.s3.amazonaws.com/i/gjt0ggac0fi1jcl7p5fi.PNG) 

I made a drawing system which I talk about [here.](https://dev.to/jansonsa/windows-forms-paint-effect-c--j27) So you can choose a brush and draw by holding down the left mouse button or erase with the right mouse button. You then save the map locally by specifying a unique name and it's turned in to a *.txt* file that contains every coloured block and it's colour. Inefficient, but easy to understand.

This is a simple demonstration of how the A* algorithm works. It finds a good enough route fairly fast and that is exactly what we need in a game.

![A Star](https://thepracticaldev.s3.amazonaws.com/i/5t0o6cjblypt3g990xl9.png)

Check out more on A* implementation [here.](https://dev.to/jansonsa/a-star-a-path-finding-c-4a4h)

**In conclusion,** this has been a fun experience learning a new language by making a game. As a gamer myself, I found it easy to learn while working on something you enjoy, as well as I perfected my skills using Visual Studio making much use of *Peek function* or *Debug* with breakpoints. Not to mention the things I learned being a Project Manager and what it means to keep track of the project's current status and assigning tasks, while also making documentation.


[Download](https://github.coventry.ac.uk/jansonsa/D1/raw/master/NotPokemon.zip) the game and try it out yourself or see the GitHub repository [https://github.coventry.ac.uk/jansonsa/D1](https://github.coventry.ac.uk/jansonsa/D1)