Git Product home page Git Product logo

space-shooters-'s Introduction

Space Shooter Game

Overview

This Python code is a simple implementation of a space shooter game using the Pygame library. The game features a player-controlled spaceship that can move horizontally and vertically, shoot lasers, and has a health bar. The objective is to survive waves of enemy spaceships while avoiding collisions and enemy lasers.

Features

Player-controlled spaceship with movement in four directions (up, down, left, right). Shooting lasers to destroy enemy spaceships. Enemy spaceships with random colors (red, green, blue) and the ability to shoot lasers. Health bar for the player, displayed at the bottom of the screen. Lives counter to keep track of the player's remaining lives. Levels that increase in difficulty with more enemy spaceships in each wave.

How to Play

Use the W, A, S, D keys to move the player spaceship (up, left, down, right). Press the SPACEBAR to shoot lasers and destroy enemy spaceships. Avoid collisions with enemy spaceships and their lasers. The game ends when the player runs out of lives or health.

Installation

Ensure you have Python installed on your machine. Install the Pygame library using the following command: pip install pygame Download the code and assets. Run the script by executing the following command in the terminal: python space_shooter.py

Assets

The game uses pixel art assets for spaceships, lasers, and the background. You can find these assets in the "assets" folder.

Player Spaceship: pixel_ship_yellow.png Enemy Spaceships: pixel_ship_red_small.png, pixel_ship_green_small.png, pixel_ship_blue_small.png Lasers: pixel_laser_yellow.png, pixel_laser_red.png, pixel_laser_green.png, pixel_laser_blue.png Background: background-black.png

Code Structure

The code is organized into classes for the main elements of the game: Laser, Ship, Player, and Enemy. Collision detection is implemented using masks to check for overlaps between objects. The main function runs the game loop, handles player input, and manages enemy waves. The main_menu function displays a simple menu to start the game.

Dependencies

Python 3.x Pygame library

Credits

This code is a tutorial implementation and uses assets from an external source (not specified in the provided code).

License

This code is provided without a specific license. Please refer to the licenses of the included assets for more information.

Enjoy playing the space shooter game!

space-shooters-'s People

Contributors

dakosy1 avatar replayzz9 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.