The project consists of a game associated with a web page. To enjoy our 2D game developed in Pygame, we invite you to first create an account on its website. In addition to the option to create an account on the website, you will also find a WIKI page for the game where you can find details about enemies, characters, biomes, and two pictures from the game, as well as an INFO page where you can find the characters and their characteristics. The game opens with a login page, followed by a page where the user has the following options:
- choose the character they want to continue the game with
- add characters they don't already have in the database
- delete characters
The game continues and the user can choose the type of biome they want to play on, and from there the magic continues!
- website:
- Flask, Python, Jinja2, HTML, CSS
- game:
- Python, Pygame
- database:
- SQLAlchemy, SQLite
- To generate the images (characters, enemies, biomes, tiles), I used ChatGPT and then converted them into pixelated PNGs using ****:
- In the Toon-Legends directory, type make (using Makefile)
- The website must be opened from the terminal by pressing CTRL + clicking on the link
- The game will always be in full screen mode, and to switch from one sheet to another, use Alt + Tab
-
Trufaș Constantin-Rareș:
-
implementation of game logic
-
game assembly (connection with colleagues' implementations)
-
implementation of the grid and character movements
-
the grid size is randomly generated and can have 6 aspects depending on the biomes:
--> Jungle --> Desert --> Snow --> Ocean --> Cavern --> Space
-
-
Implementing the battle between the enemy and the character
- The battle takes place by pressing the F key, and the enemy attacks according to the following formula:
- If they have the same affinity, then the character will deal 1.25 * damage
- MAX HP of the character / 10
- I generate a random value between (x/2) and x + x / 2 where x is defense, and if the character's defense is greater than this value, only 0.75 * the enemy's damage is deducted from their current life
- When a character dies, they will receive level = 1, defense = 2, HP = 100, and the rest of their characteristics = 0.
- The battle takes place by pressing the F key, and the enemy attacks according to the following formula:
-
Other formulas I used in the implementation:
- MAX HP = (level - 1) * 50 + 100
- PORTAL: the character receives +50 XP
- DEFEAT LA ENEMY: receives between 10-20 XP
- SANCTUARY: a random value from the range [half of missing life; missing life] is added to life
-
updating the database during the game
-
-
Stîngă Cristina:
- implementation of both the frontend and backend of the website, except for the wiki section
- implementation of the database and its connection to the website
- the page in the game where the user chooses the character they want to play with. This page is linked to the database, so the user has the following options:
- to add a character (if they do not have all possible types, a dialog box will appear on the left side of the window with the available characters and their basic characteristics)
- to delete a character
- these buttons work as follows: press the desired button and then select the character to which we apply the option
- if no button is pressed and a character is selected, the game will start with that character in 2 seconds
-
Ruse Petru:
- Implementation of the wiki on the website and all related HTML pages, where we used CSS concepts and text composition
- The game login page, which checks whether the username and password entered on the keyboard exist in the database. Only users who have an account on the website can log in to play
- Makefile
- As this is a complex project in which the database is used by both the website and the game, it was complicated to work simultaneously, and thus problems arose with the code uploaded to GitHub. So, when our files started to get corrupted, we decided that only the captain would push.
- We were unable to implement a Dockerfile that would run both the website and the game simultaneously, so we used a Makefile and the site runs continuously.
- It was difficult to merge the parts of the game because each had its own way of implementing it.
Make sure you are inside the Toon-Legends project directory.
make run-websitemake run-gameIf you see:
Address already in use
Port 5000 is in use by another program. Either identify and stop that program, or start the server with a different port.Free the port:
lsof -i :5000
sudo kill -9 $(sudo lsof -t -i :5000)