SlideShare a Scribd company logo
1 of 36
Download to read offline
INDEX
S.N
O
Name of the experiment
Page.
no
1. Installation of Android studio. 1
2. Development Of Hello World Application 7
3.
Create an application that takes the name from a textbox and
shows hello message along with the name entered in text
box, when the user clicks the OK
Button
11
4. Project Definition 17
5. Statement of work
5.1 Functional requirements
5.2 Software and Hardware requirements
23
6. Design 24
7. Implementation 27
8. Screenshots 32
9. Conclusion 34
10. References 35
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 1
Faculty of Engineering and Technology
1. EXPERIMENT NO.1
INSTALLING AND RUNNING APPLICATIONS ON ANDROID STUDIO
Step 1 - System Requirements
The required tools to develop Android applications are open source and can
be downloaded from the Web. Following is the list of software's you will
need before you start your Android application programming.
Java JDK5 or later version
Java Runtime Environment (JRE) 6 Android Studio
Step 2 - Setup Android Studio
Android Studio is the official IDE for android application development.It
works based on IntelliJ IDEA, You can download the latest version of
android studio from Android Studio 2.2 Download, If you are new to
installing Android Studio on windows,you will find a file, which is named
as android-studio-bundle- 143.3101438-windows.exe.So just download and
run on windows machine according to android studio wizard guideline.
If you are installing Android Studio on Mac or Linux, You can download
the latest version from Android Studio Mac Download,or Android Studio
Linux Download, check the instructions provided along with the
downloaded file for Mac OS and Linux. This tutorial will consider that you
are going to setup your environment on Windows machine having Windows
8.1 operating system. Installation
So let's launch Android Studio.exe,Make sure before launch Android Studio,
Our Machine should required installed Java JDK. To install Java JDK,take a
references of Android environment setup
Once you launched Android Studio, its time to mention JDK7 path or later
version in android studio installer.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 2
Faculty of Engineering and Technology
Below the image initiating JDK to android SDK
Need to check the components, which are required to create applications, below
the image has selected Android Studio, Android SDK, Android Virtual Machine
and performance(Intel chip).
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 3
Faculty of Engineering and Technology
Need to specify the location of local machine path for Android studio and Android SDK,
below the image has taken default location of windows 8.1 x64 bit architecture.
Need to specify the ram space for Android emulator by default it would take 512MB of
local machine RAM.
At final stage, it would extract SDK packages into our local machine, it would take a while
time to finish the task and would take 2626MB of Hard disk space.
After done all above steps perfectly, you must get finish button and it gonna be open android
studio project with Welcome to android studio message as shown below
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 4
Faculty of Engineering and Technology
You can start your application development by calling start a new android studio project. in a
new installation frame should ask Application name, package information and location of the
project.
After entered application name, it going to be called select the form factors your application
runs on, here need to specify Minimum SDK, in our tutorial, I have declared as API23:
Android 6.0(Mashmallow)
The next level of installation should contain selecting the activity to mobile, it specifies the default
layout for Applications
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 5
Faculty of Engineering and Technology
At the final stage it going to be open development tool to write the application code.
Step 3 - Create Android Virtual Device
To test your Android applications, you will need a virtual Android device. So before we start
writing our code, let us create an Android virtual device. Launch Android AVD Manager
Clicking AVD_Manager icon as shown below
After Click on a virtual device icon, it going to be shown by default virtual devices
which are present on your SDK, or else need to create a virtual device by clicking
Create new Virtual device button
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 6
Faculty of Engineering and Technology
If your AVD is created successfully it means your environment is ready for Android
application development. If you like, you can close this window using top-right cross button.
Better you re- start your machine and once you are done with this last step, you are ready to
proceed for your first Android example but before that we will see few more important
concepts related to Android ApplicationDevelopment.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 7
Faculty of Engineering and Technology
2. DEVELOPMENT OF HELLO WORLD APPLICATION
AIM: To design an android application to display Hello World First step is to create
a simple Android Application using Android studio. When you click on Android
studio icon, it will show screen as shownbelow
You can start your application development by calling start a new
android studio project. in a new installation frame should ask
Application name, package information and location of the project.−
Configure the Hello World Project Details We'll finish creating the project by
configuring some details about its name, location, and the API version it
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 8
Faculty of Engineering and Technology
Change the name of the application. Change the default Project location to your
preferred directory or just leave it as the default location.
On the minimum API level, ensure that API 15: Android 4.0.3 IceCreamSandwich is
set as the Minimum SDK. This ensures that your application runs on almost all devices.
The next level of installation should contain selecting the activity to mobile, it specifies the default
layout for Applications.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 9
Faculty of Engineering and Technology
SOURCE CODE:
The Main Activity File
The main activity code is a Java file MainActivity.java. This is the actual
application file which ultimately gets conerted to a Dalvik executable and
runs your applications.
Package com.example.helloworldapplication;
import android.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivty wxtends AppCompatActivity {
@Override
Protected void onCreate(BundlesavedInstanceState) {
Super.onCreate(savedInstanceState);
setContentVIew(R.layout.activity_main);
}
}
The Layout File
The activity_main.xml is a layout file available in res/layout directory, that is referenced by
your application when building it’s interface. You will modify this file very frequently to
change the layout of your application. For your “Hello World!” application, this file will have
following content related to default layout.
<RelativeLayout
xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:tools=”http://schemas.android.com/tools”
android”layout_width=”match_parent”
android:layout_height=”match_parent”
>
<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_centerHorizontal=”true”
android:layout_centerVertical=”true”
android:padding=”@dim en/padding_medium”
android:text=”@string/hello_world”
tools:context=”MainActivity”/>
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 10
Faculty of Engineering and Technology
I )Running app on Phone:
Connect your Phone to Computer
Plug in your device to your computer with a USB cable. If you're developing on
Windows, you might need to install this universal ADB USB driver or find your specific
USB driver for your
device.
The next step is to enable USB debugging so your phone can interact with your
computer in a developer mode.
The following steps are needed:
1. (Windows Only) Install this ADBDriver
2. Plug-in your Android Device to Computer viaUSB
3. Open the "Settings" App on the Device
4. Scroll down to bottom to find "About phone"item
5. Scroll down to bottom to find "Build number" section
6. Tap on "Build Number" 7 times in quicksuccession
7. You should see the message "You are now adeveloper!"
8. Go back to main "Settings" page
9. Scroll down bottom to find "Developer options"item
10. Turn on "USB Debugging" switch and hit "OK"
11. Unplug and re-plug thedevice
12. Dialog appears "Allow USBDebugging?"
13. Check "Always allow from this computer" and then hit "OK"
Running your App
Now, we can launch apps from Android Studio onto our device:
1. Select one of your projects and click "Run" from the toolbar.
2. In the "Choose Device" window that appears, select the "Choose a running
device" radio button, select the device, and clickOK.
II) Running app on Emulator(AVD)
To run the app from Android studio, open one of your project's activity files
and click Run icon from the tool bar. Android studio installs the app on
your AVDand starts it and if everything is fine with your set-up and
application, it will display following Emulator window −Once Gradle
finishes building, Android Studio should install the app on your connected
device and start it.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 11
Faculty of Engineering and Technology
3. Create an application that takes the name from a text box and
shows hello message along with the name entered in text box, when the
user clicks the OK button.
Code forMainActivity.java
packagecom.example.akshay.m
rcet; import android.os.Bundle;
importandroid.support.v7.app.AppCompatActivity
; import android.view.View;
import android.widget.Button;
import
android.widget.EditText;
importandroid.widget.TextVie
w;
public class MainActivity extends AppCompatActivity {
// These are the global
variables EditText editName,
editPassword; TextView
result;
Button buttonSubmit, buttonReset;
@Override
protected void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editName = (EditText)
findViewById(R.id.editName); editPassword =
(EditText) findViewById(R.id.editPassword); result =
(TextView) findViewById(R.id.tvResult);
buttonSubmit = (Button)
findViewById(R.id.buttonSubmit); buttonReset =
(Button) findViewById(R.id.buttonReset);
/*
Submit Button
*/
buttonSubmit.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
String name = editName.getText().toString();
String password = editPassword.getText().toString();
result.setText("Name:t" + name + "nPassword:t" +
password );
}
buttonReset.setOnClickListener(new View.OnClickListener()
{ @Override
public void onClick(View
v) {
editName.setText("");
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 12
Faculty of Engineering and Technology
editPassword.setText("
"); result.setText("");
editName.requestFocus
();
}
});
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/andr
oid" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFF8D"
tools:context="com.example.akshay.mrcet.MainActivity">
<TextView
android:id="@+id/text
View"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="NAME"
android:textSize="20sp"
android:layout_margin="20dp" />
<TextView
android:id="@+id/textVi
ew2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="PASSWORD"
android:layout_marginTop="38dp"
android:layout_below="@+id/textVie
w"
android:layout_alignLeft="@+id/textV
iew"
android:layout_alignStart="@+id/text
View"
/<EditText android:id="@+id/editName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:hint="Enter Name"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 13
Faculty of Engineering and Technology
android:layout_alignLeft="@+id/editPasswor
d"
android:layout_alignStart="@+id/editPasswor
d" />
<EditText
android:id="@+id/editPassword"
android:layout_width="wrap_cont
ent"
android:layout_height="wrap_cont
ent" android:ems="10"
android:hint="Enter Password"
android:inputType="textPassword"
android:layout_alignBottom="@+id/textVie
w2"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="18dp"
android:layout_marginEnd="18dp" />
<Button android:id="@+id/buttonSubmit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/textView2"
android:layout_marginTop="20dp"
android:text="SUBMIT" />
<Button
android:id="@+id/
buttonReset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RESET"
android:layout_alignBaseline="@+id/butt
onSubmit"
android:layout_alignBottom="@+id/butto
nSubmit"
android:layout_centerHorizontal="true" />
<TextView android:id="@+id/
tvResult"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="143dp"
android:textSize="30sp" />
</RelativeLayout>
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 14
Faculty of Engineering and Technology
A
MINI PROJECT
ON
“FLAPPY BIRD”
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 15
Faculty of Engineering and Technology
ABSTRACT
Flappy Bird is a fun and intuitive mobile game on Android platform driving a lot of people crazy
these days. In this game, the player can control the movement of the bird. Pressing the button makes
the bird leap upward and on releasing the button the bird will fall freely. In the proposed game
design, as soon as the game begins, obstacles will keep appearing from the right side of the screen
and move leftwards which will make bird seem to be flying in the forward direction. The goal of this
game would be to control the bird, dodging and passing it through as many obstacles as possible.
This will run endlessly until the bird hits the obstacle, ground or ceiling. At the beginning of the
game, the player is prompted to hit the play button to start the game. Once the Bird is unable to beat
the obstacle, the game is concluded and the score for that session is displayed.
Flappy bird is a mobile game in which a player controls a bird’s flight height to avoid obstacles.
Pressing on the screen for a longer period of time allows the bird to fly higher, while letting go
causes the bird to fly lower. This project will bring the mobile game to life using a video camera to
detect a player’s motion, and controls the bird based on the speed at which a player flaps her arms.
The FPGA will render an image of the bird flying through an environment, and display the flapping
motion of the wings according to the player’s speed. Flappy Bird is a mobile game that became
incredibly popular in 2014. The game is simple in concept: you control a bird that flaps its wings
when you tap the screen, and you must navigate it through a series of p
ipes without touching them. The game's difficulty lies in its tricky controls and the fact that even the
slightest mistake can cause you to crash. Despite its simple graphics and gameplay, Flappy Bird
became a sensation, with many players becoming addicted to its challenging and frustrating nature.
However, the game's creator eventually removed it from app stores due to the overwhelming
attention it received
Flappy Bird is a mobile game that gained immense popularity in 2014. The game's simple yet
challenging gameplay made it an instant hit among gamers of all ages. However, the game's creator
eventually removed it from app stores due to the overwhelming attention it received. Despite its
short-lived success, Flappy Bird remains a cultural phenomenon, with many people still discussing
and playing it years later. The game's impact on mobile gaming is undeniable, and its legacy can still
be felt in the countless games that have been inspired by it.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 16
Faculty of Engineering and Technology
Introduction
On February 10th, 2014, the creator of Flappy Bird, a popular side scrolling game for mobile
devices, removed the game from mobile application stores (Apple, Android, etc.). The reason for the
removal was due to the game becoming “an addictive product” that had “become a problem”
(Nguyen). Currently Flappy Bird is only available to those who downloaded the game before its
deletion from application stores or through a fan created website, flappybird.io.
This final project aims to implement this popular and exciting game in hardware. Previous
implementations of this game, such as the original mobile app or fan created online version, exist in
software form. As a result, bringing this game into the hardware realm truly distinguishes our project
from previous implementations of Flappy Bird. In the preexisting software implemented versions of
this game, a small bird must hop to avoid obstacles in the form of green pipes that scroll across the
screen from right to left.
The user taps the screen or clicks a button to make the bird jump up, but otherwise the bird is
constantly falling. Due to the counterintuitive control scheme, which required the user to remain
vigilant, constantly monitoring the bird’s path of movement during the game, Flappy Bird became
renowned for its difficulty and infuriating controls. Our goal is to implement our own version of the
game on an FPGA (Nexis 4 DDR) and make the game more interesting and difficult by incorporating
a vision tracking element that requires the player to jump in order to control the onscreen bird
protagonist. Specifically, the vision tracking component will look for a bright object placed over the
player’s face (a “beak” in the form of a paper party hat), and then use the coordinates of this said
object as input for the player coordinates to the game.
Therefore, a large change in the player’s vertical position, as monitored by the vision tracking
component, will trigger a hop for the player’s onscreen character. By incorporating this vision
tracking specific control screen, player’s movements will be continually tracked, resulting in greater
emphasis on the player’s attention and engagement within the the game. Additionally, during game
play, the player’s face will be layered onto the bird sprite, allowing for a truly personalized
experience.
Stretch goals of this project include implementing our project on two FPGAs connected via serial
link to create a multiplayer experience and dynamic calculations that allow rotation of the bird sprite
during jumps. The ideal outcome would be to deliver an aesthetically pleasing and physically
engaging game that demonstrates successful implementation of the game integrated with the vision-
tracking component
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 17
Faculty of Engineering and Technology
4. PROJECT DEFINITION
4.1 PROJECT DESCRIPTION
In this project, we design and implement a Flappy Bird like video game on the Sock it development
board. Flappy Bird is a very popular mobile game on Android platform, driving a lot of people crazy.
In this game, the player can control the vertical movement of bird (every pressing on the keyboard
makes the bird leap upward for a little bit, and the bird will fall freely without control). As soon as
the game begins, tubes will keep appearing from the right side of the screen and moving leftwards.
(So that it seems like the bird flying forward). The goal of this game is to control the bird, dodging
and passing the incoming tubes, as many as possible. The game is endless until the bird eventually
hit one of the tubes, ground, or ceiling. Figure 1 is the start screen of Flappy Bird. The title "Flappy
Bird" is shown in the middle of the uppers side of the screen. The bird is also displayed on the
background.
Figure 1. Start screen for Flappy Bird
Figure 2 shows the screen when the game is on
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 18
Faculty of Engineering and Technology
The three pillars are displayed on the screen, and so is the score, on top of the background or the pillar
Fig: shows the screen while playing the game
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 19
Faculty of Engineering and Technology
4.2 Project Objective:
4.2.1 The Process: In my initial approach, I accounted for only three modules: game state, physics and
high score. However, as I began implementation of these modules I realized that my original design
was flawed in that it did not account for the complexities that come with randomly generating
obstacles, different clock domains or the complexities needed to create smooth player (bird sprite
protagonist) movement.
4.2.2 Physics Module: Since the game has a scrolling background and obstacles are generated on
screen from right to left, the player bird sprite has a fixed horizontal coordinate, the player’s jumps
only impact the onscreen sprite’s location in the vertical direction. Keeping this movement in only
one dimension eliminates the need to perform rotations and smooth out the xy translational motion via
interpolation, reducing the complexity of calculations and ensuring that all needed calculations to
produce the updated sprite position can occur within a single clock cycle.
4.2.3 Collision Detection Module: For the collision detection module, the implementation was quite
straightforward, essentially I needed to check if the bird ever went beyond the bounds of the output
VGA screen or if it collided with an obstacle. Since the bird’s movement is restrained to only the
vertical axis, it will never surpass the left of right edge of the screen. When calculating collisions, the
size of the bird must be taken into account. For Flappy Bird, the bird coordinate refers to the top left
corner of the sprite. Since the size of the bird is 64x64 pixels, collision detection must take into
account the entire size of the bird.
4.2.4 Random bit and Obstacle Generation Module: To generate pseudorandomized obstacle
locations, I originally designed the random bit module to output a number between 1 and 10 using the
$random variable. However, the flaw in the utilization of this $random variable was that I quickly
found out that $random only works in simulation, not in physical hardware. I then had to devise an
ulterior method of generating pseudorandom bits to use in the obstacle generation module. Since the
player’s location coordinates change once every camera frame (even if they are standing still, there
are still natural slight movements that occur), it seemed reasonable for me to take the 4 least
significant bits from the player position and use them as my pseudorandom bits, resulting in an output
of rabbit [3:0] from the random module.
4.2.5 Testing Procedure: To test the various functionality of the timer, olestra, random and collision
modules I wrote testbenches that checked that modules worked as predicted. For testing the game
state module, namely the transitions between the various states and to make sure the correct bits were
enabled, I used the buttons on the Nexus to represent state transitions and utilized the LEDs to
represent various output bits, such as the collision and jump sound enable bits. To test the physics
module, I first had to integrate my physics module with Nick’s video module.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 20
Faculty of Engineering and Technology
4.2.6 VGA Device Drive: The VGA module is actually a memory-mapped slave, which connects to
the Avalon bus through the lightweight AXI bridge. The HPS uses 4-bit address bits to access 16
location that store 8 bits data. More specifically, The software use IOCtl to call the inwrite function in
the device driver and specify the registers’ address(a base address of the via slave plus the offset
address which is specified in the device tree ) to write. We use Sy’s to connect everything between
gaoled and the HPS up.
4.2.7 Future Goals: If I were given more time to do this project, I’d focus on adding two things: support
for more colours and replacing the current RGB to YUV conversion with one that is more accurate
and uses floating point math. For adding new colours, the changes would just have to be in the
parameters, so it would simply involve going into lab with different colour beaks and trying out
different configurations and thresholds to optimize for desired colours. In addition, this would require
creating at least two modules to change the parameters on the camera and for the thresholds.
Replacing the RGB to YUV conversion would require pipelining because of the floating point math
operations, but this would simply delay the output, and wouldn’t require adding more steps to the
process. Since the time between frames is substantial, there would be virtually no loss to tracking
data, and this change would allow for more accurate colour representations in YUV. The end result of
the increased colour fidelity is that picking out colours would become easier, and more robust. In
addition, this would mean that the need for optimizing the camera’s colour output to the desired one
becomes more necessary.
4.3 Project Scope:
Image processing pre-process the images to use Generate a memory initialization file for each image Single-
port ROM memory blocks 24-bit index colour Audio processing pre-process
 the audios Generate a memory initialization file for each audio Single-port ROM memory blocks 44100Hz
sampling rate 16-bit quantization
 Use limbus C library to communicate with USB keyboard
 Spawn one thread to receive signal from Keyboard, leaving the main program to handle the sprite control
 Sprite implementation
 Hardware and software collaboration
 Time management
 Architecture design of Sock it board
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 21
Faculty of Engineering and Technology
4.4 Project Deliverables:
At the highest level, the project will track the player’s face for vertical changes during gameplay and output sound
effects (Audio Out) and video graphics (VGA out) where relevant. Depending on the player’s vertical movement,
the game logic processing block will change and update the sound and graphics. The vision/object processing
block takes input from the OV7670 camera and processes the incoming video stream to determine the location of
the “beak” and then sends the location coordinates to the game logic block. The game logic block uses an input
button to start the game, and uses a combination of physics and saved previous player location states to determine
when to jump. Additionally, the game logic block handles the location of new obstacles, and controls the
movements of the bird. If the bird collides with an obstacle, it ends the game. The game logic then sends position
data of objects, specifically the player face and obstacle location coordinates, to the video block, and also tells the
audio block what sound effects to play. The video block takes input of the player face coordinates to be able to
retrieve the player face sprite from BRAM and also takes in the object positions to convert them into image
representations. All of this information is then sent over to VGA to be displayed. The audio block plays sound
effects based on events determined by the game logic.
4.5 Project Timeline:
Game logic : Time
◩ System clock data type is not available in calculation, ex: clock()
◩ Implement counter: loop number as time unit collaborating with delay, ex: usleep() Game logic : Status
◩ Status variable: record jumping and falling
◩ Status variable cooperates with initial velocity supporting continuous jumping without multithread
4.6 Project Team:
‱ Improve our coding style. In our hardware coding, we unroll the program without making it hierarchical as a
module which may lead to difficulty for debugging.
‱ Choose high resolution sprite pictures and eliminating sprite background more clearly can make our game
picture looks better.
‱ Design more complex game logic can increase our game integrity. Fro example, background changes with
time, distance between pillar become random.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 22
Faculty of Engineering and Technology
4.7 Budgets:
 The biggest issue is the USB input driver. The kernel in our Sock it board can’t read USB driver
library even we update and install the library. We do some modification and using lab2 to
environment to make our keyboard work. We also modify bit-width in driver to communicate with
Sock it board collaborate with our signal.
 Second issue is synchronization between loop in software and frame buffer update in hardware. We
need to update the object position when the frame is not showed on the screen.
 So we update the screen only when it scans to the bottom of the screen. l Bird motion need time
variable which is not straightforward to get. Because the data type we get from system clock is not
available for calculation.
4.8 Risk and Mitigation Strategies:
Game logic : pillar display
◩ We combine the display of pillar with the check condition ( whether the pillar is on the screen or not )
reset the coordinate of the pillar once the condition is triggered.
4.9 Approval:
This section can easily be tested independently from the others, as it requires only two bits of inputs. The two
enable bits were mapped to buttons on the Nexus so the sounds could be played on demand. I started with a
simple sinewave file loaded into the ROM. After confirming that the logic.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 23
Faculty of Engineering and Technology
5 STATEMENT OF WORK
The project can be visualized in four major blocks as shown in Figure 1: object tracking, gameplay
logic, audio, and video display.
The primary motivation for this project is to make a well designed and physically engaging game that
emphasizes and personalizes user experience. Completion of this project requires full functionality of
every module. As a result, we require that each of the four critical blocks be independent of the others,
allowing for streamlined parallel development and comprehensive testing of the modules. For object
tracking purposes, the player is required to wear a “beak”, a brightly coloured party hat over their nose
and mouth, similar to a mask. The purpose of the physical “beak” is to provide an object of high
contrast that allows us to easily determine the location of the player’s face (Figure 2 below). The vision
tracking component will look for a bright object placed over the player’s face (the “beak”), and then
use the coordinates of this object as input of the player coordinates to the game. As a result, any large
changes in the vertical coordinates of the player will be detected as a jump control sequence.
Figure 1: The high-level design of the game 2.2 Design Decisions and Motivation
5.1 Hardware specifications(minimum)
Pentium 3 processor.
Processor speed of 300 MHZ and above
Memory: 512 MB RAM
Graphics: DirectX 9.0c compatible video
card 512MB
DirectX: Version 9.0.
5.2 Software specifications
Graphics: DirectX 9.0c compatible video
card 512MB
DirectX: Version 9.0
Storage: 100 MB available space.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 24
Faculty of Engineering and Technology
6 DESIGN
6.1 Flow Chart
Fig 3.1. Flow chart High level block diagram
Primary components that constitutes our game includes the ARM core (game logic), device driver, USB controller
to control the input from keyboard, Sprite controller (control the display of sprites), audio controller, SDRAM (
store all the data needed in game logic). The game logic module interfaces with several other modules including
the USB keyboard, by receiving the control signal; as well as the device driver in order to control the audio and
display of sprites, including the positions of pillars and birds, the length of the pillars and the score. Sprite
controller is connected to VGA Controller, which is responsible for the display of all the images, and audio
controller is connected to audio CODEC on the SoCKit board. Each of the components in our design will be
discussed in detail below
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 25
Faculty of Engineering and Technology
6.2 Files Used
1. Delay: This component is used the deploy a delay of a given amount of time.
2. Sinter Fire: This is used to read data bit-by-bit and send it to the display. An 8-bit input is passed into
the module and it transmits it bit-by-bit.
3. Olivinite: This module contains all the commands to turn on the display and this has to do every time
the display is powered on.
4. Bird is: This is the main module in which the movement of the bird is coordinated and the output for
the display is determined. A set of multiple screens has been defined here which is used to display the
output on the screen of the Pod OLED. Also, the scoring and level increment part is taken care of here
itself.
5. Midriver: As the name suggests this module works just as a driver for all the previously defined sets
of modules.
6. Charlie: This is the memory module and we have imported it for use in our game.
6.3 Description of Classes
 Game View Controller - Manages the game's view and user input
 Game Over Scene - Displays the game over screen and allows the player to restart the
game
 Physics Category - Enumerates the different categories of physics bodies in the game
 Sound - Enumerates the different sound effects in the game
 Game: This class represents the game itself and acts as the main controller for the
entire game. It handles initializing the game window, managing game state (e.g.,
running, paused, game over), and contains the game loop that updates and renders the
game objects. It also manages user input, such as handling key presses to control the
bird's flap.
 Bird: The Bird class represents the player-controlled character in the game. It manages
the bird's position, velocity, and behavior (e.g., flapping, falling). This class handles
the bird's movement based on user input and gravity, as well as detecting collisions
with obstacles.
 Pipe: The Pipe class represents the obstacles that the bird must avoid. It manages the
position and movement of pipes as they scroll from right to left on the screen. This
class also handles the generation of new pipes as the game progresses and ensures they
are appropriately positioned on the screen.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 26
Faculty of Engineering and Technology
 Collision Manager: This class is responsible for detecting collisions between the bird
and pipes. It checks for collision between the bird's bounding box and the pipes,
determining if the bird has collided with an obstacle or not. If a collision is detected,
the game's state will change to "Game Over."
 Score Manager: The Score Manager class keeps track of the player's score during the
game. It increments the score each time the bird successfully passes a set of pipes
without colliding with them. The class also manages the high score and updates it
accordingly.
 Graphics Manager: The Graphics Manager class handles rendering all the game
objects on the screen. It utilizes graphics libraries or APIs to draw the bird, pipes, and
any other visual elements on the game window. It updates the screen with each game
loop iteration.
 Sound Manager: This class manages the sound effects and background music in the
game. It handles playing sound effects like the flapping sound when the bird jumps or
collision sound when it hits an obstacle. It also manages the background music
throughout the game.
 Game: The Game class is responsible for displaying the user interface elements, such
as the score, high score, and any messages like "Game Over" or "Paused." It updates
and refreshes the UI based on the game's current state.
 These are the essential classes needed to implement a basic version of the Flappy Bird
game. Depending on the complexity of your mini-project, you may have additional
classes to handle more advanced features like animations, power-ups, or different
game modes. But the above classes should form the core components of the Flappy
Bird game implementation.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 27
Faculty of Engineering and Technology
7. IMPLEMENTATION
SOURCE CODE:
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 28
Faculty of Engineering and Technology
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 29
Faculty of Engineering and Technology
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 30
Faculty of Engineering and Technology
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 31
Faculty of Engineering and Technology
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 32
Faculty of Engineering and Technology
8. SCREENSHOTS
ig 5.1: home page of android virtual device
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 33
Faculty of Engineering and Technology
Fig 5.2: home page of flappy bird
Fig 5.3: shows the screen when the game
is on
Fig 5.4: game over
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 34
Faculty of Engineering and Technology
CONCLUSION
Implementing this game in hardware was an enjoyable project for all of us. It paired a fun final product with
a challenging implementation, an ideal combination for a project in this class. The work was modular and
divided well between three people, so we could optimize the division of labor. Our goals were achievable,
and we accomplished what we wanted. Overall, this project helped all of us gain experience working with
hardware implementation and interfacing with the outside world.
Our final project was planned, developed and demonstrated as expected. We designed a new version of
Flappy Bird Game written in Python, which could be played either on Pit FT screen or personal computer.
Firstly, a user-friendly interface was implemented. Secondly, single player mode was realized. In single
player mode, each player have 3 lives and their NetIDs and final scores will be written to a score board,
which keeps track of top 10 scores. Then the code of dual player mode was written. It gives users the
opportunity to compete with their friends, which will bring a lot of fun. We also implemented two
background settings, daytime and night modes. The users could also choose either one background mode
before playing the game. One difficulty for users is that the horizontal shifting speed will increasing as time
goes on. We also implemented a hidden trick in the single player mode. When user achieves 10 scores, the
flappy bird will evolve into flappy Joe.
FLAPPY BIRD MOBILE GAME APP
Department of Computer Science and Engineering Page 35
Faculty of Engineering and Technology
REFERENCES
 www.developer.android.com
 www.source.android.com
 www.wikipedia.com
 www.images.google.com
 www.firebase.google.com

More Related Content

Similar to Bird.pdf

Android deep dive
Android deep diveAndroid deep dive
Android deep diveAnuSahniNCI
 
Android
AndroidAndroid
AndroidBVP GTUG
 
Day2GDSC.pptx
Day2GDSC.pptxDay2GDSC.pptx
Day2GDSC.pptxGDSCICOER
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxlancelotlaytan1996
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxkarthikaparthasarath
 
Hello android example.
Hello android example.Hello android example.
Hello android example.Rahul Rana
 
Introduction to Android and Java.pptx
Introduction to Android and Java.pptxIntroduction to Android and Java.pptx
Introduction to Android and Java.pptxGandhiMathy6
 
Bai thuc hanh lap trinh Android so 1
Bai thuc hanh lap trinh Android so 1Bai thuc hanh lap trinh Android so 1
Bai thuc hanh lap trinh Android so 1Frank Pham
 
Introduction_to_android_and_android_studio
Introduction_to_android_and_android_studioIntroduction_to_android_and_android_studio
Introduction_to_android_and_android_studioAbdul Basit
 
08 10-2013 gtu projects - develop final sem gtu project in i phone
08 10-2013 gtu projects - develop final sem gtu project in i phone08 10-2013 gtu projects - develop final sem gtu project in i phone
08 10-2013 gtu projects - develop final sem gtu project in i phoneTOPS Technologies
 
Android app development.pdf
Android app development.pdfAndroid app development.pdf
Android app development.pdfAbanti Aazmin
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applicationsTOPS Technologies
 
Android the first app - hello world - copy
Android   the first app - hello world - copyAndroid   the first app - hello world - copy
Android the first app - hello world - copyDeepa Rani
 
Android software development – the first few hours
Android software development – the first few hoursAndroid software development – the first few hours
Android software development – the first few hourssjmarsh
 

Similar to Bird.pdf (20)

Android wear notes
Android wear notesAndroid wear notes
Android wear notes
 
Android wear notes
Android wear notesAndroid wear notes
Android wear notes
 
Android course (lecture2)
Android course (lecture2)Android course (lecture2)
Android course (lecture2)
 
Android deep dive
Android deep diveAndroid deep dive
Android deep dive
 
Android
AndroidAndroid
Android
 
Day2GDSC.pptx
Day2GDSC.pptxDay2GDSC.pptx
Day2GDSC.pptx
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
 
Android development module
Android development moduleAndroid development module
Android development module
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docx
 
Synapseindia android apps application
Synapseindia android apps applicationSynapseindia android apps application
Synapseindia android apps application
 
Hello android example.
Hello android example.Hello android example.
Hello android example.
 
Introduction to Android and Java.pptx
Introduction to Android and Java.pptxIntroduction to Android and Java.pptx
Introduction to Android and Java.pptx
 
Bai thuc hanh lap trinh Android so 1
Bai thuc hanh lap trinh Android so 1Bai thuc hanh lap trinh Android so 1
Bai thuc hanh lap trinh Android so 1
 
Introduction_to_android_and_android_studio
Introduction_to_android_and_android_studioIntroduction_to_android_and_android_studio
Introduction_to_android_and_android_studio
 
Webinar on Google Android SDK
Webinar on Google Android SDKWebinar on Google Android SDK
Webinar on Google Android SDK
 
08 10-2013 gtu projects - develop final sem gtu project in i phone
08 10-2013 gtu projects - develop final sem gtu project in i phone08 10-2013 gtu projects - develop final sem gtu project in i phone
08 10-2013 gtu projects - develop final sem gtu project in i phone
 
Android app development.pdf
Android app development.pdfAndroid app development.pdf
Android app development.pdf
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
Android the first app - hello world - copy
Android   the first app - hello world - copyAndroid   the first app - hello world - copy
Android the first app - hello world - copy
 
Android software development – the first few hours
Android software development – the first few hoursAndroid software development – the first few hours
Android software development – the first few hours
 

Recently uploaded

VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoĂŁo Esperancinha
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 

Recently uploaded (20)

VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 

Bird.pdf

  • 1. INDEX S.N O Name of the experiment Page. no 1. Installation of Android studio. 1 2. Development Of Hello World Application 7 3. Create an application that takes the name from a textbox and shows hello message along with the name entered in text box, when the user clicks the OK Button 11 4. Project Definition 17 5. Statement of work 5.1 Functional requirements 5.2 Software and Hardware requirements 23 6. Design 24 7. Implementation 27 8. Screenshots 32 9. Conclusion 34 10. References 35
  • 2. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 1 Faculty of Engineering and Technology 1. EXPERIMENT NO.1 INSTALLING AND RUNNING APPLICATIONS ON ANDROID STUDIO Step 1 - System Requirements The required tools to develop Android applications are open source and can be downloaded from the Web. Following is the list of software's you will need before you start your Android application programming. Java JDK5 or later version Java Runtime Environment (JRE) 6 Android Studio Step 2 - Setup Android Studio Android Studio is the official IDE for android application development.It works based on IntelliJ IDEA, You can download the latest version of android studio from Android Studio 2.2 Download, If you are new to installing Android Studio on windows,you will find a file, which is named as android-studio-bundle- 143.3101438-windows.exe.So just download and run on windows machine according to android studio wizard guideline. If you are installing Android Studio on Mac or Linux, You can download the latest version from Android Studio Mac Download,or Android Studio Linux Download, check the instructions provided along with the downloaded file for Mac OS and Linux. This tutorial will consider that you are going to setup your environment on Windows machine having Windows 8.1 operating system. Installation So let's launch Android Studio.exe,Make sure before launch Android Studio, Our Machine should required installed Java JDK. To install Java JDK,take a references of Android environment setup Once you launched Android Studio, its time to mention JDK7 path or later version in android studio installer.
  • 3. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 2 Faculty of Engineering and Technology Below the image initiating JDK to android SDK Need to check the components, which are required to create applications, below the image has selected Android Studio, Android SDK, Android Virtual Machine and performance(Intel chip).
  • 4. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 3 Faculty of Engineering and Technology Need to specify the location of local machine path for Android studio and Android SDK, below the image has taken default location of windows 8.1 x64 bit architecture. Need to specify the ram space for Android emulator by default it would take 512MB of local machine RAM. At final stage, it would extract SDK packages into our local machine, it would take a while time to finish the task and would take 2626MB of Hard disk space. After done all above steps perfectly, you must get finish button and it gonna be open android studio project with Welcome to android studio message as shown below
  • 5. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 4 Faculty of Engineering and Technology You can start your application development by calling start a new android studio project. in a new installation frame should ask Application name, package information and location of the project. After entered application name, it going to be called select the form factors your application runs on, here need to specify Minimum SDK, in our tutorial, I have declared as API23: Android 6.0(Mashmallow) The next level of installation should contain selecting the activity to mobile, it specifies the default layout for Applications
  • 6. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 5 Faculty of Engineering and Technology At the final stage it going to be open development tool to write the application code. Step 3 - Create Android Virtual Device To test your Android applications, you will need a virtual Android device. So before we start writing our code, let us create an Android virtual device. Launch Android AVD Manager Clicking AVD_Manager icon as shown below After Click on a virtual device icon, it going to be shown by default virtual devices which are present on your SDK, or else need to create a virtual device by clicking Create new Virtual device button
  • 7. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 6 Faculty of Engineering and Technology If your AVD is created successfully it means your environment is ready for Android application development. If you like, you can close this window using top-right cross button. Better you re- start your machine and once you are done with this last step, you are ready to proceed for your first Android example but before that we will see few more important concepts related to Android ApplicationDevelopment.
  • 8. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 7 Faculty of Engineering and Technology 2. DEVELOPMENT OF HELLO WORLD APPLICATION AIM: To design an android application to display Hello World First step is to create a simple Android Application using Android studio. When you click on Android studio icon, it will show screen as shownbelow You can start your application development by calling start a new android studio project. in a new installation frame should ask Application name, package information and location of the project.− Configure the Hello World Project Details We'll finish creating the project by configuring some details about its name, location, and the API version it
  • 9. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 8 Faculty of Engineering and Technology Change the name of the application. Change the default Project location to your preferred directory or just leave it as the default location. On the minimum API level, ensure that API 15: Android 4.0.3 IceCreamSandwich is set as the Minimum SDK. This ensures that your application runs on almost all devices. The next level of installation should contain selecting the activity to mobile, it specifies the default layout for Applications.
  • 10. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 9 Faculty of Engineering and Technology SOURCE CODE: The Main Activity File The main activity code is a Java file MainActivity.java. This is the actual application file which ultimately gets conerted to a Dalvik executable and runs your applications. Package com.example.helloworldapplication; import android.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivty wxtends AppCompatActivity { @Override Protected void onCreate(BundlesavedInstanceState) { Super.onCreate(savedInstanceState); setContentVIew(R.layout.activity_main); } } The Layout File The activity_main.xml is a layout file available in res/layout directory, that is referenced by your application when building it’s interface. You will modify this file very frequently to change the layout of your application. For your “Hello World!” application, this file will have following content related to default layout. <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android”layout_width=”match_parent” android:layout_height=”match_parent” > <TextView android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_centerHorizontal=”true” android:layout_centerVertical=”true” android:padding=”@dim en/padding_medium” android:text=”@string/hello_world” tools:context=”MainActivity”/>
  • 11. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 10 Faculty of Engineering and Technology I )Running app on Phone: Connect your Phone to Computer Plug in your device to your computer with a USB cable. If you're developing on Windows, you might need to install this universal ADB USB driver or find your specific USB driver for your device. The next step is to enable USB debugging so your phone can interact with your computer in a developer mode. The following steps are needed: 1. (Windows Only) Install this ADBDriver 2. Plug-in your Android Device to Computer viaUSB 3. Open the "Settings" App on the Device 4. Scroll down to bottom to find "About phone"item 5. Scroll down to bottom to find "Build number" section 6. Tap on "Build Number" 7 times in quicksuccession 7. You should see the message "You are now adeveloper!" 8. Go back to main "Settings" page 9. Scroll down bottom to find "Developer options"item 10. Turn on "USB Debugging" switch and hit "OK" 11. Unplug and re-plug thedevice 12. Dialog appears "Allow USBDebugging?" 13. Check "Always allow from this computer" and then hit "OK" Running your App Now, we can launch apps from Android Studio onto our device: 1. Select one of your projects and click "Run" from the toolbar. 2. In the "Choose Device" window that appears, select the "Choose a running device" radio button, select the device, and clickOK. II) Running app on Emulator(AVD) To run the app from Android studio, open one of your project's activity files and click Run icon from the tool bar. Android studio installs the app on your AVDand starts it and if everything is fine with your set-up and application, it will display following Emulator window −Once Gradle finishes building, Android Studio should install the app on your connected device and start it.
  • 12. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 11 Faculty of Engineering and Technology 3. Create an application that takes the name from a text box and shows hello message along with the name entered in text box, when the user clicks the OK button. Code forMainActivity.java packagecom.example.akshay.m rcet; import android.os.Bundle; importandroid.support.v7.app.AppCompatActivity ; import android.view.View; import android.widget.Button; import android.widget.EditText; importandroid.widget.TextVie w; public class MainActivity extends AppCompatActivity { // These are the global variables EditText editName, editPassword; TextView result; Button buttonSubmit, buttonReset; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); editName = (EditText) findViewById(R.id.editName); editPassword = (EditText) findViewById(R.id.editPassword); result = (TextView) findViewById(R.id.tvResult); buttonSubmit = (Button) findViewById(R.id.buttonSubmit); buttonReset = (Button) findViewById(R.id.buttonReset); /* Submit Button */ buttonSubmit.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v) { String name = editName.getText().toString(); String password = editPassword.getText().toString(); result.setText("Name:t" + name + "nPassword:t" + password ); } buttonReset.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { editName.setText("");
  • 13. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 12 Faculty of Engineering and Technology editPassword.setText(" "); result.setText(""); editName.requestFocus (); } }); } } activity_main.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/andr oid" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FFFF8D" tools:context="com.example.akshay.mrcet.MainActivity"> <TextView android:id="@+id/text View" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:text="NAME" android:textSize="20sp" android:layout_margin="20dp" /> <TextView android:id="@+id/textVi ew2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="20sp" android:text="PASSWORD" android:layout_marginTop="38dp" android:layout_below="@+id/textVie w" android:layout_alignLeft="@+id/textV iew" android:layout_alignStart="@+id/text View" /<EditText android:id="@+id/editName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="10" android:inputType="textPersonName" android:hint="Enter Name" android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:layout_alignParentEnd="true"
  • 14. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 13 Faculty of Engineering and Technology android:layout_alignLeft="@+id/editPasswor d" android:layout_alignStart="@+id/editPasswor d" /> <EditText android:id="@+id/editPassword" android:layout_width="wrap_cont ent" android:layout_height="wrap_cont ent" android:ems="10" android:hint="Enter Password" android:inputType="textPassword" android:layout_alignBottom="@+id/textVie w2" android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:layout_marginRight="18dp" android:layout_marginEnd="18dp" /> <Button android:id="@+id/buttonSubmit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_below="@+id/textView2" android:layout_marginTop="20dp" android:text="SUBMIT" /> <Button android:id="@+id/ buttonReset" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="RESET" android:layout_alignBaseline="@+id/butt onSubmit" android:layout_alignBottom="@+id/butto nSubmit" android:layout_centerHorizontal="true" /> <TextView android:id="@+id/ tvResult" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_marginBottom="143dp" android:textSize="30sp" /> </RelativeLayout>
  • 15. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 14 Faculty of Engineering and Technology A MINI PROJECT ON “FLAPPY BIRD”
  • 16. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 15 Faculty of Engineering and Technology ABSTRACT Flappy Bird is a fun and intuitive mobile game on Android platform driving a lot of people crazy these days. In this game, the player can control the movement of the bird. Pressing the button makes the bird leap upward and on releasing the button the bird will fall freely. In the proposed game design, as soon as the game begins, obstacles will keep appearing from the right side of the screen and move leftwards which will make bird seem to be flying in the forward direction. The goal of this game would be to control the bird, dodging and passing it through as many obstacles as possible. This will run endlessly until the bird hits the obstacle, ground or ceiling. At the beginning of the game, the player is prompted to hit the play button to start the game. Once the Bird is unable to beat the obstacle, the game is concluded and the score for that session is displayed. Flappy bird is a mobile game in which a player controls a bird’s flight height to avoid obstacles. Pressing on the screen for a longer period of time allows the bird to fly higher, while letting go causes the bird to fly lower. This project will bring the mobile game to life using a video camera to detect a player’s motion, and controls the bird based on the speed at which a player flaps her arms. The FPGA will render an image of the bird flying through an environment, and display the flapping motion of the wings according to the player’s speed. Flappy Bird is a mobile game that became incredibly popular in 2014. The game is simple in concept: you control a bird that flaps its wings when you tap the screen, and you must navigate it through a series of p ipes without touching them. The game's difficulty lies in its tricky controls and the fact that even the slightest mistake can cause you to crash. Despite its simple graphics and gameplay, Flappy Bird became a sensation, with many players becoming addicted to its challenging and frustrating nature. However, the game's creator eventually removed it from app stores due to the overwhelming attention it received Flappy Bird is a mobile game that gained immense popularity in 2014. The game's simple yet challenging gameplay made it an instant hit among gamers of all ages. However, the game's creator eventually removed it from app stores due to the overwhelming attention it received. Despite its short-lived success, Flappy Bird remains a cultural phenomenon, with many people still discussing and playing it years later. The game's impact on mobile gaming is undeniable, and its legacy can still be felt in the countless games that have been inspired by it.
  • 17. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 16 Faculty of Engineering and Technology Introduction On February 10th, 2014, the creator of Flappy Bird, a popular side scrolling game for mobile devices, removed the game from mobile application stores (Apple, Android, etc.). The reason for the removal was due to the game becoming “an addictive product” that had “become a problem” (Nguyen). Currently Flappy Bird is only available to those who downloaded the game before its deletion from application stores or through a fan created website, flappybird.io. This final project aims to implement this popular and exciting game in hardware. Previous implementations of this game, such as the original mobile app or fan created online version, exist in software form. As a result, bringing this game into the hardware realm truly distinguishes our project from previous implementations of Flappy Bird. In the preexisting software implemented versions of this game, a small bird must hop to avoid obstacles in the form of green pipes that scroll across the screen from right to left. The user taps the screen or clicks a button to make the bird jump up, but otherwise the bird is constantly falling. Due to the counterintuitive control scheme, which required the user to remain vigilant, constantly monitoring the bird’s path of movement during the game, Flappy Bird became renowned for its difficulty and infuriating controls. Our goal is to implement our own version of the game on an FPGA (Nexis 4 DDR) and make the game more interesting and difficult by incorporating a vision tracking element that requires the player to jump in order to control the onscreen bird protagonist. Specifically, the vision tracking component will look for a bright object placed over the player’s face (a “beak” in the form of a paper party hat), and then use the coordinates of this said object as input for the player coordinates to the game. Therefore, a large change in the player’s vertical position, as monitored by the vision tracking component, will trigger a hop for the player’s onscreen character. By incorporating this vision tracking specific control screen, player’s movements will be continually tracked, resulting in greater emphasis on the player’s attention and engagement within the the game. Additionally, during game play, the player’s face will be layered onto the bird sprite, allowing for a truly personalized experience. Stretch goals of this project include implementing our project on two FPGAs connected via serial link to create a multiplayer experience and dynamic calculations that allow rotation of the bird sprite during jumps. The ideal outcome would be to deliver an aesthetically pleasing and physically engaging game that demonstrates successful implementation of the game integrated with the vision- tracking component
  • 18. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 17 Faculty of Engineering and Technology 4. PROJECT DEFINITION 4.1 PROJECT DESCRIPTION In this project, we design and implement a Flappy Bird like video game on the Sock it development board. Flappy Bird is a very popular mobile game on Android platform, driving a lot of people crazy. In this game, the player can control the vertical movement of bird (every pressing on the keyboard makes the bird leap upward for a little bit, and the bird will fall freely without control). As soon as the game begins, tubes will keep appearing from the right side of the screen and moving leftwards. (So that it seems like the bird flying forward). The goal of this game is to control the bird, dodging and passing the incoming tubes, as many as possible. The game is endless until the bird eventually hit one of the tubes, ground, or ceiling. Figure 1 is the start screen of Flappy Bird. The title "Flappy Bird" is shown in the middle of the uppers side of the screen. The bird is also displayed on the background. Figure 1. Start screen for Flappy Bird Figure 2 shows the screen when the game is on
  • 19. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 18 Faculty of Engineering and Technology The three pillars are displayed on the screen, and so is the score, on top of the background or the pillar Fig: shows the screen while playing the game
  • 20. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 19 Faculty of Engineering and Technology 4.2 Project Objective: 4.2.1 The Process: In my initial approach, I accounted for only three modules: game state, physics and high score. However, as I began implementation of these modules I realized that my original design was flawed in that it did not account for the complexities that come with randomly generating obstacles, different clock domains or the complexities needed to create smooth player (bird sprite protagonist) movement. 4.2.2 Physics Module: Since the game has a scrolling background and obstacles are generated on screen from right to left, the player bird sprite has a fixed horizontal coordinate, the player’s jumps only impact the onscreen sprite’s location in the vertical direction. Keeping this movement in only one dimension eliminates the need to perform rotations and smooth out the xy translational motion via interpolation, reducing the complexity of calculations and ensuring that all needed calculations to produce the updated sprite position can occur within a single clock cycle. 4.2.3 Collision Detection Module: For the collision detection module, the implementation was quite straightforward, essentially I needed to check if the bird ever went beyond the bounds of the output VGA screen or if it collided with an obstacle. Since the bird’s movement is restrained to only the vertical axis, it will never surpass the left of right edge of the screen. When calculating collisions, the size of the bird must be taken into account. For Flappy Bird, the bird coordinate refers to the top left corner of the sprite. Since the size of the bird is 64x64 pixels, collision detection must take into account the entire size of the bird. 4.2.4 Random bit and Obstacle Generation Module: To generate pseudorandomized obstacle locations, I originally designed the random bit module to output a number between 1 and 10 using the $random variable. However, the flaw in the utilization of this $random variable was that I quickly found out that $random only works in simulation, not in physical hardware. I then had to devise an ulterior method of generating pseudorandom bits to use in the obstacle generation module. Since the player’s location coordinates change once every camera frame (even if they are standing still, there are still natural slight movements that occur), it seemed reasonable for me to take the 4 least significant bits from the player position and use them as my pseudorandom bits, resulting in an output of rabbit [3:0] from the random module. 4.2.5 Testing Procedure: To test the various functionality of the timer, olestra, random and collision modules I wrote testbenches that checked that modules worked as predicted. For testing the game state module, namely the transitions between the various states and to make sure the correct bits were enabled, I used the buttons on the Nexus to represent state transitions and utilized the LEDs to represent various output bits, such as the collision and jump sound enable bits. To test the physics module, I first had to integrate my physics module with Nick’s video module.
  • 21. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 20 Faculty of Engineering and Technology 4.2.6 VGA Device Drive: The VGA module is actually a memory-mapped slave, which connects to the Avalon bus through the lightweight AXI bridge. The HPS uses 4-bit address bits to access 16 location that store 8 bits data. More specifically, The software use IOCtl to call the inwrite function in the device driver and specify the registers’ address(a base address of the via slave plus the offset address which is specified in the device tree ) to write. We use Sy’s to connect everything between gaoled and the HPS up. 4.2.7 Future Goals: If I were given more time to do this project, I’d focus on adding two things: support for more colours and replacing the current RGB to YUV conversion with one that is more accurate and uses floating point math. For adding new colours, the changes would just have to be in the parameters, so it would simply involve going into lab with different colour beaks and trying out different configurations and thresholds to optimize for desired colours. In addition, this would require creating at least two modules to change the parameters on the camera and for the thresholds. Replacing the RGB to YUV conversion would require pipelining because of the floating point math operations, but this would simply delay the output, and wouldn’t require adding more steps to the process. Since the time between frames is substantial, there would be virtually no loss to tracking data, and this change would allow for more accurate colour representations in YUV. The end result of the increased colour fidelity is that picking out colours would become easier, and more robust. In addition, this would mean that the need for optimizing the camera’s colour output to the desired one becomes more necessary. 4.3 Project Scope: Image processing pre-process the images to use Generate a memory initialization file for each image Single- port ROM memory blocks 24-bit index colour Audio processing pre-process  the audios Generate a memory initialization file for each audio Single-port ROM memory blocks 44100Hz sampling rate 16-bit quantization  Use limbus C library to communicate with USB keyboard  Spawn one thread to receive signal from Keyboard, leaving the main program to handle the sprite control  Sprite implementation  Hardware and software collaboration  Time management  Architecture design of Sock it board
  • 22. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 21 Faculty of Engineering and Technology 4.4 Project Deliverables: At the highest level, the project will track the player’s face for vertical changes during gameplay and output sound effects (Audio Out) and video graphics (VGA out) where relevant. Depending on the player’s vertical movement, the game logic processing block will change and update the sound and graphics. The vision/object processing block takes input from the OV7670 camera and processes the incoming video stream to determine the location of the “beak” and then sends the location coordinates to the game logic block. The game logic block uses an input button to start the game, and uses a combination of physics and saved previous player location states to determine when to jump. Additionally, the game logic block handles the location of new obstacles, and controls the movements of the bird. If the bird collides with an obstacle, it ends the game. The game logic then sends position data of objects, specifically the player face and obstacle location coordinates, to the video block, and also tells the audio block what sound effects to play. The video block takes input of the player face coordinates to be able to retrieve the player face sprite from BRAM and also takes in the object positions to convert them into image representations. All of this information is then sent over to VGA to be displayed. The audio block plays sound effects based on events determined by the game logic. 4.5 Project Timeline: Game logic : Time ◩ System clock data type is not available in calculation, ex: clock() ◩ Implement counter: loop number as time unit collaborating with delay, ex: usleep() Game logic : Status ◩ Status variable: record jumping and falling ◩ Status variable cooperates with initial velocity supporting continuous jumping without multithread 4.6 Project Team: ‱ Improve our coding style. In our hardware coding, we unroll the program without making it hierarchical as a module which may lead to difficulty for debugging. ‱ Choose high resolution sprite pictures and eliminating sprite background more clearly can make our game picture looks better. ‱ Design more complex game logic can increase our game integrity. Fro example, background changes with time, distance between pillar become random.
  • 23. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 22 Faculty of Engineering and Technology 4.7 Budgets:  The biggest issue is the USB input driver. The kernel in our Sock it board can’t read USB driver library even we update and install the library. We do some modification and using lab2 to environment to make our keyboard work. We also modify bit-width in driver to communicate with Sock it board collaborate with our signal.  Second issue is synchronization between loop in software and frame buffer update in hardware. We need to update the object position when the frame is not showed on the screen.  So we update the screen only when it scans to the bottom of the screen. l Bird motion need time variable which is not straightforward to get. Because the data type we get from system clock is not available for calculation. 4.8 Risk and Mitigation Strategies: Game logic : pillar display ◩ We combine the display of pillar with the check condition ( whether the pillar is on the screen or not ) reset the coordinate of the pillar once the condition is triggered. 4.9 Approval: This section can easily be tested independently from the others, as it requires only two bits of inputs. The two enable bits were mapped to buttons on the Nexus so the sounds could be played on demand. I started with a simple sinewave file loaded into the ROM. After confirming that the logic.
  • 24. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 23 Faculty of Engineering and Technology 5 STATEMENT OF WORK The project can be visualized in four major blocks as shown in Figure 1: object tracking, gameplay logic, audio, and video display. The primary motivation for this project is to make a well designed and physically engaging game that emphasizes and personalizes user experience. Completion of this project requires full functionality of every module. As a result, we require that each of the four critical blocks be independent of the others, allowing for streamlined parallel development and comprehensive testing of the modules. For object tracking purposes, the player is required to wear a “beak”, a brightly coloured party hat over their nose and mouth, similar to a mask. The purpose of the physical “beak” is to provide an object of high contrast that allows us to easily determine the location of the player’s face (Figure 2 below). The vision tracking component will look for a bright object placed over the player’s face (the “beak”), and then use the coordinates of this object as input of the player coordinates to the game. As a result, any large changes in the vertical coordinates of the player will be detected as a jump control sequence. Figure 1: The high-level design of the game 2.2 Design Decisions and Motivation 5.1 Hardware specifications(minimum) Pentium 3 processor. Processor speed of 300 MHZ and above Memory: 512 MB RAM Graphics: DirectX 9.0c compatible video card 512MB DirectX: Version 9.0. 5.2 Software specifications Graphics: DirectX 9.0c compatible video card 512MB DirectX: Version 9.0 Storage: 100 MB available space.
  • 25. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 24 Faculty of Engineering and Technology 6 DESIGN 6.1 Flow Chart Fig 3.1. Flow chart High level block diagram Primary components that constitutes our game includes the ARM core (game logic), device driver, USB controller to control the input from keyboard, Sprite controller (control the display of sprites), audio controller, SDRAM ( store all the data needed in game logic). The game logic module interfaces with several other modules including the USB keyboard, by receiving the control signal; as well as the device driver in order to control the audio and display of sprites, including the positions of pillars and birds, the length of the pillars and the score. Sprite controller is connected to VGA Controller, which is responsible for the display of all the images, and audio controller is connected to audio CODEC on the SoCKit board. Each of the components in our design will be discussed in detail below
  • 26. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 25 Faculty of Engineering and Technology 6.2 Files Used 1. Delay: This component is used the deploy a delay of a given amount of time. 2. Sinter Fire: This is used to read data bit-by-bit and send it to the display. An 8-bit input is passed into the module and it transmits it bit-by-bit. 3. Olivinite: This module contains all the commands to turn on the display and this has to do every time the display is powered on. 4. Bird is: This is the main module in which the movement of the bird is coordinated and the output for the display is determined. A set of multiple screens has been defined here which is used to display the output on the screen of the Pod OLED. Also, the scoring and level increment part is taken care of here itself. 5. Midriver: As the name suggests this module works just as a driver for all the previously defined sets of modules. 6. Charlie: This is the memory module and we have imported it for use in our game. 6.3 Description of Classes  Game View Controller - Manages the game's view and user input  Game Over Scene - Displays the game over screen and allows the player to restart the game  Physics Category - Enumerates the different categories of physics bodies in the game  Sound - Enumerates the different sound effects in the game  Game: This class represents the game itself and acts as the main controller for the entire game. It handles initializing the game window, managing game state (e.g., running, paused, game over), and contains the game loop that updates and renders the game objects. It also manages user input, such as handling key presses to control the bird's flap.  Bird: The Bird class represents the player-controlled character in the game. It manages the bird's position, velocity, and behavior (e.g., flapping, falling). This class handles the bird's movement based on user input and gravity, as well as detecting collisions with obstacles.  Pipe: The Pipe class represents the obstacles that the bird must avoid. It manages the position and movement of pipes as they scroll from right to left on the screen. This class also handles the generation of new pipes as the game progresses and ensures they are appropriately positioned on the screen.
  • 27. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 26 Faculty of Engineering and Technology  Collision Manager: This class is responsible for detecting collisions between the bird and pipes. It checks for collision between the bird's bounding box and the pipes, determining if the bird has collided with an obstacle or not. If a collision is detected, the game's state will change to "Game Over."  Score Manager: The Score Manager class keeps track of the player's score during the game. It increments the score each time the bird successfully passes a set of pipes without colliding with them. The class also manages the high score and updates it accordingly.  Graphics Manager: The Graphics Manager class handles rendering all the game objects on the screen. It utilizes graphics libraries or APIs to draw the bird, pipes, and any other visual elements on the game window. It updates the screen with each game loop iteration.  Sound Manager: This class manages the sound effects and background music in the game. It handles playing sound effects like the flapping sound when the bird jumps or collision sound when it hits an obstacle. It also manages the background music throughout the game.  Game: The Game class is responsible for displaying the user interface elements, such as the score, high score, and any messages like "Game Over" or "Paused." It updates and refreshes the UI based on the game's current state.  These are the essential classes needed to implement a basic version of the Flappy Bird game. Depending on the complexity of your mini-project, you may have additional classes to handle more advanced features like animations, power-ups, or different game modes. But the above classes should form the core components of the Flappy Bird game implementation.
  • 28. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 27 Faculty of Engineering and Technology 7. IMPLEMENTATION SOURCE CODE:
  • 29. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 28 Faculty of Engineering and Technology
  • 30. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 29 Faculty of Engineering and Technology
  • 31. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 30 Faculty of Engineering and Technology
  • 32. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 31 Faculty of Engineering and Technology
  • 33. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 32 Faculty of Engineering and Technology 8. SCREENSHOTS ig 5.1: home page of android virtual device
  • 34. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 33 Faculty of Engineering and Technology Fig 5.2: home page of flappy bird Fig 5.3: shows the screen when the game is on Fig 5.4: game over
  • 35. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 34 Faculty of Engineering and Technology CONCLUSION Implementing this game in hardware was an enjoyable project for all of us. It paired a fun final product with a challenging implementation, an ideal combination for a project in this class. The work was modular and divided well between three people, so we could optimize the division of labor. Our goals were achievable, and we accomplished what we wanted. Overall, this project helped all of us gain experience working with hardware implementation and interfacing with the outside world. Our final project was planned, developed and demonstrated as expected. We designed a new version of Flappy Bird Game written in Python, which could be played either on Pit FT screen or personal computer. Firstly, a user-friendly interface was implemented. Secondly, single player mode was realized. In single player mode, each player have 3 lives and their NetIDs and final scores will be written to a score board, which keeps track of top 10 scores. Then the code of dual player mode was written. It gives users the opportunity to compete with their friends, which will bring a lot of fun. We also implemented two background settings, daytime and night modes. The users could also choose either one background mode before playing the game. One difficulty for users is that the horizontal shifting speed will increasing as time goes on. We also implemented a hidden trick in the single player mode. When user achieves 10 scores, the flappy bird will evolve into flappy Joe.
  • 36. FLAPPY BIRD MOBILE GAME APP Department of Computer Science and Engineering Page 35 Faculty of Engineering and Technology REFERENCES  www.developer.android.com  www.source.android.com  www.wikipedia.com  www.images.google.com  www.firebase.google.com