SlideShare uma empresa Scribd logo
1 de 8
Baixar para ler offline
A FLAPPY-BIRD
STYLE GAME
Santiago Yepes Serna
Game Creator and Fan
Game Information
This a 2D game where we must control a
bird and avoid all the obstacles, like col-
umns and spikes, also we earn some score
every time that we cross a column. Is im-
portant to notice that we will die immedi-
ately if we touch any object on the screen..
Characteristics
Design
The first step was to create the environment: I put the columns in the top
and Bottom of the screen, I added the floor and the spikes, these last
ones were an invention of my own in order to make the game harder.
The second step was create the sprites of the main character "hero" and program-
ming the animation using the Unity Animator feature for every sprite : Fly, stand by
and dead.
Characteristics
Programming
This section has the scripts that allow the game work properly, a lot of the "methods"
and variables have their names in "Spanish" Because this game is initially intended
for Spanish-Speakers users, but the functions, logic, and content of the script are in
English. Also its important to said that each scrip has a brief description about what it
does.
Main Character
This script controls the up- force applied to the rigid body in the bird script, also
check if our "hero" have touches any object in the screen, if this is the case, will stop
the game and will shows the "game over" massage .
public class Bird : MonoBehaviour {
	 private bool isdead;
	 private Rigidbody2D rd2;
	 private Animator anim;
	 public float upforce= 200f;
	 public birdrotate rotatebird;
	 void Awake ()
	{
		 rd2 = GetComponent<Rigidbody2D>();
		 anim = GetComponent<Animator> ();
	}
	
	 // Update is called once per frame
	 void Update ()
	{
		 if (isdead) return;
		{
			if (Input.GetMouseButtonDown(0))
				{
Characteristics
				rd2.velocity = Vector2.zero;
				rd2.AddForce(new Vector2 (0,upforce));
				anim.SetTrigger ("flap");
				soundsystem.referencia.playfly ();
				}
		}
		
	}
	 void OnCollisionEnter2D(Collision2D collision)
	{
		 isdead = true;
		anim.SetTrigger ("dead");
		controladorjuego.referencia.birdie ();
		soundsystem.referencia.playdead ();
		 rotatebird.enabled = false;
	}
}
Game controller
This scripts have the methods that determine what should happend if the bird
touches an object (Will die), if the bird crosses between two columns ( in this case
will add score to the game score) and also destroy the game objects that out the
main screen in order to clean the memory resources.
public class controladorjuego : MonoBehaviour {
	 public static controladorjuego referencia;
	 public GameObject gameovertext;
	 public bool gameover;
	 public float scrollspeed = -1.5f;
	 private int valuescore;
	 public Text scoretextvalue;
	 void Awake()
	{
		 controladorjuego.referencia = this;
		 if (controladorjuego.referencia == null)
		{
			controladorjuego.referencia = this;
		}
		 else if (controladorjuego.referencia != this)
Characteristics
		
	
		{
			Destroy (gameObject);
			 Debug.LogWarning("Este objeto ha sido instanciado por segunda vez ¡error!");
		}
	}
	 public void birdscore()
	{
		if (gameover)return;
		{
			valuescore=valuescore+10;
			 scoretextvalue.text = "Score: " + valuescore;
			soundsystem.referencia.playpoint ();
		}
	}
	 public void birdie()
	{
		gameovertext.SetActive (true);
		gameover=true;
	}
	 private void OnDestroy()
	{
		 if (controladorjuego.referencia == this)
		{
			controladorjuego.referencia = null;
		}
	}
}
}
Characteristics
Column Behavior
This script controls when and where the columns should be spawned, also has the
call to the methods in the "Gamecontroller Script" in order to determinate what
would happen if they touch the bird
	 public class columns : MonoBehaviour {
	 private void OnTriggerEnter2D(Collider2D collider)
	{
		 if (collider.CompareTag ("Player"))
		{
			controladorjuego.referencia.birdscore ();
		}
	}
ublic int canticolumnas = 5;
	 public GameObject columprefab;
	 private GameObject [] columnas;
	 private float columnymax= 1.3f;
	 private float columnymin=1.4f;
	 private float columnx=9f;
	 private Vector2 posicioncolumnas = new Vector2 (-13, 0);
	 private float timelastcolumn;
	 public float columnspawnrate;
	 private int columnactual;
	 // Use this for initialization
	 void Start () {
		 columnas = new GameObject [canticolumnas];
		 for ( int i =0; i<canticolumnas; i++)
		{
			 columnas [i] = Instantiate (columprefab, posicioncolumnas, Quaternion.identity);
		}
		spawncolumn ();
Characteristics
	}
	
	 // Update is called once per frame
	 void Update ()
	
	{
		timelastcolumn += Time.deltaTime;
		 if (!controladorjuego.referencia.gameover && timelastcolumn >= columnspawnrate)
		{
			spawncolumn ();
		}
		
	}
	 void spawncolumn()
	{
		
			timelastcolumn = 0;
			 float spawnyposition = Random.Range (columnymin, columnymax);
			 columnas [columnactual].transform.position =new Vector2 (columnx, spawnyposi-
tion);
			columnactual++;
			if(columnactual>=canticolumnas)
			{
				columnactual = 0;
			}
	}
}}
Sound And Effects
The Sounds and Music of this game were taken from free sources web Music and
sounds and the effects and sprites were taken from:
Unity free Assets Store

Mais conteúdo relacionado

Mais procurados

Html5 game, websocket e arduino
Html5 game, websocket e arduinoHtml5 game, websocket e arduino
Html5 game, websocket e arduinomonksoftwareit
 
Test driven game development silly, stupid or inspired?
Test driven game development   silly, stupid or inspired?Test driven game development   silly, stupid or inspired?
Test driven game development silly, stupid or inspired?Eric Smith
 
Getting touchy - an introduction to touch and pointer events / Future of Web ...
Getting touchy - an introduction to touch and pointer events / Future of Web ...Getting touchy - an introduction to touch and pointer events / Future of Web ...
Getting touchy - an introduction to touch and pointer events / Future of Web ...Patrick Lauke
 
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะ
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะคอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะ
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะpornthip7890
 
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะ
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะคอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะ
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะpornthip7890
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 6 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 6 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 6 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 6 (Preview)noorcon
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)noorcon
 
PyCon2009_AI_Alt
PyCon2009_AI_AltPyCon2009_AI_Alt
PyCon2009_AI_AltHiroshi Ono
 
The Ring programming language version 1.5.4 book - Part 46 of 185
The Ring programming language version 1.5.4 book - Part 46 of 185The Ring programming language version 1.5.4 book - Part 46 of 185
The Ring programming language version 1.5.4 book - Part 46 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.4.1 book - Part 15 of 31
The Ring programming language version 1.4.1 book - Part 15 of 31The Ring programming language version 1.4.1 book - Part 15 of 31
The Ring programming language version 1.4.1 book - Part 15 of 31Mahmoud Samir Fayed
 
กิจกรรม It news
กิจกรรม It newsกิจกรรม It news
กิจกรรม It newsPop Saranai
 
The Ring programming language version 1.2 book - Part 34 of 84
The Ring programming language version 1.2 book - Part 34 of 84The Ring programming language version 1.2 book - Part 34 of 84
The Ring programming language version 1.2 book - Part 34 of 84Mahmoud Samir Fayed
 
ruby2600 - an Atari 2600 emulator written in Ruby
ruby2600 - an Atari 2600 emulator written in Rubyruby2600 - an Atari 2600 emulator written in Ruby
ruby2600 - an Atari 2600 emulator written in RubyCarlos Duarte do Nascimento
 
The Ring programming language version 1.8 book - Part 57 of 202
The Ring programming language version 1.8 book - Part 57 of 202The Ring programming language version 1.8 book - Part 57 of 202
The Ring programming language version 1.8 book - Part 57 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 50 of 196
The Ring programming language version 1.7 book - Part 50 of 196The Ring programming language version 1.7 book - Part 50 of 196
The Ring programming language version 1.7 book - Part 50 of 196Mahmoud Samir Fayed
 

Mais procurados (20)

Html5 game, websocket e arduino
Html5 game, websocket e arduinoHtml5 game, websocket e arduino
Html5 game, websocket e arduino
 
Test driven game development silly, stupid or inspired?
Test driven game development   silly, stupid or inspired?Test driven game development   silly, stupid or inspired?
Test driven game development silly, stupid or inspired?
 
Ubiquitous Language
Ubiquitous LanguageUbiquitous Language
Ubiquitous Language
 
Task 2 Work Flow
Task 2 Work FlowTask 2 Work Flow
Task 2 Work Flow
 
Getting touchy - an introduction to touch and pointer events / Future of Web ...
Getting touchy - an introduction to touch and pointer events / Future of Web ...Getting touchy - an introduction to touch and pointer events / Future of Web ...
Getting touchy - an introduction to touch and pointer events / Future of Web ...
 
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะ
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะคอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะ
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะ
 
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะ
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะคอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะ
คอมพิวเตอร์ มารู้จักคอมพิวเตอร์กันเถอะ
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 6 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 6 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 6 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 6 (Preview)
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)
 
libGDX: Scene2D
libGDX: Scene2DlibGDX: Scene2D
libGDX: Scene2D
 
Of class2
Of class2Of class2
Of class2
 
PyCon2009_AI_Alt
PyCon2009_AI_AltPyCon2009_AI_Alt
PyCon2009_AI_Alt
 
The Ring programming language version 1.5.4 book - Part 46 of 185
The Ring programming language version 1.5.4 book - Part 46 of 185The Ring programming language version 1.5.4 book - Part 46 of 185
The Ring programming language version 1.5.4 book - Part 46 of 185
 
The Ring programming language version 1.4.1 book - Part 15 of 31
The Ring programming language version 1.4.1 book - Part 15 of 31The Ring programming language version 1.4.1 book - Part 15 of 31
The Ring programming language version 1.4.1 book - Part 15 of 31
 
กิจกรรม It news
กิจกรรม It newsกิจกรรม It news
กิจกรรม It news
 
The Ring programming language version 1.2 book - Part 34 of 84
The Ring programming language version 1.2 book - Part 34 of 84The Ring programming language version 1.2 book - Part 34 of 84
The Ring programming language version 1.2 book - Part 34 of 84
 
Atari 2600 VCS Programming
Atari 2600 VCS ProgrammingAtari 2600 VCS Programming
Atari 2600 VCS Programming
 
ruby2600 - an Atari 2600 emulator written in Ruby
ruby2600 - an Atari 2600 emulator written in Rubyruby2600 - an Atari 2600 emulator written in Ruby
ruby2600 - an Atari 2600 emulator written in Ruby
 
The Ring programming language version 1.8 book - Part 57 of 202
The Ring programming language version 1.8 book - Part 57 of 202The Ring programming language version 1.8 book - Part 57 of 202
The Ring programming language version 1.8 book - Part 57 of 202
 
The Ring programming language version 1.7 book - Part 50 of 196
The Ring programming language version 1.7 book - Part 50 of 196The Ring programming language version 1.7 book - Part 50 of 196
The Ring programming language version 1.7 book - Part 50 of 196
 

Semelhante a Flappy bird

ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdfObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdfrajkumarm401
 
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)Pujana Paliyawan
 
Students to Business Day 2012: Rob Miles
Students to Business Day 2012: Rob MilesStudents to Business Day 2012: Rob Miles
Students to Business Day 2012: Rob MilesFrederik De Bruyne
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconftutorialsruby
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconftutorialsruby
 
Y1 gd level_designworkflow
Y1 gd level_designworkflowY1 gd level_designworkflow
Y1 gd level_designworkflowcrisgalliano
 
Silverlight as a Gaming Platform
Silverlight as a Gaming PlatformSilverlight as a Gaming Platform
Silverlight as a Gaming Platformgoodfriday
 
The Ring programming language version 1.5.4 book - Part 48 of 185
The Ring programming language version 1.5.4 book - Part 48 of 185The Ring programming language version 1.5.4 book - Part 48 of 185
The Ring programming language version 1.5.4 book - Part 48 of 185Mahmoud Samir Fayed
 
Unity遊戲程式設計 - 2D platformer game
Unity遊戲程式設計 - 2D platformer gameUnity遊戲程式設計 - 2D platformer game
Unity遊戲程式設計 - 2D platformer game吳錫修 (ShyiShiou Wu)
 
Unity遊戲程式設計 - 2D Platformer遊戲
Unity遊戲程式設計 - 2D Platformer遊戲Unity遊戲程式設計 - 2D Platformer遊戲
Unity遊戲程式設計 - 2D Platformer遊戲吳錫修 (ShyiShiou Wu)
 
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88Mahmoud Samir Fayed
 
BGA Studio - Focus on BGA Game state machine
BGA Studio - Focus on BGA Game state machine BGA Studio - Focus on BGA Game state machine
BGA Studio - Focus on BGA Game state machine Board Game Arena
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfudit652068
 
ARTDM 170, Week 11: User Interaction
ARTDM 170, Week 11: User InteractionARTDM 170, Week 11: User Interaction
ARTDM 170, Week 11: User InteractionGilbert Guerrero
 
Oxygine 2 d objects,events,debug and resources
Oxygine 2 d objects,events,debug and resourcesOxygine 2 d objects,events,debug and resources
Oxygine 2 d objects,events,debug and resourcescorehard_by
 
The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.5.3 book - Part 79 of 184The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.5.3 book - Part 79 of 184Mahmoud Samir Fayed
 

Semelhante a Flappy bird (20)

ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdfObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
 
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
 
Windows Phone: From Idea to Published Game in 75 minutes
Windows Phone: From Idea to Published Game in 75 minutesWindows Phone: From Idea to Published Game in 75 minutes
Windows Phone: From Idea to Published Game in 75 minutes
 
Students to Business Day 2012: Rob Miles
Students to Business Day 2012: Rob MilesStudents to Business Day 2012: Rob Miles
Students to Business Day 2012: Rob Miles
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconf
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconf
 
Y1 gd level_designworkflow
Y1 gd level_designworkflowY1 gd level_designworkflow
Y1 gd level_designworkflow
 
Silverlight as a Gaming Platform
Silverlight as a Gaming PlatformSilverlight as a Gaming Platform
Silverlight as a Gaming Platform
 
The Ring programming language version 1.5.4 book - Part 48 of 185
The Ring programming language version 1.5.4 book - Part 48 of 185The Ring programming language version 1.5.4 book - Part 48 of 185
The Ring programming language version 1.5.4 book - Part 48 of 185
 
Unity遊戲程式設計 - 2D platformer game
Unity遊戲程式設計 - 2D platformer gameUnity遊戲程式設計 - 2D platformer game
Unity遊戲程式設計 - 2D platformer game
 
Unity遊戲程式設計 - 2D Platformer遊戲
Unity遊戲程式設計 - 2D Platformer遊戲Unity遊戲程式設計 - 2D Platformer遊戲
Unity遊戲程式設計 - 2D Platformer遊戲
 
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88
 
Tdd in unity
Tdd in unityTdd in unity
Tdd in unity
 
Game dev 101 part 3
Game dev 101 part 3Game dev 101 part 3
Game dev 101 part 3
 
BGA Studio - Focus on BGA Game state machine
BGA Studio - Focus on BGA Game state machine BGA Studio - Focus on BGA Game state machine
BGA Studio - Focus on BGA Game state machine
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
 
ARTDM 170, Week 11: User Interaction
ARTDM 170, Week 11: User InteractionARTDM 170, Week 11: User Interaction
ARTDM 170, Week 11: User Interaction
 
Md2010 jl-wp7-sl-game-dev
Md2010 jl-wp7-sl-game-devMd2010 jl-wp7-sl-game-dev
Md2010 jl-wp7-sl-game-dev
 
Oxygine 2 d objects,events,debug and resources
Oxygine 2 d objects,events,debug and resourcesOxygine 2 d objects,events,debug and resources
Oxygine 2 d objects,events,debug and resources
 
The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.5.3 book - Part 79 of 184The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.5.3 book - Part 79 of 184
 

Último

英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 

Último (20)

Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 

Flappy bird

  • 1. A FLAPPY-BIRD STYLE GAME Santiago Yepes Serna Game Creator and Fan
  • 2. Game Information This a 2D game where we must control a bird and avoid all the obstacles, like col- umns and spikes, also we earn some score every time that we cross a column. Is im- portant to notice that we will die immedi- ately if we touch any object on the screen..
  • 3. Characteristics Design The first step was to create the environment: I put the columns in the top and Bottom of the screen, I added the floor and the spikes, these last ones were an invention of my own in order to make the game harder. The second step was create the sprites of the main character "hero" and program- ming the animation using the Unity Animator feature for every sprite : Fly, stand by and dead.
  • 4. Characteristics Programming This section has the scripts that allow the game work properly, a lot of the "methods" and variables have their names in "Spanish" Because this game is initially intended for Spanish-Speakers users, but the functions, logic, and content of the script are in English. Also its important to said that each scrip has a brief description about what it does. Main Character This script controls the up- force applied to the rigid body in the bird script, also check if our "hero" have touches any object in the screen, if this is the case, will stop the game and will shows the "game over" massage . public class Bird : MonoBehaviour { private bool isdead; private Rigidbody2D rd2; private Animator anim; public float upforce= 200f; public birdrotate rotatebird; void Awake () { rd2 = GetComponent<Rigidbody2D>(); anim = GetComponent<Animator> (); } // Update is called once per frame void Update () { if (isdead) return; { if (Input.GetMouseButtonDown(0)) {
  • 5. Characteristics rd2.velocity = Vector2.zero; rd2.AddForce(new Vector2 (0,upforce)); anim.SetTrigger ("flap"); soundsystem.referencia.playfly (); } } } void OnCollisionEnter2D(Collision2D collision) { isdead = true; anim.SetTrigger ("dead"); controladorjuego.referencia.birdie (); soundsystem.referencia.playdead (); rotatebird.enabled = false; } } Game controller This scripts have the methods that determine what should happend if the bird touches an object (Will die), if the bird crosses between two columns ( in this case will add score to the game score) and also destroy the game objects that out the main screen in order to clean the memory resources. public class controladorjuego : MonoBehaviour { public static controladorjuego referencia; public GameObject gameovertext; public bool gameover; public float scrollspeed = -1.5f; private int valuescore; public Text scoretextvalue; void Awake() { controladorjuego.referencia = this; if (controladorjuego.referencia == null) { controladorjuego.referencia = this; } else if (controladorjuego.referencia != this)
  • 6. Characteristics { Destroy (gameObject); Debug.LogWarning("Este objeto ha sido instanciado por segunda vez ¡error!"); } } public void birdscore() { if (gameover)return; { valuescore=valuescore+10; scoretextvalue.text = "Score: " + valuescore; soundsystem.referencia.playpoint (); } } public void birdie() { gameovertext.SetActive (true); gameover=true; } private void OnDestroy() { if (controladorjuego.referencia == this) { controladorjuego.referencia = null; } } } }
  • 7. Characteristics Column Behavior This script controls when and where the columns should be spawned, also has the call to the methods in the "Gamecontroller Script" in order to determinate what would happen if they touch the bird public class columns : MonoBehaviour { private void OnTriggerEnter2D(Collider2D collider) { if (collider.CompareTag ("Player")) { controladorjuego.referencia.birdscore (); } } ublic int canticolumnas = 5; public GameObject columprefab; private GameObject [] columnas; private float columnymax= 1.3f; private float columnymin=1.4f; private float columnx=9f; private Vector2 posicioncolumnas = new Vector2 (-13, 0); private float timelastcolumn; public float columnspawnrate; private int columnactual; // Use this for initialization void Start () { columnas = new GameObject [canticolumnas]; for ( int i =0; i<canticolumnas; i++) { columnas [i] = Instantiate (columprefab, posicioncolumnas, Quaternion.identity); } spawncolumn ();
  • 8. Characteristics } // Update is called once per frame void Update () { timelastcolumn += Time.deltaTime; if (!controladorjuego.referencia.gameover && timelastcolumn >= columnspawnrate) { spawncolumn (); } } void spawncolumn() { timelastcolumn = 0; float spawnyposition = Random.Range (columnymin, columnymax); columnas [columnactual].transform.position =new Vector2 (columnx, spawnyposi- tion); columnactual++; if(columnactual>=canticolumnas) { columnactual = 0; } } }} Sound And Effects The Sounds and Music of this game were taken from free sources web Music and sounds and the effects and sprites were taken from: Unity free Assets Store