A classic arcade-style space shooter game built with Python and Pygame. Defend Earth from waves of alien invaders!
- Classic Gameplay: Traditional arcade-style shooting mechanics
- Progressive Difficulty: Game speed and alien points increase with each level
- Score Tracking: Real-time score display and high score tracking
- Multiple Lives: Start with multiple ships and try to survive
- Smooth Controls: Responsive keyboard controls for ship movement and shooting
- Level System: Advance through increasingly challenging levels
- Python 3.7 or higher
- Pygame library
- Clone the repository:
git clone https://github.com/psmarter/Alien-Invasion-Project.git
cd Alien-Invasion-Project- Install dependencies:
pip install -r requirements.txt- Run the game:
python alien_invasion.py- Move Left: ← Left Arrow Key
- Move Right: → Right Arrow Key
- Shoot: Space Bar
- Start Game: Click "Play" button
- Quit: Q key or close window
Alien-Invasion-Project/
├── alien_invasion.py # Main game loop and logic
├── ship.py # Player ship class
├── alien.py # Alien enemy class
├── bullet.py # Bullet projectile class
├── button.py # UI button class
├── settings.py # Game settings and configuration
├── game_status.py # Game state management
├── gamescore.py # Score and level tracking
├── imgs/ # Game image assets
│ ├── ship.bmp # Player ship sprite
│ └── alien.bmp # Alien enemy sprite
└── requirements.txt # Python dependencies
Built With:
- Python 3.x
- Pygame 2.x
Design Pattern:
- Object-oriented programming with separate classes for game entities
- Sprite groups for efficient collision detection
- Event-driven input handling
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
See CONTRIBUTING.md for detailed guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the classic Space Invaders arcade game
- Built as a learning project following Python game development best practices
一个使用Python和Pygame构建的经典街机风格太空射击游戏。保护地球免受外星入侵者的攻击!
- 经典玩法: 传统街机风格的射击机制
- 渐进难度: 游戏速度和外星人分数随关卡递增
- 分数追踪: 实时分数显示和最高分记录
- 多条生命: 开局拥有多艘飞船,尽力生存
- 流畅操控: 响应式键盘控制飞船移动和射击
- 关卡系统: 通过越来越具挑战性的关卡
- Python 3.7 或更高版本
- Pygame 库
- 克隆仓库:
git clone https://github.com/psmarter/Alien-Invasion-Project.git
cd Alien-Invasion-Project- 安装依赖:
pip install -r requirements.txt- 运行游戏:
python alien_invasion.py- 向左移动: ← 左方向键
- 向右移动: → 右方向键
- 射击: 空格键
- 开始游戏: 点击"Play"按钮
- 退出: Q键 或 关闭窗口
Alien-Invasion-Project/
├── alien_invasion.py # 主游戏循环和逻辑
├── ship.py # 玩家飞船类
├── alien.py # 外星敌人类
├── bullet.py # 子弹发射物类
├── button.py # UI按钮类
├── settings.py # 游戏设置和配置
├── game_status.py # 游戏状态管理
├── gamescore.py # 分数和关卡追踪
├── imgs/ # 游戏图像资源
│ ├── ship.bmp # 玩家飞船精灵
│ └── alien.bmp # 外星敌人精灵
└── requirements.txt # Python依赖项
构建技术:
- Python 3.x
- Pygame 2.x
设计模式:
- 面向对象编程,游戏实体使用独立类
- 精灵组用于高效碰撞检测
- 事件驱动的输入处理
欢迎贡献!请随时提交Pull Request。对于重大更改,请先开issue讨论您想要更改的内容。
详细指南请参阅 CONTRIBUTING.md。
本项目采用MIT许可证 - 详见 LICENSE 文件。
- 灵感来自经典的太空侵略者街机游戏
- 作为Python游戏开发最佳实践的学习项目构建
⭐ If you like this project, please give it a star!
⭐ 如果你喜欢这个项目,请给它一个星标!