SlideShare a Scribd company logo
Real life
Johan Lindfors
windows phone for games

•   impressive performance
•   sensors and touch
•   potentially xbox-live
•   ads and trials
kinectimals
harvest
implode
doodle fit
ilomilo
other favorites
xna in 1 minute

•   a comprehensive framework for games
•   integrated management of content
•   games with 2d and ”sprites”
•   games with 3d and ”meshes”
•   shared features for pc, wp, xbox
initialize   update   render
managing content

•   content pipeline
•   import common files
•   leverage compile time
•   optimized binary format
•   extensible
first some 2d

•   x and y (and z)
•   spriteBatch
•   sprites/sprite sheets
•   blending
and then some 3d

• x, y and z
• camera is described with matrices
  • view
  • projection
• world matrix transforms objects relatively
  • movement (translation)
  • rotation
  • size (scale)
demo
effects - shaders

• configurable
  •   basic
  •   skinned
  •   environmentMap
  •   dualTexture
  •   alphaTest
demo
”hardware scaler”

• 800x480       =    384 000 pixels
• 600x360       =    216 000 pixels (56%)
• 400x240       =    96 000 pixels (25%)

 graphics.PreferredBackBufferHeight = 800;
 graphics.PreferredBackBufferWidth = 480;
performance tips

• manage the stack and heap
  • reference types live on the _______!
  • value types live on the _______!
• pass large structures by reference
 Matrix a, b, c;
 c = Matrix.Multiply(a, b); // copies 192 bytes!
 Matrix.Multiply(ref a, ref b, out c);


• don’t foreach or linq (know code cost)
performance tips

• gc is ”simpler” than on pc
  • allocate objects early, reuse
• GC.Collect() can be your friend!
  • after load, while paused
• cpu or gpu based?
  • you can go up to 60 fps (60 hz)
demo
sound and music

•   soundEffect
•   load as content
•   wp handles 64 simultaneously
•   possible to change
    • pitch
    • volume
    • 3d location
orientation
 graphics.SupportedOrientations =
     DisplayOrientation.Portrait |
     DisplayOrientation.LandscapeLeft |
     DisplayOrientation.LandscapeRight;

• default is ”LandscapeLeft”
orientation
 Window.OrientationChanged += (s, e) =>
 {
     switch (Window.CurrentOrientation)
     {
         case DisplayOrientation.Portrait:
             graphics.PreferredBackBufferHeight = 800;
             graphics.PreferredBackBufferWidth = 480;
             break;
         default:
             graphics.PreferredBackBufferHeight = 480;
             graphics.PreferredBackBufferWidth = 800;
             break;
     }
     graphics.ApplyChanges();
 };
accelerometer
    using Microsoft.Devices.Sensors;



•    measures acceleration in X, Y and Z
•    values returned between -1 and +1
•    event based
•    read values in event, store for usage
start accelerometer
 Accelerometer accel;
 private void startAccelerometer() {
     accel = new Accelerometer();

     accel.ReadingChanged += new
         EventHandler
         <AccelerometerReadingEventArgs>
         (accel_ReadingChanged);

     accel.Start();
 }
read the accelerometer
 Vector3 accelReading;
 void accel_ReadingChanged(object sender,
         AccelerometerReadingEventArgs e)
 {
     lock (this)
     {
         accelReading.X = (float)e.X;
         accelReading.Y = (float)e.Y;
         accelReading.Z = (float)e.Z;
     }
 }
touch

• windows phone handles 4 touch points
  • all points have unique id
  • pressed | moved | released

 TouchCollection touches;
 protected override void Update(GameTime gt)
 {
     touches = TouchPanel.GetState();
     ...
 }
gestures

• wp can also handle gestures
  • tap | drag | hold | flick | pinch ...
 TouchPanel.EnabledGestures =
     GestureType.Flick;

 while (TouchPanel.IsGestureAvailable) {
   GestureSample g = TouchPanel.ReadGesture();
   if (g.GestureType == GestureType.Flick)
   { ... }
 }
network

• http, rest, xml, sockets...
 void wc_OpenReadCompleted(object sender,
           OpenReadCompletedEventArgs e) {
   if (e.Error == null)
   {
       mapImage = Texture2D.FromStream(
           graphics.GraphicsDevice,
           e.Result);
   }
 }
xbox live

• avatars and “trials” available for all
• developers with agreements
  •   profile
  •   invites
  •   achievements
  •   leaderboard
  •   gamerServices
• contact: wpgames@microsoft.com
trial mode
 #if DEBUG
     Guide.SimulateTrialMode = true;
 #endif

 bool isTrial = Guide.IsTrialMode;
 ...
 Guide.ShowMarketplace(PlayerIndex.One);

• call to IsTrialMode takes 60 ms, cache!
• be creative in feature set
• trial or free light?
ads

• instead of user paying for app
• not for swedish apps yet*

 using Microsoft.Advertising.Mobile.Xna;
 ...
 AdManager adManager;
 Ad bannerAd;


      *not from Microsoft that is, there are options
marketplace

•   local structure
•   test kit in VS2010
•   updates
•   auto-publish
protect yourself

• ready for obfuscation?

public void d(bp.b A_0)
{
       this.l = A_0;
       this.i = new List<string>();
       this.i.Add(am.a().e("SK_NO"));
       this.i.Add(am.a().e("SK_YES"));
       this.g = bo.a;
       SignedInGamer.SignedIn += new
              EventHandler<SignedInEventArgs>(this.d);
}
news in mango

•   silverlight + xna
•   fast application switching
•   profiling
•   combined api for movement
demo
tripeaks solitaire

• fabrication games
• true 3D
• all code in objective-c
-(BOOL)      animate
{
    if([self animation] == nil)
    {
         [self draw];
         return NO;
    }
    else
    {
         BOOL animationDone = [[self animation] animate];
         [self draw];

        if (animationDone)
        {
            x += [[self animation] currentX];
            y += [[self animation] currentY];
            z += [[self animation] currentZ];
            rotation += [[self animation] currentRotation];
            [animations removeObjectAtIndex:0];
        }
        return animationDone;
    }
}
public bool Animate()
{
    if (this.Animation == null)
    {
         this.Draw();
         return false;
    }
    else
    {
         bool animationDone = this.Animation.Animate();
         this.Draw();

        if (animationDone)
        {
            x += this.Animation.CurrentX;
            y += this.Animation.CurrentY;
            z += this.Animation.CurrentZ;
            rotation += this.Animation.CurrentRotation;
            animations.RemoveAt(0);
        }
        return animationDone;
    }
}
public bool Animate(GraphicsDevice graphics, BasicEffect effect)
{
    if (this.Animation == null)
    {
         this.Draw(graphics, effect);
         return false;
    }
    else
    {
         bool animationDone = this.Animation.Animate();
         this.Draw(graphics, effect);

        if (animationDone)
        {
            x += this.Animation.CurrentX;
            y += this.Animation.CurrentY;
            z += this.Animation.CurrentZ;
            rotation += this.Animation.CurrentRotation;
            animations.RemoveAt(0);
        }
        return animationDone;
    }
}
demo
future of xna?

• silverlight 5.0
  • subset of XNA
  • focused on business apps


• windows 8
  • leverages directx 11
  • likely to attract commercial studios
johan.lindfors@coderox.se
resources

•   create.msdn.com
•   jodegreef.wordpress.com - angry pigs
•   www.xnaresources.com
•   http://msdn.microsoft.com/en-
    us/library/bb417503(XNAGameStudio.41).aspx

• programmeramera.se
• www.coderox.se
Real life XNA

More Related Content

What's hot

Pixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup SalzburgPixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup Salzburgwolframkriesing
 
14multithreaded Graphics
14multithreaded Graphics14multithreaded Graphics
14multithreaded GraphicsAdil Jafri
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
Abdullah Al Shiam
 
Computational Linguistics week 5
Computational Linguistics  week 5Computational Linguistics  week 5
Computational Linguistics week 5
Mark Chang
 
TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用
Mark Chang
 
Scala.io
Scala.ioScala.io
Scala.io
Steve Gury
 
Cg my own programs
Cg my own programsCg my own programs
Cg my own programsAmit Kapoor
 
The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202
Mahmoud Samir Fayed
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
Jussi Pohjolainen
 
Computational Linguistics week 10
 Computational Linguistics week 10 Computational Linguistics week 10
Computational Linguistics week 10
Mark Chang
 
Computer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsComputer Graphics Lab File C Programs
Computer Graphics Lab File C Programs
Kandarp Tiwari
 
Maximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unityMaximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unity
WithTheBest
 
Introduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchIntroduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from Scratch
Ahmed BESBES
 
Computer graphics
Computer graphics   Computer graphics
Computer graphics
Prianka Padmanaban
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignment
ashikul akash
 
HTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web GamesHTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web Games
livedoor
 
The Ring programming language version 1.7 book - Part 57 of 196
The Ring programming language version 1.7 book - Part 57 of 196The Ring programming language version 1.7 book - Part 57 of 196
The Ring programming language version 1.7 book - Part 57 of 196
Mahmoud Samir Fayed
 
Advance java
Advance javaAdvance java
Advance java
Vivek Kumar Sinha
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
Jenchoke Tachagomain
 

What's hot (20)

Pixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup SalzburgPixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup Salzburg
 
14multithreaded Graphics
14multithreaded Graphics14multithreaded Graphics
14multithreaded Graphics
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
 
Computational Linguistics week 5
Computational Linguistics  week 5Computational Linguistics  week 5
Computational Linguistics week 5
 
TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用
 
Scala.io
Scala.ioScala.io
Scala.io
 
Cg my own programs
Cg my own programsCg my own programs
Cg my own programs
 
The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
 
Computational Linguistics week 10
 Computational Linguistics week 10 Computational Linguistics week 10
Computational Linguistics week 10
 
Computer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsComputer Graphics Lab File C Programs
Computer Graphics Lab File C Programs
 
Maximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unityMaximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unity
 
Introduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchIntroduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from Scratch
 
Computer graphics
Computer graphics   Computer graphics
Computer graphics
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignment
 
HTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web GamesHTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web Games
 
The Ring programming language version 1.7 book - Part 57 of 196
The Ring programming language version 1.7 book - Part 57 of 196The Ring programming language version 1.7 book - Part 57 of 196
The Ring programming language version 1.7 book - Part 57 of 196
 
Advance java
Advance javaAdvance java
Advance java
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
 

Viewers also liked

Windows phone 7
Windows phone 7Windows phone 7
Windows phone 7
Johan Lindfors
 
NCU EMBA Mentorship Program
NCU EMBA Mentorship ProgramNCU EMBA Mentorship Program
NCU EMBA Mentorship Program
guest6234580
 
Tasplan Digital Presentation
Tasplan Digital PresentationTasplan Digital Presentation
Tasplan Digital Presentation
scottywoodhouse
 
Tourism Tasmania Digital Coach Live Sessions - Digital Marketing
Tourism Tasmania Digital Coach Live Sessions - Digital MarketingTourism Tasmania Digital Coach Live Sessions - Digital Marketing
Tourism Tasmania Digital Coach Live Sessions - Digital Marketing
scottywoodhouse
 
2009 NCU EMBA Mentorship Program
2009 NCU EMBA Mentorship Program2009 NCU EMBA Mentorship Program
2009 NCU EMBA Mentorship Program
guest6234580
 
Tvin conference wrap up
Tvin conference wrap upTvin conference wrap up
Tvin conference wrap up
scottywoodhouse
 
Effektiva gränssnitt med WM 6.5
Effektiva gränssnitt med WM 6.5Effektiva gränssnitt med WM 6.5
Effektiva gränssnitt med WM 6.5
Johan Lindfors
 
Social Media For Public Libraries: Basics and Beyond
Social Media For Public Libraries: Basics and BeyondSocial Media For Public Libraries: Basics and Beyond
Social Media For Public Libraries: Basics and Beyond
Elise C. Cole
 
Windows Phone 7.5 (Mango)
Windows Phone 7.5 (Mango)Windows Phone 7.5 (Mango)
Windows Phone 7.5 (Mango)Johan Lindfors
 
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011
scottywoodhouse
 
ADMA Digital Launch
ADMA Digital Launch ADMA Digital Launch
ADMA Digital Launch
scottywoodhouse
 
Jolasaaaa
JolasaaaaJolasaaaa
Jolasaaaa
gemaetxeba
 
Digital marketing - Liberal Party Presentation
Digital marketing - Liberal Party PresentationDigital marketing - Liberal Party Presentation
Digital marketing - Liberal Party Presentation
scottywoodhouse
 
Heritage Tourism Presentation
Heritage Tourism Presentation Heritage Tourism Presentation
Heritage Tourism Presentation
scottywoodhouse
 
MVVM
MVVMMVVM
Metro and Windows Phone 7
Metro and Windows Phone 7Metro and Windows Phone 7
Metro and Windows Phone 7
Johan Lindfors
 
An analysis of Ulrich's HR Model
An analysis of Ulrich's HR ModelAn analysis of Ulrich's HR Model
An analysis of Ulrich's HR Model
puresona24k
 

Viewers also liked (18)

Windows phone 7
Windows phone 7Windows phone 7
Windows phone 7
 
NCU EMBA Mentorship Program
NCU EMBA Mentorship ProgramNCU EMBA Mentorship Program
NCU EMBA Mentorship Program
 
Tasplan Digital Presentation
Tasplan Digital PresentationTasplan Digital Presentation
Tasplan Digital Presentation
 
Tourism Tasmania Digital Coach Live Sessions - Digital Marketing
Tourism Tasmania Digital Coach Live Sessions - Digital MarketingTourism Tasmania Digital Coach Live Sessions - Digital Marketing
Tourism Tasmania Digital Coach Live Sessions - Digital Marketing
 
D4
D4D4
D4
 
2009 NCU EMBA Mentorship Program
2009 NCU EMBA Mentorship Program2009 NCU EMBA Mentorship Program
2009 NCU EMBA Mentorship Program
 
Tvin conference wrap up
Tvin conference wrap upTvin conference wrap up
Tvin conference wrap up
 
Effektiva gränssnitt med WM 6.5
Effektiva gränssnitt med WM 6.5Effektiva gränssnitt med WM 6.5
Effektiva gränssnitt med WM 6.5
 
Social Media For Public Libraries: Basics and Beyond
Social Media For Public Libraries: Basics and BeyondSocial Media For Public Libraries: Basics and Beyond
Social Media For Public Libraries: Basics and Beyond
 
Windows Phone 7.5 (Mango)
Windows Phone 7.5 (Mango)Windows Phone 7.5 (Mango)
Windows Phone 7.5 (Mango)
 
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011
 
ADMA Digital Launch
ADMA Digital Launch ADMA Digital Launch
ADMA Digital Launch
 
Jolasaaaa
JolasaaaaJolasaaaa
Jolasaaaa
 
Digital marketing - Liberal Party Presentation
Digital marketing - Liberal Party PresentationDigital marketing - Liberal Party Presentation
Digital marketing - Liberal Party Presentation
 
Heritage Tourism Presentation
Heritage Tourism Presentation Heritage Tourism Presentation
Heritage Tourism Presentation
 
MVVM
MVVMMVVM
MVVM
 
Metro and Windows Phone 7
Metro and Windows Phone 7Metro and Windows Phone 7
Metro and Windows Phone 7
 
An analysis of Ulrich's HR Model
An analysis of Ulrich's HR ModelAn analysis of Ulrich's HR Model
An analysis of Ulrich's HR Model
 

Similar to Real life XNA

Pointer Events in Canvas
Pointer Events in CanvasPointer Events in Canvas
Pointer Events in Canvasdeanhudson
 
Stupid Canvas Tricks
Stupid Canvas TricksStupid Canvas Tricks
Stupid Canvas Tricks
deanhudson
 
CreateJS
CreateJSCreateJS
CreateJS
Jorge Solis
 
Game Development for Nokia Asha Devices with Java ME #2
Game Development for Nokia Asha Devices with Java ME #2Game Development for Nokia Asha Devices with Java ME #2
Game Development for Nokia Asha Devices with Java ME #2
Marlon Luz
 
Swift for tensorflow
Swift for tensorflowSwift for tensorflow
Swift for tensorflow
규영 허
 
HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?
Ankara JUG
 
SwiftUI Animation - The basic overview
SwiftUI Animation - The basic overviewSwiftUI Animation - The basic overview
SwiftUI Animation - The basic overview
WannitaTolaema
 
玉転がしゲームで学ぶUnity入門
玉転がしゲームで学ぶUnity入門玉転がしゲームで学ぶUnity入門
玉転がしゲームで学ぶUnity入門
nakamura001
 
Intro to computer vision in .net
Intro to computer vision in .netIntro to computer vision in .net
Intro to computer vision in .net
Stephen Lorello
 
Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Marakana Inc.
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
Alex Payne
 
Abc2011 yagi
Abc2011 yagiAbc2011 yagi
Abc2011 yagi
Toshihiro Yagi
 
Processing and Processing.js
Processing and Processing.jsProcessing and Processing.js
Processing and Processing.js
jeresig
 
Computer graphics
Computer graphicsComputer graphics
Computer graphicsamitsarda3
 
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
Sencha
 
Svcc 2013-d3
Svcc 2013-d3Svcc 2013-d3
Svcc 2013-d3
Oswald Campesato
 
SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)
Oswald Campesato
 

Similar to Real life XNA (20)

Pointer Events in Canvas
Pointer Events in CanvasPointer Events in Canvas
Pointer Events in Canvas
 
Stupid Canvas Tricks
Stupid Canvas TricksStupid Canvas Tricks
Stupid Canvas Tricks
 
CreateJS
CreateJSCreateJS
CreateJS
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 
Game Development for Nokia Asha Devices with Java ME #2
Game Development for Nokia Asha Devices with Java ME #2Game Development for Nokia Asha Devices with Java ME #2
Game Development for Nokia Asha Devices with Java ME #2
 
A More Flash Like Web?
A More Flash Like Web?A More Flash Like Web?
A More Flash Like Web?
 
Of class1
Of class1Of class1
Of class1
 
Swift for tensorflow
Swift for tensorflowSwift for tensorflow
Swift for tensorflow
 
HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?
 
SwiftUI Animation - The basic overview
SwiftUI Animation - The basic overviewSwiftUI Animation - The basic overview
SwiftUI Animation - The basic overview
 
玉転がしゲームで学ぶUnity入門
玉転がしゲームで学ぶUnity入門玉転がしゲームで学ぶUnity入門
玉転がしゲームで学ぶUnity入門
 
Intro to computer vision in .net
Intro to computer vision in .netIntro to computer vision in .net
Intro to computer vision in .net
 
Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
 
Abc2011 yagi
Abc2011 yagiAbc2011 yagi
Abc2011 yagi
 
Processing and Processing.js
Processing and Processing.jsProcessing and Processing.js
Processing and Processing.js
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
 
Svcc 2013-d3
Svcc 2013-d3Svcc 2013-d3
Svcc 2013-d3
 
SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)
 

More from Johan Lindfors

Being a game developer with the skills you have
Being a game developer with the skills you haveBeing a game developer with the skills you have
Being a game developer with the skills you have
Johan Lindfors
 
Introduktion till XNA
Introduktion till XNAIntroduktion till XNA
Introduktion till XNA
Johan Lindfors
 
Develop for WP7 IRL
Develop for WP7 IRLDevelop for WP7 IRL
Develop for WP7 IRL
Johan Lindfors
 
Säker utveckling med SDL
Säker utveckling med SDLSäker utveckling med SDL
Säker utveckling med SDLJohan Lindfors
 
Windows Mobile 6.5
Windows Mobile 6.5Windows Mobile 6.5
Windows Mobile 6.5
Johan Lindfors
 
Microsoft Net 4.0
Microsoft Net 4.0Microsoft Net 4.0
Microsoft Net 4.0
Johan Lindfors
 
Windows Azure - Windows In The Cloud
Windows Azure - Windows In The CloudWindows Azure - Windows In The Cloud
Windows Azure - Windows In The Cloud
Johan Lindfors
 
Att hålla presentationer
Att hålla presentationerAtt hålla presentationer
Att hålla presentationer
Johan Lindfors
 

More from Johan Lindfors (8)

Being a game developer with the skills you have
Being a game developer with the skills you haveBeing a game developer with the skills you have
Being a game developer with the skills you have
 
Introduktion till XNA
Introduktion till XNAIntroduktion till XNA
Introduktion till XNA
 
Develop for WP7 IRL
Develop for WP7 IRLDevelop for WP7 IRL
Develop for WP7 IRL
 
Säker utveckling med SDL
Säker utveckling med SDLSäker utveckling med SDL
Säker utveckling med SDL
 
Windows Mobile 6.5
Windows Mobile 6.5Windows Mobile 6.5
Windows Mobile 6.5
 
Microsoft Net 4.0
Microsoft Net 4.0Microsoft Net 4.0
Microsoft Net 4.0
 
Windows Azure - Windows In The Cloud
Windows Azure - Windows In The CloudWindows Azure - Windows In The Cloud
Windows Azure - Windows In The Cloud
 
Att hålla presentationer
Att hålla presentationerAtt hålla presentationer
Att hålla presentationer
 

Recently uploaded

Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 

Recently uploaded (20)

Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 

Real life XNA

  • 1.
  • 3.
  • 4. windows phone for games • impressive performance • sensors and touch • potentially xbox-live • ads and trials
  • 11. xna in 1 minute • a comprehensive framework for games • integrated management of content • games with 2d and ”sprites” • games with 3d and ”meshes” • shared features for pc, wp, xbox
  • 12. initialize update render
  • 13. managing content • content pipeline • import common files • leverage compile time • optimized binary format • extensible
  • 14. first some 2d • x and y (and z) • spriteBatch • sprites/sprite sheets • blending
  • 15. and then some 3d • x, y and z • camera is described with matrices • view • projection • world matrix transforms objects relatively • movement (translation) • rotation • size (scale)
  • 16. demo
  • 17. effects - shaders • configurable • basic • skinned • environmentMap • dualTexture • alphaTest
  • 18. demo
  • 19. ”hardware scaler” • 800x480 = 384 000 pixels • 600x360 = 216 000 pixels (56%) • 400x240 = 96 000 pixels (25%) graphics.PreferredBackBufferHeight = 800; graphics.PreferredBackBufferWidth = 480;
  • 20. performance tips • manage the stack and heap • reference types live on the _______! • value types live on the _______! • pass large structures by reference Matrix a, b, c; c = Matrix.Multiply(a, b); // copies 192 bytes! Matrix.Multiply(ref a, ref b, out c); • don’t foreach or linq (know code cost)
  • 21. performance tips • gc is ”simpler” than on pc • allocate objects early, reuse • GC.Collect() can be your friend! • after load, while paused • cpu or gpu based? • you can go up to 60 fps (60 hz)
  • 22. demo
  • 23. sound and music • soundEffect • load as content • wp handles 64 simultaneously • possible to change • pitch • volume • 3d location
  • 24. orientation graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight; • default is ”LandscapeLeft”
  • 25. orientation Window.OrientationChanged += (s, e) => { switch (Window.CurrentOrientation) { case DisplayOrientation.Portrait: graphics.PreferredBackBufferHeight = 800; graphics.PreferredBackBufferWidth = 480; break; default: graphics.PreferredBackBufferHeight = 480; graphics.PreferredBackBufferWidth = 800; break; } graphics.ApplyChanges(); };
  • 26. accelerometer using Microsoft.Devices.Sensors; • measures acceleration in X, Y and Z • values returned between -1 and +1 • event based • read values in event, store for usage
  • 27. start accelerometer Accelerometer accel; private void startAccelerometer() { accel = new Accelerometer(); accel.ReadingChanged += new EventHandler <AccelerometerReadingEventArgs> (accel_ReadingChanged); accel.Start(); }
  • 28. read the accelerometer Vector3 accelReading; void accel_ReadingChanged(object sender, AccelerometerReadingEventArgs e) { lock (this) { accelReading.X = (float)e.X; accelReading.Y = (float)e.Y; accelReading.Z = (float)e.Z; } }
  • 29. touch • windows phone handles 4 touch points • all points have unique id • pressed | moved | released TouchCollection touches; protected override void Update(GameTime gt) { touches = TouchPanel.GetState(); ... }
  • 30. gestures • wp can also handle gestures • tap | drag | hold | flick | pinch ... TouchPanel.EnabledGestures = GestureType.Flick; while (TouchPanel.IsGestureAvailable) { GestureSample g = TouchPanel.ReadGesture(); if (g.GestureType == GestureType.Flick) { ... } }
  • 31. network • http, rest, xml, sockets... void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) { if (e.Error == null) { mapImage = Texture2D.FromStream( graphics.GraphicsDevice, e.Result); } }
  • 32. xbox live • avatars and “trials” available for all • developers with agreements • profile • invites • achievements • leaderboard • gamerServices • contact: wpgames@microsoft.com
  • 33. trial mode #if DEBUG Guide.SimulateTrialMode = true; #endif bool isTrial = Guide.IsTrialMode; ... Guide.ShowMarketplace(PlayerIndex.One); • call to IsTrialMode takes 60 ms, cache! • be creative in feature set • trial or free light?
  • 34. ads • instead of user paying for app • not for swedish apps yet* using Microsoft.Advertising.Mobile.Xna; ... AdManager adManager; Ad bannerAd; *not from Microsoft that is, there are options
  • 35. marketplace • local structure • test kit in VS2010 • updates • auto-publish
  • 36. protect yourself • ready for obfuscation? public void d(bp.b A_0) { this.l = A_0; this.i = new List<string>(); this.i.Add(am.a().e("SK_NO")); this.i.Add(am.a().e("SK_YES")); this.g = bo.a; SignedInGamer.SignedIn += new EventHandler<SignedInEventArgs>(this.d); }
  • 37.
  • 38. news in mango • silverlight + xna • fast application switching • profiling • combined api for movement
  • 39. demo
  • 40. tripeaks solitaire • fabrication games • true 3D • all code in objective-c
  • 41. -(BOOL) animate { if([self animation] == nil) { [self draw]; return NO; } else { BOOL animationDone = [[self animation] animate]; [self draw]; if (animationDone) { x += [[self animation] currentX]; y += [[self animation] currentY]; z += [[self animation] currentZ]; rotation += [[self animation] currentRotation]; [animations removeObjectAtIndex:0]; } return animationDone; } }
  • 42. public bool Animate() { if (this.Animation == null) { this.Draw(); return false; } else { bool animationDone = this.Animation.Animate(); this.Draw(); if (animationDone) { x += this.Animation.CurrentX; y += this.Animation.CurrentY; z += this.Animation.CurrentZ; rotation += this.Animation.CurrentRotation; animations.RemoveAt(0); } return animationDone; } }
  • 43. public bool Animate(GraphicsDevice graphics, BasicEffect effect) { if (this.Animation == null) { this.Draw(graphics, effect); return false; } else { bool animationDone = this.Animation.Animate(); this.Draw(graphics, effect); if (animationDone) { x += this.Animation.CurrentX; y += this.Animation.CurrentY; z += this.Animation.CurrentZ; rotation += this.Animation.CurrentRotation; animations.RemoveAt(0); } return animationDone; } }
  • 44. demo
  • 45. future of xna? • silverlight 5.0 • subset of XNA • focused on business apps • windows 8 • leverages directx 11 • likely to attract commercial studios
  • 47. resources • create.msdn.com • jodegreef.wordpress.com - angry pigs • www.xnaresources.com • http://msdn.microsoft.com/en- us/library/bb417503(XNAGameStudio.41).aspx • programmeramera.se • www.coderox.se