Building "Fluffy Sheep" in 40 min

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 Building "Fluffy Sheep" in 40 min

Page 1: Building "Fluffy Sheep" in 40 min

“Fluffy Sheep” By Lior Bruder - 11Sheep CEO

Page 2: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

Step 1 - Choosing the right platform

Android Specific (Java) Cross Platform

Flash Corona Unity …

Page 7: Building "Fluffy Sheep" in 40 min

Step 1 - Choosing the right platform

Android Specific (Java) Cross Platform

Native And Engine Etc…

Page 8: Building "Fluffy Sheep" in 40 min

Step 1 – Creating the project basics

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

Code

Page 9: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

Step 2 - Game lifecycle

Handling Input

Handling Logic

Writing to screen

Preparing game

One cycle

11

Page 12: Building "Fluffy Sheep" in 40 min

Step 2 – Creating the life cycle

• In the GameView component:

– Create game states – Create the input function – Create the logic function – Create the draw function

Code

Page 13: Building "Fluffy Sheep" in 40 min

Making money facts

• 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: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

Step 4 – The Sheep

• Move the sheep according to the touch

• physics :

Code

Page 19: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

Step 5 – Collision detection

* Pic taken from “Hungry hero” tutorial

Page 21: Building "Fluffy Sheep" in 40 min

Step 5 – Collision detection

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

Code

Page 22: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

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: Building "Fluffy Sheep" in 40 min

Supporting different screen sizes - responsive

Page 25: Building "Fluffy Sheep" in 40 min

Supporting different screen sizes - responsive

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

Page 26: Building "Fluffy Sheep" in 40 min

Supporting different screen sizes - stretch

• The solution: stretching the display

Page 27: Building "Fluffy Sheep" in 40 min

Wrap it up

Page 28: Building "Fluffy Sheep" in 40 min

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

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

Page 29: Building "Fluffy Sheep" in 40 min

Questions?

?