Code Monkey home page Code Monkey logo

pyopengl-space-invaders's Introduction

Features

Run with ./invaders/main.py.

This command accepts 3 command-line arguments:

  • --prod, which enhances performance by disabling OpenGL logging,
  • --fullscreen, which allows you to play in fullscreen mode, and
  • --mode, which takes 1 argument, "easy" or "hard". "easy" disables firing, while "hard" makes it more frequent.

Press left and right to move the player, and up to fire the cannon. Press q to quit.

The game plays audio on a number of occasions:

  • when the player fires
  • when an alien fires
  • when the player wins the game
  • when the player loses the game
  • when the player hits an alien (there are 4 different sounds that play, with different probabilities)

Each barrier can take 4 hits. Check out the different colors for each damage level!

The aliens move as far to the left and right as they can -- that is to say, if the leftmost column of aliens is all destroyed, the remaining leftmost column will move all the way to the left.

Similarly, the aliens move as far down as they can. That is to say, if you destroy the entire bottom row of aliens, you buy yourself some time.

If the aliens reach the level of any remaining barriers, the barriers disappear.

The aliens fire approximately every 2-4 seconds. The timing is determined randomly.

Extra Credit

  • Sound on events
  • "Deteriorating barriers"

Acknowledgments

All models by William Hill (wahill2).

Audio-playing code adapted from Elliot J. Reed's example code, found at:

http://www.elliotjreed.com/article.php?read=play_a_sound_wav_audio_file_in_python3

pyopengl-space-invaders's People

Contributors

mambocab avatar

Watchers

James Cloos avatar  avatar  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.