Skip to main content

A game engine for Flappy Bird powered by Pygame.

Project description

Flappy Bird Game Engine

The purpose of this project is to provide a simple game engine for running Flappy Bird. The engine is powered by Pygame and can be used simply by importing the GameEngine class into a project and utilizing the provided methods.

Gameplay

The space bar is used to jump and the score is tracked as the number of elapsed seconds since the game began. Hitting the pipes, ground, or ceiling results in instant death.

Constants

game_engine.WINDOW_SIZE
A tuple declaring the width and height of the game window.

Classes

game_engine.GameEngine
This class maintains the state of the game and provides several methods for updating its state. It is the only class needed to start, run, and maintain the game.

Functions

game_engine.GameEngine(window, fps)
Creates a GameEngine object for running a game of Flappy Bird.
window (pygame.Surface): A window inside which the game is drawn.
fps (int): The number of game frames to be rendered per second, recommended value is 30.

game_engine.GameEngine.start_game()
Starts a new game with a brief 3 second countdown allowing for the player to ready themselves.

game_engine.GameEngine.events()
Handles player diven events, to be called once each frame.

game_engine.GameEngine.update_state()
Updates the state of the game, to be called once each frame.

game_engine.GameEngine.draw_frame()
Draws the current frame to the screen, called once each frame.

game_engine.GameEngine.next_frame()
Waits an appropriate length of time to ensure the desired FPS is maintained, called once at the end of each frame.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flappy_bird_engine-0.0.4.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

flappy_bird_engine-0.0.4-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file flappy_bird_engine-0.0.4.tar.gz.

File metadata

  • Download URL: flappy_bird_engine-0.0.4.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.3

File hashes

Hashes for flappy_bird_engine-0.0.4.tar.gz
Algorithm Hash digest
SHA256 bae92329201781d571e281b76c42fbf5e8dfd59dee280b45fe3c19e8b812bf21
MD5 325ca0a8d8fdcf9bb284b78aaa1af222
BLAKE2b-256 66fec9588ba96e8fee9df031c516d65d68089fbf5d82ac535c80af544e97a2e6

See more details on using hashes here.

File details

Details for the file flappy_bird_engine-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: flappy_bird_engine-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.3

File hashes

Hashes for flappy_bird_engine-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 21111abc234cf2adff7afffc917dccc162c3ff1c3fe9e28847e16748dc2068c6
MD5 31861293c86f471912523f0dd6403f32
BLAKE2b-256 568658f26b567042ced589c011da8b4e46488cb7ae3e3933bebff00bb567d5e8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page