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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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