First Game: Space Shooter
This codebase implements a 2D top-down arcade-style space shooter using the Pygame library. The player pilots a spaceship in the center of the screen, navigating in all directions using the arrow keys and firing lasers with the spacebar. Meteors continuously spawn and fall from the top of the screen, creating a constant threat that players must dodge or destroy. The game features a laser shooting mechanic with a cooldown, animated explosions on impact, a starfield background for atmosphere, and a survival-based scoring system. Collision with a meteor ends the game, and all visuals and audio contribute to a cohesive, retro-inspired experience.
Player Controls:
Arrow keys for movement in all directions.
Spacebar to shoot lasers (with a cooldown timer).
Gameplay Mechanics:
Meteors spawn randomly and fall downward with slight variation in direction and speed.
Lasers destroy meteors on collision, triggering an animated explosion.
Player collision with meteors results in game over.
Score is based on survival time, displayed in real-time.
Visual and Audio Elements:
Sprite-based rendering of the player, meteors, lasers, stars, and explosions.
Parallax-like starfield background for depth.
Sound effects for laser fire, explosions, and background music looped during gameplay.