Coder Social home page Coder Social logo

pygame_alien_invasion's Introduction

pygame_alien_invasion

概述

  • 这是一个用python+pygame写的射击小游戏;
  • 主要是参考Eric Matthes【美】所著《Python Crash Course》书中的一个实践项目。
  • 游戏的主程序在alien_invasion.py中,运行此程序即可开始游戏。
  • 此游戏目前功能较为简单,玩家使用左右方向键控制一架飞船,空格键发射子弹向外星人射击。
  • 外星人集群从屏幕上方出现,左右移动同时向屏幕下方移动。
  • 飞船有3次寿命,每次外星人与飞船接触,或者有外星人到达屏幕底端,飞船失去一次寿命。
  • 飞船复活时,屏幕上所有外星人消失,新的外星人集群由屏幕上方进入。
  • 一个外星人集群全部被消灭后,新的外星人集群才会进入屏幕。
  • 游戏由消灭的外星人集群自动升级,同时外星人移动速度加快,击中得分也随之增加。

文件说明

  • alien.py是外星人模块
  • alien_invasion.py是主程序,运行此代码即可开始游戏
  • bullet.py是子弹模块
  • button.py是按钮模块
  • game_function.py是动作及相应模块
  • game_stats.py 是游戏状态模块
  • scoreboard.py 是积分牌模块
  • settint.py 是游戏设置模块
  • ship.py是飞船模块

pygame_alien_invasion's People

Contributors

acphart 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.