This is a simple game created using the Pygame library. The objective of the game is to control a robot to collect coins while avoiding monsters. The robot can move using the arrow keys and must collect coins scattered around the screen. If the robot collides with a monster, the player loses 2 coins and is knocked back to prevent continuous collisions. The game continues until the player either collects all the coins (50 or more) or runs out of coins (0 or fewer).
- Make sure you have Python and the Pygame library installed.
- Download the game assets:
robot.png,coin.png, andmonster.png. - Save the downloaded images in the same directory as the game script.
- Run the script
- Use the arrow keys to control the robot's movement.
- The objective is to collect coins while avoiding monsters.
- Colliding with a monster deducts 2 coins and knocks the robot away.
- The robot is invincible for the first 3 seconds.
- The game ends when you either collect all the coins (50 or more) or run out of coins (0 or fewer).
- If you lose or win, press 'R' to restart the game or 'Q' to quit.
- Run the script to start the game.
- Follow the instructions displayed on the screen.
- Control the robot's movement using the arrow keys.
- Collect coins and avoid monsters.
- Check the "Collected Coins" count at the top-left corner.
- If you run out of coins, the game is over.
- Press 'R' to restart or 'Q' to quit.
- If you collect 50 or more coins, you win!
- Press 'R' to restart or 'Q' to quit.
Feel free to adjust the game constants in the script to modify the game's difficulty and behavior. You can change values like constant_width, constant_height, robot_velocity, number_of_monsters, and knock_distance to experiment with different settings.