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
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)
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)
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
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
45. future of xna?
• silverlight 5.0
• subset of XNA
• focused on business apps
• windows 8
• leverages directx 11
• likely to attract commercial studios