top of page

Renpy

This was the first project that was given to me from my tutors. I was tasked in making a game in the software Renpy. Renpy is a visual novel engine and is usually used to create computer mediated storytelling. This game must have mechanics from the game series Pokémon. I personally really enjoyed this project as this was my first time programming a game and it was fun to learn the engine.

(Note all sprites or characters are used for educational purposes)

Mechanics

Battling

18 (1).png

Battling is the main mechanic in Pokémon. Each Pokémon has four moves is which it can attack, they can be used to deal damage or to defend themselves. In my version I didn’t add defending moves as I didn’t have enough time. To chose the Pokémon’s attacks I looked at moves that they can typically learn during a game of Pokémon, I then research the of damage that the attack can deal. The players Pokémon moves can be selected however the AI player will random select a move from it’s 4 moves. I tried my best to replicate how this works in Pokémon.

Changing Pokémon

image-149 (1).png

I’ve given the player six Pokémon each with their own moves. These Pokémon were chosen as these are some of my favourites.

Potions

17 (1).png

Potions allow the player heal their Pokémon. These can be used in battle against another Pokémon. I used the Super and Hyper potion as these are some of the best in the game. These potions will also not heal the Pokémon if it is on full health.

Running

image-150 (1).png

Running is an option when fighting a wild Pokémon as well as while fighting a trainer. I wanted to replicate this so while fighter in a battle if the player chooses to run then they will be given a message telling them that they can’t. They will then go back to the battle menu.

Gameplay

The game starts with the player having the option to battle the protagonist of the first Pokémon game Red. If the player chooses “no” then they will go to the main menu. However if the player chooses “yes” then they will be go into a page which allows them to pick a Pokémon.

The player can pick any Pokémon but it will only effect what moves the player has access to. The player will be allowed to attack, use a potion, change Pokémon or run away. When the player attacks the AI player their Pokémon will lose health and then the AI will use a random attack hurting the players Pokémon.

If the player decides to use a potion their Pokémon will gain health however they will lose the ability to attack until the AI player makes it’s attack. After the AI players Pokémon is defeated the games ends.

Code

Images and Variables

image-152.webp

The screenshot above showcases two things. One being the variables for the health, potions and the the current Pokémon the player is using. Two being all the images being imported into the game.

Start Game

image-153.png

This piece of code starts loading the “background” and “red” images. The “red” also has a dissolve effect to give it the appearance that it’s fading. This code also allows the player to choose “yes” or “no” which depending on what they pick will define what happens.

Choosing Pokemon

image-155.png

This code happens after the player chooses “yes” from the last the piece of code. This lets the player pick a Pokémon, I will now go thought an example to better explain myself. I picked Pikachu, this will then show text saying “Go Pikachu” and continue to load the Pikachu image file to the left. It will then set the players current Pokémon to Pikachu as well as setting the current Pokémon’s HP and max HP to Pikachu’s. It will then show text saying “Red sends out Charizard” and continue to show the image file for Charizard to the right. I had many problems with this piece of code as it would either crash the game or refuse to work. To fix this I got help from my tutor who helped me to fix it.

Battle

image-158.png

This code gives the player the option to fight, change Pokémon, access the bag and run. If the player choose to fight it will check which Pokémon the player is currently using and will then jump to the correct script with moves associated with that Pokémon. Choosing to change Pokémon or use the bag will just access another script. Running will display a message and then will jump back to the begin.

AI Pokemon

image-159.png

This code creates the AI player. The variable “AIMove” will cycle through the numbers 1 to 4 and pick one at random. Depending on the number the Pokémon will use a different move. For example the random number was a four which means Charizard uses Fire Fang it will then deal the players Pokémon with damage which is random between the number 40 and 65. It will then jump back to the players turn.

Pokemon Attacks

image-160.png

This code does something very similar to the AI script however the difference is it’s not random and there are multiple Pokémon.

Items

image-161.png

The items code had multiple problems surrounding it. These were crashes and the potion staying after use. However with a little help from my tutor I figure it out. This code will check if the Pokémon’s HP is equal to the max HP, if it is then it will not let the player use the item. If it isn’t then it will add the variable of the potion onto the health. It will then remove itself from the list as it has been used.

Changing Pokemon

image-162.png

This code would allow the player to change Pokémon on the fly. It would check your current Pokémon and the one the player has selected to change. It will then compare them, if they are the same it will reject the player and bring them back to the select screen. If they are different the program will hide the current image and show the new Pokémon as well as changing the players current Pokémon.

Download

bottom of page