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);
}
Monogame Introduction (ENG)
ContentPipeline
Packaging resources
ContentManager
Resource container
this.Content.RootDirectory = "Content";
protected override void LoadContent()
{
this.ballTexture = this.Content.Load<Texture2D>("assets");
}
Monogame Introduction (ENG)
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));
Monogame Introduction (ENG)
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");
Monogame Introduction (ENG)
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
Monogame Introduction (ENG)
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

PDF
Flappy bird
PPT
Gdc09 Minigames
KEY
Introduction to Game Programming Tutorial
PDF
Functional and reactive u is gwt.create 2015
PDF
libGDX: Scene2D
PDF
Of class2
PDF
XNA Windows 8 MonoGame
PDF
Storyboard Example
Flappy bird
Gdc09 Minigames
Introduction to Game Programming Tutorial
Functional and reactive u is gwt.create 2015
libGDX: Scene2D
Of class2
XNA Windows 8 MonoGame
Storyboard Example

Similar to Monogame Introduction (ENG) (20)

PPTX
Silverlight as a Gaming Platform
PDF
Useful Tools for Making Video Games - Irrlicht (2008)
PPTX
Unity3D Programming
PDF
Game development with Cocos2d-x Engine
PDF
School For Games 2015 - Unity Engine Basics
PDF
Deterministic Simulation - What modern online games can learn from the Game B...
PDF
FISL14 - A Multiplatform Architecture for Games
PPTX
XNA And Silverlight
PPTX
Criando jogos para o windows 8
PDF
A 3D printing programming API
PDF
Writing videogames with titanium appcelerator
PPTX
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PPTX
Md2010 jl-wp7-sl-game-dev
PDF
Libtcc and gwan
PDF
Libtcc and gwan
PPTX
Static analysis of C++ source code
PPTX
Static analysis of C++ source code
PDF
Implementing a Simple Game using libGDX
PPT
Pygame : créer des jeux interactifs en Python.
PPTX
Game development with Cocos2d
Silverlight as a Gaming Platform
Useful Tools for Making Video Games - Irrlicht (2008)
Unity3D Programming
Game development with Cocos2d-x Engine
School For Games 2015 - Unity Engine Basics
Deterministic Simulation - What modern online games can learn from the Game B...
FISL14 - A Multiplatform Architecture for Games
XNA And Silverlight
Criando jogos para o windows 8
A 3D printing programming API
Writing videogames with titanium appcelerator
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
Md2010 jl-wp7-sl-game-dev
Libtcc and gwan
Libtcc and gwan
Static analysis of C++ source code
Static analysis of C++ source code
Implementing a Simple Game using libGDX
Pygame : créer des jeux interactifs en Python.
Game development with Cocos2d
Ad

Recently uploaded (20)

PDF
AI in Product Development-omnex systems
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
medical staffing services at VALiNTRY
PPTX
history of c programming in notes for students .pptx
PDF
System and Network Administraation Chapter 3
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
L1 - Introduction to python Backend.pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Transform Your Business with a Software ERP System
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
System and Network Administration Chapter 2
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
AI in Product Development-omnex systems
wealthsignaloriginal-com-DS-text-... (1).pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Navsoft: AI-Powered Business Solutions & Custom Software Development
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
CHAPTER 2 - PM Management and IT Context
Wondershare Filmora 15 Crack With Activation Key [2025
medical staffing services at VALiNTRY
history of c programming in notes for students .pptx
System and Network Administraation Chapter 3
Reimagine Home Health with the Power of Agentic AI​
L1 - Introduction to python Backend.pptx
PTS Company Brochure 2025 (1).pdf.......
Transform Your Business with a Software ERP System
Which alternative to Crystal Reports is best for small or large businesses.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
2025 Textile ERP Trends: SAP, Odoo & Oracle
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
System and Network Administration Chapter 2
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Ad

Monogame Introduction (ENG)