File Exchange

image thumbnail

RoteAugen/flappybir​d-for-matlab

version 1.1 (126 KB) by

MATLAB replica of the viral mobile game "Flappy Bird"

4.77778
28 Ratings

268 Downloads

Updated

Flappybird for MATLAB
Author: Mingjing Zhang

As one of the most popular games on app stores before being taken down, Flappy Bird does not need any further introduction. Now, it has come back alive, on MATLAB.

This implementation is intentionally made to replicate the user experience of the original game, with all physical dimensions of objects being identical. The gravity and 'jumping pulse' are also carefully adjusted so that they match the original as closely as possible.

*MATLAB R2014a is recommended for this game to achieve the best graphical performance

Usage:
Simply execute flappybird.m. Alternatively, you can install "Flappy Bird.mlappinstal" as a MATLAB app.

Control:
Spacebar/Return/Uparrow/W/ -> Jump/Start game/Restart game;
ESC -> Quit Game.

Note:
This game app features a few technique breakthroughs that I utilize in a game for the first time. For instance, the bird sprite is represented as a SURFACE object, as opposed to an IMAGE object, so that it can easily rotate at any angle.

** If you encounter any problem, or have any suggestions / feedbacks, please drop a comment down below. **

Enjoy the endless flapping!

Comments and Ratings (35)

Jian Li

66666~~~~~~~~~~~~~~

Is there any way to change the bird into another surface image?

ding chen

very Good

K. Kojima

K. Kojima

Nice work

jian zhing

6666

Han Feng

Rodolfo

John Hedengren

John Hedengren (view profile)

Here is one implementation of automatic control with this Flappy Bird application.

http://youtu.be/XxPe0HJLkVs

It is surprising that a simple P-only controller can do very well.

Tete Tevi

nice. This should be selected by mathworks as featured

Yu

Yu (view profile)

I like this game,I believe I can always fly.

Wonderful work Mingjing Zhang :)

Nice game,but hard not to collide

Turner Conrad

I hate my life now. Thanks.

Great work! Thank you! This is a good example to learn creating small but funny games in Matlab.

Zohar Bar-Yehuda

mlabviet

nice

dat nguyen

dat nguyen (view profile)

Tim

Tim (view profile)

jacky chen

Guodong

David Barry

Good effort!

You need a slight modification to your code if you are packaging as an app. You need to make sure that the main fuction which you package returns a figure handle so that the app removes itself from the path when you close it.

Ghozali Hadi

Amazing...

@Rabih have you use the pacakage of this submission by downloading "Download Submission"?
Or I think you have problem with your directory. Because matlab couldn't load *.mat file

Harvey Abaya

i was thinking of doing this, but kept it a fantasy. This is a work of passion and skill. Awesome Job!

Rabih

Rabih (view profile)

it doesn't work in matlab R2012 a. I get:
Error using load
Unable to read file sprites2.mat: No such file or directory.

Error in flappybird/initVariables (line 276)
        Sprites = load('sprites2.mat');

Error in flappybird (line 94)
initVariables();

WEIGUANG HU

the game is very similar with the original one on the iphone. Thank you for your efforts. And I suggested this app to my friends already.

great!

Nakk Mungofa

wow! u actually did this?? amazing! ...and funny!

Ligong Han

Ligong Han (view profile)

终于等到matlab版了!学习了!感谢!

Ligong Han

Ligong Han (view profile)

It is hard to believe you took the time to make this. Funny! :)

Interesting! :)

Updates

1.1

Reinserted the description deleted by system after migrating to github

1.1

Migrated to github

1.1

Updated a note clarifying that MATLAB 2014a is the best environment for this game.

1.1

Oct 10, 2014
-----------------
* Tested with R2014b

MATLAB Release
MATLAB 8.3 (R2014a)
Acknowledgements

Inspired: SpriteKit Framework

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video