How to build “Fluffy Sheep” Android Game

29
“Fluffy Sheep” By Lior Bruder - 11Sheep CEO

description

The mobile gaming industry is going to be one of the biggest industries and is planned to reach more than $100 billion by 2017 and this is a good reason to get into the gaming industry… ”Flappy Bird” showed us that even a simple game can make it big. In my lecture i will walk-though and show you how simple it is to build the “Fluffy Sheep” Android game from scratch, using only trivial native Android elements. Besides going over the code and explaining about building games in Android i will give interesting facts on Android gaming, gaming market and what it takes to make money out of it.

Transcript of How to build “Fluffy Sheep” Android Game

Page 1: How to build “Fluffy Sheep” Android Game

“Fluffy Sheep” By Lior Bruder - 11Sheep CEO

Page 2: How to build “Fluffy Sheep” Android Game

About me

Speaker at event and lecturer in technical courses

11Sheep CEO

Advise to high-tech companies and startups

Android developer since the first version

Technology geek & love sheep

First computer

Page 3: How to build “Fluffy Sheep” Android Game

Objectives

1. Create Android game only with native basic Android features

2. Get quick tips about building graphic elements in Android

3. Get quick tips about gaming in mobile and in general

Page 4: How to build “Fluffy Sheep” Android Game

AGENDA

1 2 3 4 5 6 Choosing the right platform

Game Life Cycle

Supporting All screen sizes

Collision Detection

Moving Elements

The Sheep

Page 5: How to build “Fluffy Sheep” Android Game

AGENDA

1 2 3 4 5 6 Choosing the right platform

Game Life Cycle

Supporting All screen sizes

Collision Detection

Moving Elements

The Sheep

Page 6: How to build “Fluffy Sheep” Android Game

Step 1 - Choosing the right platform

Android Specific (Java) Cross Platform

Flash Corona Unity …

Page 7: How to build “Fluffy Sheep” Android Game

Step 1 - Choosing the right platform

Android Specific (Java) Cross Platform

Native And Engine Etc…

Page 8: How to build “Fluffy Sheep” Android Game

Step 1 – Creating the project basics

• Creating the main game component (View) • Creating the main activity

Code

Page 9: How to build “Fluffy Sheep” Android Game

Why make game?

• 80% of $ generated by mobile is from games • The top 25 developers take half of it • 75% of all mobile downloads are games • The mobile gaming industry is expected to

double by 2016

Page 10: How to build “Fluffy Sheep” Android Game

AGENDA

1 2 3 4 5 6 Choosing the right platform

Game Life Cycle

Supporting All screen sizes

Collision Detection

Moving Elements

The Sheep

Page 11: How to build “Fluffy Sheep” Android Game

Step 2 - Game lifecycle

Handling Input

Handling Logic

Writing to screen

Preparing game

One cycle

11

Page 12: How to build “Fluffy Sheep” Android Game

Step 2 – Creating the life cycle

• In the GameView component: – Create the logic function – Create the draw function – Create game states

Code

Page 13: How to build “Fluffy Sheep” Android Game

Making money facts

• In virtual goods alone, freemium games make $12.92 dollars a month per user

• 23% of tablet gamers pay for virtual goods, with an average of $12 dollars per spender

• $3 dollars is the average price at which app gamers feel an app game purchase or a free-top-paid app upgrade is a good value

Page 14: How to build “Fluffy Sheep” Android Game

AGENDA

1 2 3 4 5 6 Choosing the right platform

Game Life Cycle

Supporting All screen sizes

Collision Detection

Moving Elements

The Sheep

Page 15: How to build “Fluffy Sheep” Android Game

Moving the walls “createNewWall()”

• Move this wall from right to left • When the wall reach the left side – create

another wall • Define a constant wall moving time • Use the physics formula: x = v * t

Code

The wall

Page 16: How to build “Fluffy Sheep” Android Game

When do we play?

• Highest percentage of mobile games are played in the bedroom

• Android users spend an average of 9.3 hours a month gaming on their phones

• Games account for 67% of time spent using tablets, vs 33% for smartphones

Page 17: How to build “Fluffy Sheep” Android Game

AGENDA

1 2 3 4 5 6 Choosing the right platform

Game Life Cycle

Supporting All screen sizes

Collision Detection

Moving Elements

The Sheep

Page 18: How to build “Fluffy Sheep” Android Game

Step 4 – The Sheep

• Move the sheep according to the touch

• physics :

Code

Page 19: How to build “Fluffy Sheep” Android Game

AGENDA

1 2 3 4 5 6 Choosing the right platform

Game Life Cycle

Supporting All screen sizes

Collision Detection

Moving Elements

The Sheep

Page 20: How to build “Fluffy Sheep” Android Game

Step 5 – Collision detection

* Pic taken from “Hungry hero” tutorial

Page 21: How to build “Fluffy Sheep” Android Game

Step 5 – Collision detection

In the logic function, check if the sheep collides with the wall object

Code

Page 22: How to build “Fluffy Sheep” Android Game

Popular games facts

• Angry Birds Makes $6 Million per month purely from ads

• Users of Draw Something have created drawings at a rate of 3,000 per second

• Zynga’s mobile gaming division alone brings in more than $10 billion dollars a year

• Roughly 500 billion total birds have been shot in Angry Birds

Page 23: How to build “Fluffy Sheep” Android Game

AGENDA

1 2 3 4 5 6 Choosing the right platform

Game Life Cycle

Supporting All screen sizes

Collision Detection

Moving Elements

The Sheep

Page 24: How to build “Fluffy Sheep” Android Game

Supporting different screen sizes - responsive

Page 25: How to build “Fluffy Sheep” Android Game

Supporting different screen sizes - responsive

• What would happen if we used responsive design in gaming:

Page 26: How to build “Fluffy Sheep” Android Game

Supporting different screen sizes - stretch

• The solution: stretching the display

Page 27: How to build “Fluffy Sheep” Android Game

Wrap it up

Page 28: How to build “Fluffy Sheep” Android Game

Questions?

?

Page 29: How to build “Fluffy Sheep” Android Game

Thank you!

Code on GITHUB: https://github.com/11Sheep/Fluffy-Sheep

Game on google play: https://play.google.com/store/apps/details?id=com.sheep.fluffysheep