SlideShare a Scribd company logo
MONOGAMECross-Platform Native Mobile Development in Paris
Aloïs DENIEL
@aloisdeniel
07/09/2016
Technical Leader
Xamarin
My job
Aloïs DENIEL
alois.deniel@orange.com
@aloisdeniel
Why?
That was my first experience with C#
Different from common UI development
Based sur Xamarin
Adapted to different needs
Where?
Orange Applications for Business
Rennes
The framework
MONOGAME
Xamarin.NET DirectX OpenGL
SharpDX SDL2
Open-source and cross-platform
re-implementation of the XNA
framework, abandonned by
Microsoft few years ago. It is
mainly used in game industry,
for 2D games.
Renowned productions
Cross-platform games
Towerfall FEZ Bastion Infinite FlightTransistor
Mercenary
Kings
Outils et APIs
MONOGAME
Xamarin / .NET
C#Visual Studio
Xamarin Studio
Monogame
Content Pipeline
PNG
WAV
MP3
Font
Main cycle
DrawUpdateInitialize LoadContent
Real time rendering
Inputs
Main cycle
Main class: Game
public class Game : Idisposable
{
// …
protected virtual void Initialize ();
protected virtual void LoadContent ();
protected virtual void Update (GameTime time);
protected virtual void Draw (GameTime time);
}
ContentPipeline
Packaging resources
ContentManager
Resource container
this.Content.RootDirectory = "Content";
protected override void LoadContent()
{
this.ballTexture = this.Content.Load<Texture2D>("assets");
}
protected override void LoadContent()
{
this.texture = Content.Load<Texture2D>("assets");
}
Load textures
From images
protected override void Draw (GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.Black);
spriteBatch.Begin(SpriteSortMode.Immediate);
spriteBatch.Draw(this.texture, this.position1, Color.White);
spriteBatch.Draw(this.texture, this.position2, Color.White);
spriteBatch.Draw(this.texture, this.position3, Color.White);
spriteBatch.End();
Spritebatch Begin
Draw
Draw
Draw
End
Tiles
1 2
3
1 1 1 2
3
3
Image portions
Tiles
var source = new Rectangle(50,0,50,50);
var destination = new Rectangle(150,0,50,50);
spriteBatch.Draw(this.tiles,
sourceRectangle: source,
destinationRectangle: destination);
Source
2
Destination
tiles.png
Image portions
Animations
t=1
t=2
Changing the source dynamically
Camera Ecran
Ecran
RotationTranslation Zoom
Camera
Ecran Ecran
Translation
1
Matrix.CreateTranslation(-100,0,0)
Translation
Camera
Ecran
Ecran
Translation
2
Matrix.CreateRotationZ(0.05f)
Rotation
Camera
Ecran
Ecran
Zoom
2
Matrix.CreateScale(2)
Zoom
Camera
Var transform = Matrix.CreateTranslation(new Vector3(-100,0,0))
* Matrix.CreateRotationZ(0.05f)
* Matrix.CreateScale(new Vector3(2,2,1));
spriteBatch.Begin(transformMatrix: transform);
Matrix maths
Ecran
this.font = Content.Load<SpriteFont>("font");
Polices de caractères
Chargement et affichage
spriteBatch.DrawString(this.font,"Hello World", new Vector2(20,20));
MediaPlayer
MediaPlayer.Play(song);
MediaPlayer.IsRepeating = true;
MediaPlayer.Pause();
Musics
this.song = Content.Load<Song>("music");
SoundEffect
Sounds
this.jumpSound.Play(volume,pitch,pan);
this.jumpSound = Content.Load<SoundEffect>("jump");
User inputs
var state = Mouse.GetState();
state.X , state.Y, state.LeftButton, state.RightButton, …
var state = Keyboard.GetState();
state.IsKeyDown(Key.A), …
var state = GamePad.GetState(PlayerIndex.One);
state.IsButtonDown(Buttons.A), state.ThumbSticks.Left, …
var state = TouchPanel.GetState();
state.First().Position, state.First().Id, state.First().Pressure, …
Manage irregularity
update draw update draw update draw
temps
dt = 50ms dt = 20ms
this.ballPosition +=
new Vector2(0, (float)gameTime.ElapsedTime.TotalSeconds * Ball.Speed)
Physics
origine
destination
théorique
destination
obstacle
collision
AABB Collisions
origine
Moves / Gravity
A = M * (0, 9.8)
V += A * delta
P += 0.5 * V * delta * delta
Simulate a world
Entity/Component/System
Commonly used (i.e Unity3D)
Player
int X { get; set; }
int Y { get; set; }
Texture2D Texture { get; set; }
float Health { get; set; }
void Update(int time);
void Draw();
Development pattern
Entity
int X { get; set; }
int Y { get; set; }
PositionComponent
float Health { get; set; }
HealthComponent
string Texture { get; set; }
Rectangle Source { get; set; }
Rectangle Destination{ get; set; }
SpriteComponent
RenderSystem RulesSystem
void Draw(); void Update(int time);
Int Identifier { get; set; }
http://goo.gl/oeYUyq
Solutions
Tiled + TiledSharp Map tile manager
Entitas Entity/Component/System Framework
Farseer Advanced physics simulation
Monocle Engine Engine (by Matt Thorson, Towerfall creator)
Frameworks
Other platforms
Unity Advanced tools (licences)
https://github.com/aloisdeniel/awesome-monogame
Start!
Different project architecture from UI projects
Expand your horizons: maths, physics, draw, audio, video, code
Start from simple APIs and grow with your own logic
Be creative
Start simple
Thanks
Contact me
@aloisdeniel
alois.deniel@orange.com

More Related Content

Similar to Monogame Introduction (ENG)

Silverlight as a Gaming Platform
Silverlight as a Gaming PlatformSilverlight as a Gaming Platform
Silverlight as a Gaming Platform
goodfriday
 
Useful Tools for Making Video Games - Irrlicht (2008)
Useful Tools for Making Video Games - Irrlicht (2008)Useful Tools for Making Video Games - Irrlicht (2008)
Useful Tools for Making Video Games - Irrlicht (2008)
Korhan Bircan
 
Unity3D Programming
Unity3D ProgrammingUnity3D Programming
Unity3D Programming
Michael Ivanov
 
Game development with Cocos2d-x Engine
Game development with Cocos2d-x EngineGame development with Cocos2d-x Engine
Game development with Cocos2d-x Engine
Duy Tan Geek
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
Nick Pruehs
 
Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...
David Salz
 
FISL14 - A Multiplatform Architecture for Games
FISL14 - A Multiplatform Architecture for GamesFISL14 - A Multiplatform Architecture for Games
FISL14 - A Multiplatform Architecture for Games
Thiago Figueredo Cardoso
 
XNA And Silverlight
XNA And SilverlightXNA And Silverlight
XNA And Silverlight
Aaron King
 
Criando jogos para o windows 8
Criando jogos para o windows 8Criando jogos para o windows 8
Criando jogos para o windows 8
José Farias
 
A 3D printing programming API
A 3D printing programming APIA 3D printing programming API
A 3D printing programming API
Max Kleiner
 
Writing videogames with titanium appcelerator
Writing videogames with titanium appceleratorWriting videogames with titanium appcelerator
Writing videogames with titanium appcelerator
Alessio Ricco
 
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
Andrey Karpov
 
Md2010 jl-wp7-sl-game-dev
Md2010 jl-wp7-sl-game-devMd2010 jl-wp7-sl-game-dev
Md2010 jl-wp7-sl-game-dev
Jose Luis Latorre Millas
 
Libtcc and gwan
Libtcc and gwanLibtcc and gwan
Libtcc and gwan
DaeMyung Kang
 
Libtcc and gwan
Libtcc and gwanLibtcc and gwan
Libtcc and gwan
DaeMyung Kang
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
PVS-Studio
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
Andrey Karpov
 
Implementing a Simple Game using libGDX
Implementing a Simple Game using libGDXImplementing a Simple Game using libGDX
Implementing a Simple Game using libGDX
Jussi Pohjolainen
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2d
Vinsol
 
Android game development
Android game developmentAndroid game development
Android game development
dmontagni
 

Similar to Monogame Introduction (ENG) (20)

Silverlight as a Gaming Platform
Silverlight as a Gaming PlatformSilverlight as a Gaming Platform
Silverlight as a Gaming Platform
 
Useful Tools for Making Video Games - Irrlicht (2008)
Useful Tools for Making Video Games - Irrlicht (2008)Useful Tools for Making Video Games - Irrlicht (2008)
Useful Tools for Making Video Games - Irrlicht (2008)
 
Unity3D Programming
Unity3D ProgrammingUnity3D Programming
Unity3D Programming
 
Game development with Cocos2d-x Engine
Game development with Cocos2d-x EngineGame development with Cocos2d-x Engine
Game development with Cocos2d-x Engine
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
 
Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...
 
FISL14 - A Multiplatform Architecture for Games
FISL14 - A Multiplatform Architecture for GamesFISL14 - A Multiplatform Architecture for Games
FISL14 - A Multiplatform Architecture for Games
 
XNA And Silverlight
XNA And SilverlightXNA And Silverlight
XNA And Silverlight
 
Criando jogos para o windows 8
Criando jogos para o windows 8Criando jogos para o windows 8
Criando jogos para o windows 8
 
A 3D printing programming API
A 3D printing programming APIA 3D printing programming API
A 3D printing programming API
 
Writing videogames with titanium appcelerator
Writing videogames with titanium appceleratorWriting videogames with titanium appcelerator
Writing videogames with titanium appcelerator
 
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
 
Md2010 jl-wp7-sl-game-dev
Md2010 jl-wp7-sl-game-devMd2010 jl-wp7-sl-game-dev
Md2010 jl-wp7-sl-game-dev
 
Libtcc and gwan
Libtcc and gwanLibtcc and gwan
Libtcc and gwan
 
Libtcc and gwan
Libtcc and gwanLibtcc and gwan
Libtcc and gwan
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
Implementing a Simple Game using libGDX
Implementing a Simple Game using libGDXImplementing a Simple Game using libGDX
Implementing a Simple Game using libGDX
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2d
 
Android game development
Android game developmentAndroid game development
Android game development
 

Recently uploaded

How GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdfHow GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdf
Zycus
 
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
dhavalvaghelanectarb
 
Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)
wonyong hwang
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
The Third Creative Media
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
Hands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion StepsHands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion Steps
servicesNitor
 
Building API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructureBuilding API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructure
confluent
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
What’s New in VictoriaLogs - Q2 2024 Update
What’s New in VictoriaLogs - Q2 2024 UpdateWhat’s New in VictoriaLogs - Q2 2024 Update
What’s New in VictoriaLogs - Q2 2024 Update
VictoriaMetrics
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Ortus Solutions, Corp
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
vaishalijagtap12
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
Paul Brebner
 
Beginner's Guide to Observability@Devoxx PL 2024
Beginner's  Guide to Observability@Devoxx PL 2024Beginner's  Guide to Observability@Devoxx PL 2024
Beginner's Guide to Observability@Devoxx PL 2024
michniczscribd
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
kalichargn70th171
 

Recently uploaded (20)

How GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdfHow GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdf
 
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
 
Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
Hands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion StepsHands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion Steps
 
Building API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructureBuilding API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructure
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
What’s New in VictoriaLogs - Q2 2024 Update
What’s New in VictoriaLogs - Q2 2024 UpdateWhat’s New in VictoriaLogs - Q2 2024 Update
What’s New in VictoriaLogs - Q2 2024 Update
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
 
Beginner's Guide to Observability@Devoxx PL 2024
Beginner's  Guide to Observability@Devoxx PL 2024Beginner's  Guide to Observability@Devoxx PL 2024
Beginner's Guide to Observability@Devoxx PL 2024
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
 

Monogame Introduction (ENG)