Post on 25-Dec-2014
description
“Fluffy Sheep” By Lior Bruder - 11Sheep CEO
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
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
AGENDA
1 2 3 4 5 6 Choosing the right platform
Game Life Cycle
Supporting All screen sizes
Collision Detection
Moving Elements
The Sheep
AGENDA
1 2 3 4 5 6 Choosing the right platform
Game Life Cycle
Supporting All screen sizes
Collision Detection
Moving Elements
The Sheep
Step 1 - Choosing the right platform
Android Specific (Java) Cross Platform
Flash Corona Unity …
Step 1 - Choosing the right platform
Android Specific (Java) Cross Platform
Native And Engine Etc…
Step 1 – Creating the project basics
• Creating the main game component (View) • Creating the main activity
Code
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
AGENDA
1 2 3 4 5 6 Choosing the right platform
Game Life Cycle
Supporting All screen sizes
Collision Detection
Moving Elements
The Sheep
Step 2 - Game lifecycle
Handling Input
Handling Logic
Writing to screen
Preparing game
One cycle
11
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
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
AGENDA
1 2 3 4 5 6 Choosing the right platform
Game Life Cycle
Supporting All screen sizes
Collision Detection
Moving Elements
The Sheep
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
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
AGENDA
1 2 3 4 5 6 Choosing the right platform
Game Life Cycle
Supporting All screen sizes
Collision Detection
Moving Elements
The Sheep
Step 4 – The Sheep
• Move the sheep according to the touch
• physics :
Code
AGENDA
1 2 3 4 5 6 Choosing the right platform
Game Life Cycle
Supporting All screen sizes
Collision Detection
Moving Elements
The Sheep
Step 5 – Collision detection
* Pic taken from “Hungry hero” tutorial
Step 5 – Collision detection
In the logic function, check if the sheep collides with the wall object
Code
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
AGENDA
1 2 3 4 5 6 Choosing the right platform
Game Life Cycle
Supporting All screen sizes
Collision Detection
Moving Elements
The Sheep
Supporting different screen sizes - responsive
Supporting different screen sizes - responsive
• What would happen if we used responsive design in gaming:
Supporting different screen sizes - stretch
• The solution: stretching the display
Wrap it up
Code on GITHUB: https://github.com/11Sheep/Fluffy-Sheep
Game on google play: https://play.google.com/store/apps/details?id=com.sheep.fluffysheep
Questions?
?