Designed for lightweight game developmentIndependent developersGreat educational toolPrize for first person to tell me what it stands for.SupportsPCWindows 8 app storeWindows Phones storesXbox 360No longer being developed
Libraries are generally easy to follow and use for people new to developmentContent pipeline loads all of your textures and sounds fonts… Don’t have to mess around handling this.Games can be put together quickly Still has enough power to create successful games.Great as a first engine as a lot of people are taught C# as a first language.Free developer liscences and visual studio express.Students can publish their own games
Great amazing successful games created in Xna over the years for variety of platformsSo what do we do now that they have stopped actively developing XNA?Magicka developed by 8 University Students – 200, 000 sales in first 17 daysFezFeatured on Indie Game the Movie, recommendInitially released on Xbox live arcade in 2012Lots of awardsTerraria Very popular steam game has been in top 10 since launchBastionReleased on loads of platformsIlomilo3 dimensional puzzler on Windows platforms
Originally created to port games to other platforms Now the go to technology for continued XNA developmentIs great for multi platform development without huge amounts of code re-use
Skulls of the ShogunTurn based strategy samurai gamePublished by Microsoft Studios and available across Windows platformsArmedturn based strategyflagshipInfinte flightiOS flight simulatorDraw a stickmanUsed monoGasme to release on iOS, Android and Windows 8
Templates are really useful for starting up a quick project, constant between platformsMost common platforms support the majority of XNA so you can transfer your xna skills easilyEasy to port current vanilla XNA games to other platformsLots of sample code available to look through and see how things are done.
Basic loopInit all content loaded variables set Inmitial state of gameRepeatedly call Update DrawAll Cartesian points originate from top left0,0 is at top left of screen and Y increases downwards.
Basic Game, will coverBasic loopLoading a textureSprite PositioningTiny bit of logic.
SCREEN width and HEIGHT SCREEN_WIDTH = _graphics.GraphicsDevice.Viewport.Width; SCREEN_HEIGHT = _graphics.GraphicsDevice.Viewport.Height; 1)ball variables (texture, pos, vel)Content Folder - drag in pngSet variables in initPosition = 200,200Velocity = -4, 0;Draw CodeBegin END!RUN! 6)Update Ball MethodRUN! 8) Ball bounceif (ballPosition.X < 0)ballVelocity.X = 4;RUNS - Awesome, now the other sideif (ballPosition.X > SCREEN_WIDTH)ballVelocity.X =- 4;11)RUN, why does it go off the screen? File -> Add new Prject Windows PoneAdd content folder + image as linkDelete new Game1Add old one NOT AS LINKCHANGE namespace in Game1Set as startup projectSelect Device Init SCREEN_WIDTH = _graphics.GraphicsDevice.Viewport.Width; SCREEN_HEIGHT = _graphics.GraphicsDevice.Viewport.Height; // TODO: Add your initialization logic hereballTexture = Content.Load<Texture2D>("redBall");ballPosition = new Vector2(200, 200);ballVelocity = new Vector2(-4, +4); UpdateBallballPosition += ballVelocity; //Sides if (ballPosition.X < 0)ballVelocity.X = 4; if (ballPosition.X > SCREEN_WIDTH - ballTexture.Width)ballVelocity.X = -4; //TOP and Bottom if (ballPosition.Y < 0)ballVelocity.Y = 4; if (ballPosition.Y > SCREEN_HEIGHT - ballTexture.Height)ballVelocity.Y = -4; Draw_spriteBatch.Begin(); _spriteBatch.Draw(ballTexture, ballPosition, Color.White); _spriteBatch.End();
Xna and mono game
XNA and MonoGameWHATS IT ALL ABOUT?
What is XNA? Released in 2006 Primary platform for Xbox Live Indie Games Windows Phone support Added in 2010 Currently Supports Windows Windows 8 Windows Phone 7+8 Xbox 360 No longer being actively developed :(
Why is it so great? Easy to use Libraries Content Management Quickly develop 2D sprite based games Power to create impressive full games Great as a first engine Doesn’t cost anything to get started! Publish your own games!
What does it offer? Visual Studio Templates Support for majority of XNA Easily port your XNA games Lots of sample code 2D and 3D Networked Shades
The basics All games have a simple basic loop Initialise resources and Load Content Load all textures, sounds ect Repeatedly call: Update Update the scene, move objects, perform calculations Draw Draw everything to the Screen
Creating a Game We are going to create a simple animation in MonoGame This will cover: The basic game loop Loading in a texture Sprite positioning Tiny bit of logic