Skip to content

DorianFournier/Flappy-thon

Repository files navigation

MIT License LinkedIn


Thon player

Flappy-Thon

The new life of Flappy-Bird, coding with MicroPython !
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Little course of French
  3. Getting Started
  4. Sources
  5. License
  6. Demo

About The Project


Game name

Yes you read right ! There is no mistake, it's no "Flappy Bird", but "Flappy-thon" in tribute to the fabulous programming language : Python (and also for the game). You can read that 'Flap-python', but you'll understand why I split the name like that !

Development tools used :

  • STM32F407DISC1 development card ⚠️ LIS3DSH NECESSARY (or you need to modify the code) ⚠️
  • MicroPython
  • Linux
  • Visual Studio
  • Git and GitHub 🙂

[back to top]

Little course of French

  • How we say "Tuna fish" in French ?
    • We say "Thon"

Here we go, after this unbelivable French course, you know why the game name is "Flappy-Thon"

[back to top]

Getting Started

If you are interested in this game, follow these steps to download all necessary dependencies ! (I explain how I do with an STM32F407G discovery board.)

Clone the repository

Don't forget to click the "star button"

  1. Clone the repo to your local computer
    git clone git@github.com:your_username/Flappy-thon.git
    or
    git clone https://github.com/your_username/Flappy-thon.git

(back to top)

Prerequisites

First of all, you need to install microPython. For it, go to this page : https://micropython.org/download/

In this same page, you'll find all the boards accepted by microPython, so check if one of this is disponible in your lab ! For the user interface I used an accelerometer (LIS3DSH present on the board), so if you don't want to modify the code, you must have the same accelerometer in the system. 🙂

(if you're a crazy developer, I'm sorry but I will not explain the next steps for """windows lovers""".)

Flash the board

Personnaly, I worked on an STM32F407G DISC1 board for this project, and I flashed the board with DFU. You can also use the classic ST-LINK for STBoard (https://micropython.org/download/STM32F4DISC/).

For this board, you need to connect VDD and BOOT pins with a jumper, and use a mini USB cable for the card alimentation, and a micro USB cable for the flashing part.

Download the flashing program and Firmware

Use a virtual environment

Activate a virtual environment with the command :

source venv/bin/activate

Don't forget to connect the board

Returns a list of USB devices which are currently in DFU mode :

python pydfu.py --list

Flash the board:

python pydfu.py --upload [_name_of_the_firmware_download_before_].dfu

Exemple of result (file name depends of the choosen firmware):

File: STM32F4DISC-20220117-v1.18.dfu
...
...
Zxiting DFU...
Finished

The flashing part is terminated. Now you need to copy your python files into the board (you can use the tool file for this).

Now, you can start a microPython terminal :

sudo screen /dev/ttyACM0

The REPL mode is launched...

[back to top]

REPL

To start the program, import the file "flappython.py".

>>> import flappython

[back to top]

Tool file

Don't forget to modify this file with your user name You can use tool file for copying and umount correctly the board before test it.

sudo bash cp_project.sh

[back to top]

Sources

[back to top]

License

Distributed under the MIT License. See LICENSE.txt for more information.

[back to top]

Demo

flappy_thon.mp4

[back to top]

About

Because FlappyBird is a forgotten game, I create it with microPython !

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published