# Super-Contra-Game **Repository Path**: moondown/Super-Contra-Game ## Basic Information - **Project Name**: Super-Contra-Game - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-06-09 - **Last Updated**: 2025-06-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Super Contra Game ## Description This is a 2D side-scrolling shooter game inspired by *Classic Contra*, built using Python and the Pygame library. The game includes features such as enemy AI, collectible items, jumping, shooting, grenades, level progression, and background music. ## Features - Side-scrolling gameplay. - Player movement and jumping. - Shooting and grenade mechanics. - AI-controlled enemies. - Collectible health packs, ammo, and grenades. - Multiple levels. - Background music and sound effects. ## Installation To install and set up the game, follow these steps: 1. Clone the repository or download the source code. 2. Ensure you have Python installed on your system. 3. Install the required dependencies: ```sh pip install pygame ``` 4. Run the game using the following command: ```sh python Super_Contra_Game.py ``` ## Game Mechanics - Players can move left, right, and jump across platforms. - Shooting and throwing grenades are used to eliminate enemies. - Collectibles such as health packs, ammo, and grenades help players survive longer. - AI-controlled enemies move and attack the player dynamically. - The game progresses through multiple levels with increasing difficulty. ### AI-Controlled Enemies The game includes enemy AI that moves and attacks the player dynamically. The AI behavior is controlled by the `Soldier` class, which enables enemy characters to: - Patrol the environment and change direction when hitting an obstacle. - Detect and shoot at the player when within a certain range. - Take cover and avoid obstacles while moving. - React to being hit or killed, making the gameplay more challenging. This functionality is supported by: - `self.vision` – A rectangular area that detects the player’s presence. - `self.move_counter` – Determines the enemy’s movement pattern. - `self.shoot()` – Allows enemies to fire bullets. - Collision detection with obstacles to prevent unrealistic movement. ## How to Play - Move left: `A` or `Left Arrow` - Move right: `D` or `Right Arrow` - Jump: `W` or `Up Arrow` - Shoot: `Spacebar` - Throw grenade: `G` - Exit: `Esc` ## File Structure - `Super_Contra_Game.py` - Contains the main game logic. - `button.py` - Contains the `Button` class used for in-game menus. - `audio/` - Contains sound effects and background music. - `img/` - Contains sprite images and background assets. - `levelX_data.csv` - Level data files. ## Button Module (`button.py`) The `button.py` file defines the `Button` class, which is used in the game's main menu and restart screens. The class handles button scaling, mouse interaction, and rendering. ## Future Enhancements - Adding more levels with unique environments. - Implementing new weapons and power-ups. - Introducing multiplayer support. - Enhancing AI behavior for a more challenging experience. - Optimizing performance for smoother gameplay. ## Running the Game To start the game, run: ```sh python Super_Contra_Game.py ``` ## Credits Game developed by CHANDRUPATLA SAI VARUN by using Python and Pygame. ## License - This project is open-source under the MIT License.