Giter Site home page Giter Site logo

fabricio-colombo / flappybird Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 16 KB

This is a project to implement the Flappy Bird game in Python using the Pygame library. The goal of this project is to create a simplified version of the famous Flappy Bird game, where a bird must navigate through flying pipes and accumulate points.

License: MIT License

Python 100.00%
pygame

flappybird's Introduction

Flappy Bird Project in Python

This is a project to implement the Flappy Bird game in Python using the Pygame library. The goal of this project is to create a simplified version of the famous Flappy Bird game, where a bird must navigate through flying pipes and accumulate points.

Project Description

The project consists of a complete implementation of the Flappy Bird game, including the game logic, bird physics, pipe generation, collision detection, scoring, and graphical rendering.

Technologies Used

  • Python
  • Pygame

Project Structure

The project is structured as follows:

  • FlappyBird.py: The main file containing the game implementation.
  • imgs/: Folder containing the images used in the game.
  • README.md: This file providing information about the project.

Replacement of Absolute Paths

One notable modification in this project is the replacement of the os library for path manipulation with direct absolute paths for the game's images. This was done to make the project simpler and easier to understand, allowing other developers to quickly grasp where the images are located and make modifications as needed.

Here's an example of how the images are loaded in the project:

IMAGE_PIPE = pygame.transform.scale2x(pygame.image.load('e:\\DESKTOP_2\\FlappyBird\\Projeto_Flappy_Bird\\imgs\\pipe.png'))
IMAGE_GROUND = pygame.transform.scale2x(pygame.image.load('e:\\DESKTOP_2\\FlappyBird\\Projeto_Flappy_Bird\\imgs\\base.png'))
IMAGE_BACKGROUND = pygame.transform.scale2x(pygame.image.load('e:\\DESKTOP_2\\FlappyBird\\Projeto_Flappy_Bird\\imgs\\bg.png'))
IMAGES_BIRD = [
    pygame.transform.scale2x(pygame.image.load('e:\\DESKTOP_2\\FlappyBird\\Projeto_Flappy_Bird\\imgs\\bird1.png')),
    pygame.transform.scale2x(pygame.image.load('e:\\DESKTOP_2\\FlappyBird\\Projeto_Flappy_Bird\\imgs\\bird2.png')),
    pygame.transform.scale2x(pygame.image.load('e:\\DESKTOP_2\\FlappyBird\\Projeto_Flappy_Bird\\imgs\\bird3.png')),
]


#This modification allows developers to easily customize the image paths according to their directory structure or preferences.

#How to Use the Project
#To use this project, follow these steps:

#Make sure you have Python and the Pygame library installed on your system.
#Clone this repository to your computer.
#Open a terminal in the folder where the project is located.
#Execute the FlappyBird.py file using the command python FlappyBird.py.
#Contribution
#Feel free to contribute improvements or modifications to this project. If you wish to replace the os library with absolute paths in other parts of the code, you are welcome to do so and submit a pull request.

#License
#This project is distributed under the MIT License.

flappybird's People

Contributors

fabricio-colombo avatar

Watchers

 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.