Welcome to the Meow Mewar, an intergalactic two-player game where two cosmic cats fight for spatial domination. The Red Cat and the Blue Cat face off in an epic battle using fireballs and agile movements. Each player has 7 lives, and the goal is to deplete the opponent's lives before your own run out.
In a distant corner of the galaxy, where the stars shine brightly, two legendary cats — Red Cat and Blue Cat — wage war for control of their territory. Using their unique skills and energetic fireballs, they are willing to fight to the end. The fate of the intergalactic cat universe is in your hands!
-
Start the Game
- Use the arrow keys to select the Play option, "Jogar".
- The selected option will be blue.
-
Player 1 (Red Cat):
- Moves using the W, A, S, D keys.
- Fires fireballs by pressing Left Ctrl.
-
Player 2 (Blue Cat):
- Moves using the arrow keys.
- Fires fireballs by pressing Right Ctrl.
- Each player starts with 7 lives.
- A life is lost every time a player is hit by a fireball from the opponent.
- The game ends when one player's lives
- The last surviving player is crowned the winner of the intergalactic battle!
- Be the last intergalactic cat standing by depleting your opponent's lives!
-
Make sure Python and the
Pygame
library are installed on your system. -
Run the following command in the terminal to start the game:
python principal.py
This game was developed using Python and the Pygame library. Below is a summary of the structure and the main components of the code:
- LARGURA, ALTURA: Dimensions of the game window (900x500 pixels).
- VEL: Movement speed of the cats (5 pixels per frame).
- FOGO_VEL: Speed of the fire projectiles (7 pixels per frame).
- MAX_FOGO: Maximum number of fireballs each player can have on the screen at once (3 per player).
- VIDA_FONTE and GANHADOR_FONTE: Fonts for displaying the remaining lives and the winner message.
The game's graphic and sound resources are located in the Recursos
folder.
desenhar_janela()
: Responsible for rendering the screen every frame, including the players' positions, fireballs, and remaining lives.movimentar_vermelho()
andmovimentar_azul()
: Control the movement of the cats based on the keys pressed.controlhe_fogo()
: Updates the position of the fireballs and checks for collisions with the opponent. It also removes fireballs that go off-screen.ganhador_escrever()
: Displays the winner on the screen and pauses the game for 3 seconds before restarting.
VERMELHO_ACERTADO
andAZUL_ACERTADO
: Custom events triggered when one of the cats is hit by a fireball. They decrease the hit player's health.
The main game loop controls the following:
- Captures input events, such as movement keys and fireball shots.
- Updates the position of the characters and projectiles.
- Checks for collisions and handles health reduction.
- Updates the screen each frame to reflect the current state of the game.
- Fork the repository.
- Create a branch for your feature (
git checkout -b feature/FeatureName
). - Commit your changes (
git commit -m 'Adding new feature'
). - Push your branch to the remote repository (
git push origin feature/FeatureName
). - Open a Pull Request for review.
- Python 3.x
- Pygame Library (can be installed via
pip install pygame
).
- Cat meow sound, provided by Traceletz.
Cat and Fire Sprites, provided by dogchicken.
Fire Spell Sound, provided by Bart K.
Cat's Paw Nebula, photographic record by Martin Junius, available on his official website.
This game is based on the tutorial by Tech With Tim.