Click here to Skip to main content
15,887,335 members
Everything / XNA

XNA

XNA

Great Reads

by Adam David Hill
All the juicy tricks and scandalous shortcuts which helped us ship our competition game on time
by Tyler Forsythe
IceCream1945 is a demonstration of XNA and the IceCream 2D library in a 2D top-down scrolling shooter similar to 1942 for the NES.
by Adam David Hill
Sensor-controlled XNA tunnel game with VR head-tracking.
by Simon Jackson
Some of the other frameworks which use XNA as a baseline.

Latest Articles

by Patchrick
Learn the basics of game development in C# and MonoGame
by Bruno Sonnino
MonoGame is an open source implementation of the XNA application programming interface (API).
by Geoff Arnold
fter participating in an earlier Intel contest, developer Dave Gannon took on these challenges, coming back with a vengeance with Wormhole Pinball, the winning app in the games category in the Intel App Innovation Contest 2013 in partnership with the Intel® Developer Zone.
by valentasm
Silverlight and XNA animation class with automatic animation and flexible sprites loading.

All Articles

Sort by Updated

XNA 

4 Nov 2012 by Abhinav S
These links might help you get startedhttp://www.jeffblankenburg.com/2010/10/29/31-days-of-windows-phone-day-29-animations/[^]Windows Phone 7 Animations — Alternatives, Performance[^]http://mobile.dzone.com/articles/create-simple-animation-your[^]
16 Jan 2014 by Abhishrek
Hello all,I wanted to look at an (Open Source) Visual Studio project which requires XNA framework 3.1 installed (and referred in project as below). So I went to MS website and...
3 Dec 2012 by Adam David Hill
Sensor-controlled XNA tunnel game with VR head-tracking.
7 Jan 2013 by Adam David Hill
All the juicy tricks and scandalous shortcuts which helped us ship our competition game on time
20 Apr 2012 by Aescleal
If you want skills that'll translate into the games industry on desktop computers NOW then learn C++ and about DirectX on windows. Every games shop I've worked in has been exclusively C or C++, apart from mobile phone games which were J2ME.One problem with C++ is that consoles (apart from...
25 Mar 2014 by afgar
Hello guys,I have one problem, i build one game, and for example, we have one string array:string[] words = {"one word", "seconds word", "third word", "fourth word ..."};i want to select randomly word in this array using Random class, but when i use this method:public string...
25 Mar 2014 by afgar
I would like to randomly generate one string from array, i need only this.... im looking forward that you give me good information
14 Oct 2014 by Afzaal Ahmad Zeeshan
Who would like to join, your indi studio, specially for free? However, please go to a freelancer website, or try to discuss this job in lounge[^] you might be able to get some response. This space is for the Developers seeking help in their programming work.
24 Jul 2011 by Alan Boldock
Many available demonstrations and tutorials demonstrate how to play an animation generated in a 3D application. This tutorial demonstrates how to manipulate a 3D model using only the code to find and manipulate Bones within a simple 3D model generated in Blender.
25 Sep 2013 by alireza ghasemi
Hi dearI try to load a class 16000 times in my servermyclass[] Class = new myclass[4000,4000]but when i load it outOfMemoryException will occur.i programming in c# with XNA library and my operation system is windows server 2012 and my server has 32 gig ram. when that error occur 90% of...
26 Sep 2013 by alireza ghasemi
I'm working on a simulator that models very complex interactions between many objects, and I mean millions.I've used XNA because of the useful things that it lets me do easily, especially with the rendering.My problem is that I'm running into OutOfMemoryExceptions after only a few...
8 Nov 2013 by alireza ghasemi
Hi dearI try to develop a new game in c# with XNA.you know that in game we should check collision between objects in each time. but when we create too many object, collision detection is very harmful for my project because it take too much time.I googled it so i found that i have to use...
10 Nov 2013 by alireza ghasemi
HiI have more than 20000 circles that moving in screen. I use XNA and c# to develop my project.I have to check collision between them. so it take too much time.I want a codes that written in c# to solve this program. in other hand i try to find neighbor list algorithm code in c#.can...
4 Mar 2013 by aloneintherain
Hello Dears, I'm an engineer and I work in CFD simulation.I have some equation. I want to calculate this equations in every micro seconds, This means that XNA every micro seconds must be calculate new position of things for next step & visualization. There are timespan property in XNA but...
3 Mar 2013 by aloneintherain
HiI want a contact detection algorithm to detect collision between 2 ball (2D). I used this algorithm but it doesn't work well, Please Help me.//in Ball Class:public bool Collides(Balls otherSprite){ // Check if two Ball collide if (this.rectangle.X +...
16 Mar 2013 by aloneintherain
Hello Dears;I'm implementing a small software and am having trouble getting the Draw Geometry! How I can do this? I painted that on bellow picture;http://uplod.ir/1dp51elrw9ur/1.png.htm[^]http://www.irfreeup.com/uploads/136344134059711.png[^]Thanks.
25 Dec 2012 by Alviss_H
hi(sorry I'm using English very bad)ExampleI have one model in project xna, I want rotate model from slow to fast and After 20s i want rotate model from fast to slow.To solve I using "GameTime" but I can't :((.Please help me!
16 Nov 2014 by Andreas Gieriet
Given the plane vector [n] at a given point [p], and you have an object model at the absolute origin, and you want to render the object at point [p] aligned with the plane, then you must find the following transformation:T1 = rotate the absolute x-z plane around the absolute y-axis by the...
2 Nov 2014 by Anthony Mushrow
If you're not familiar with the different matrices used in rendering and their purpose then I suggest you do some reading. But generally speaking you should have a Model matrix, a View matrix and a Projection matrix.The Model matrix represents the position of an object in the scene and is...
10 May 2012 by arvin_87
Im trying to create a very simple game, and am working with HLSL. i got this error in my draw method:"The current vertex declaration does not include all the elements required by the current vertex shader. TextureCoordinate0 is missing."and here is my draw method:public void...
20 Apr 2011 by AspDotNetDev
There is not a section of this site dedicated to XNA, though there are articles on XNA and you can ask any XNA questions where you asked this question (in Questions & Answers). You can also give the XNA community forums a try.
24 Dec 2012 by austinbox
I think your code could be simplified a little. I'm guessting that I was the x-axis and J was the y-axisfor (int i = 0; i
26 Dec 2012 by austinbox
Check out these links on rotation...http://stackoverflow.com/questions/8200021/getting-a-proper-rotation-from-a-vector-direction[^]http://stackoverflow.com/questions/10527730/microsoft-xna-texture2d-and-rotation[^]
29 Apr 2013 by bedarob
Hi!I'm using GoblinXNA for my university project and I have a little problem with it. When I set the pivot point in the 3DS Max and export it to FBX, the XNA uses the MAX's origin to the pivot point of the object, but i want the the pivot point in the GoblinXNA to be the pivot point of the...
2 Nov 2014 by BillWoodruff
"in my game,I have drawn maybe 400-500 objects.Will I have to adjust all of them?It will surely take a lot of time."You absolutely will want to find a "general" solution that will take care of scaling your Window (or whatever XNA calls its display), and all the objects in it. I bet that can be...
8 Oct 2011 by BlackJack99
Is there anyway to manipulate images taken by the windows phone camera?Its not editing it like sepia or converting it to black and white, what I would like is adding frames on top of it, or maybe some other funny stuffs like hats or glasses or stuffs like that.I searched for it, but all I...
10 Oct 2011 by BlackJack99
So, anyway, because it seems like there is no answer, here is how i ended up doing it:public partial class MainPage : PhoneApplicationPage { WriteableBitmap wb; PhotoCamera cam; //constructors, other stuffs... protected override void...
25 Aug 2011 by Blind.Geek81
I am following a textbook tutorial for a game called "SquareChase"; my professor wants the class to make our own modifications. I'm using a PNG tileset for the squares' colors. To make troubleshooting easier, I created a separate Square class. I have two errors in the main game code. They are...
6 Sep 2011 by Blind.Geek81
I want the square to shrink or grow after so many clicks, so I created constant variables for the Minimum and Maximum sizes and a boolean to determine whether the square should shrink or grow. If statements make the most sense to me; I can't think of any better methods. Please help!protected...
18 Oct 2011 by Blind.Geek81
I encapsulated all of my drawing methods into separate classes - one for each color. The color is supposed to change after every level. For example, Level 1 would be red, Lvl. 2 orange, Lvl. 3 amber (gold) and so on.I have no errors in my Game1 class or my Draw_Red, Draw_Orange... classes,...
7 Jan 2013 by Boudi AlSayed
hi, Iam programing a GIF Animator and Icon editor and I have a problem with the speed of the program, I've read some articles that talk about XNA but all of them about gaming and games not about apps, and my application use Graphics a lot even in its shape (Custom shape but with all Aero effects...
10 Dec 2013 by bowlturner
As the others pointed out you are assigning true to your variable instead of comparing it.I also agree that if (bool232)is better than if (bool232 == true)though if you are going to use the == a good practice (sometimes called yoda code) is to always put the constant...
10 Dec 2013 by bowlturner
Well obviously the .TotalSeconds is greater than or equal to 3 at that point. My first check would be to see if TotalSeconds is returning milliseconds a 1000 milliseconds is much greater than 3. Or is the TotalSeconds being initialized correctly?
16 Oct 2014 by Bruno Sonnino
MonoGame is an open source implementation of the XNA application programming interface (API).
12 Jan 2014 by C For Code!!!
HI guys,I know its not a good thing ask here but after searching a lot on Net I had to come here to ask.Apology in advance if you think its not a question to ask here.I want to learn game programming in c++.Please suggest me some go through series of turorials/books/Videos by series...
28 Aug 2012 by C.CoderCreator
this is the post i found on the Internethttp://www.gamedev.net/topic/535726-xna-pixel-based-terrain-deformation/[^]it has the code but i don't know how to load it or use it, but i want to be able to make kind of 2d distructable envierment, like worms open warfare, i was wondering if...
19 Aug 2012 by C.CoderCreator
This is my code public Vector2 theclickedpoint; public Boolean clicked = false; protected override void Update(GameTime gameTime) { // Allows the game to exit if (Keyboard.GetState().IsKeyDown(Keys.Escape)) Exit(); ...
21 Mar 2011 by CDP1802
The good news: it can be done. The bad news: A precise test is computationally expensive and therefore probably too slow to be of any use in real time rendering.First off, it works only on convex objects. Concave objects would have to be broken down into two or more convex objects and then...
21 Mar 2011 by CDP1802
And another good link:http://www.riemers.net/[^]
1 Dec 2011 by CDP1802
You can see XNA as a managed wrapper for DirectX 9. The limitation to DX9 probably comes from having to stay compatible to the XBox. Managed code may be somewhat less performant when compared to pedal-to-the metal C/C++ code, but otherwise everything is at your disposal. I see no reason why it...
29 Mar 2012 by CDP1802
XNA will not help very much if you have a WPF application. There are two problems which are not easy to overcome1) WPF applications are event driven while XNA applications run in a continuous rendering loop. Getting those two worlds together does not work out of the box. You will have to...
22 May 2012 by CDP1802
Its very simple. Some of your models have UV coordinates and some do not. The shader tries to use them and gets into problems when none are loaded. And that's exactly what your error message means.VertexDeclarations determine determine what the data structures in the vertex buffers look like...
15 Oct 2012 by CDP1802
Sorry, but it's not quite clear what you are looking for. My best guess is that you want a visual editor for shaders that gives you a sample of what the result looks like.Wow. I just searched for HLSL editors and only got results for text editors with syntax highlighting or intellisense....
2 Oct 2014 by CDP1802
Sorry for the late answer, but I hope I can still help. I had my own little GUI and 3D engine project going, but said goodbye to Mickeysoft when they abandoned XNA and wanted to have everything the Windows 8 way.There is no general answer to your question. It depends very much on how your UI...
29 Jan 2015 by CDP1802
It will simply not work, at least not yet. XNA is nothing else than a library, based on DirectX. The 'commands' you are looking for most probably don't exist in Xamarin yet, if they ever will. Simply recompiling the libraries will not be enough in this case. It would have to be ported to...
11 Feb 2015 by CDP1802
No, there must not be a way, sorry. Not every possible mode must be available. That actually is determined by your graphics card drivers and monitor drivers. After moving on to Win 8, the old graphics mode was not available anymore and you now get the closest mode fitting to your...
13 Jun 2012 by cheshm69
hi every body!i have four camera in my game project. they positioned in the center of sphere area and they look at their specific area.(each of them look at 1/4 sphere)when i want do something in my game(like: moving ,firing and etc) i want see it's effect in all of camera(example: if i...
20 Apr 2012 by Clifford Nelson
Here is a site for programming games in C# and XNA: http://www.freewebs.com/campelmxna/tutorials.htm[^]. It is not very hard. A group did a simple game program at my school using C# in only a week or so.
16 Aug 2013 by clonze
I followed the JSIL website and github guide, and I think my game is ready to be used in an HTML + javascript file, but I can't figure out why it giving me a loading error:Loading data ... failed.Unhandled exception at file:///C:/Users/Travis/Documents/GitHub/JSIL/bin/minesweepertest.html...
10 Oct 2012 by CPallini
BilliardsRocketCompton EffectBlack Hole
3 Mar 2013 by CPallini
Well, if you want to detect collision between two balls then the condition should be (subject to Sergey's approval :-D). (XC0-XC1)*(XC0-XC1)+(YC0-YC1)*(YC0-YC1)
25 Sep 2013 by CPallini
My abacus says 4000 * 4000 = 16000000, that is you are trying to create 16 millions instances of your class.Even on a 64 bit architecture, the CLR as a per object limit of 2GB, see this Stack Overflow question (it provides a workaround): "OutOfMemoryException on declaration of Large Array"[^].
6 Sep 2014 by CPallini
The algorithm is in my tip: "Random extraction of 5 cards from a deck"[^].
3 Nov 2012 by CR@!G
Hey,First off, i'm new to coding.I'm looking to develop an asteroids game for the windows phone.I would like to get the ship moving via a virtual thumbstick on the left and shooting by a button on the right.Where would I find a tutorial on how to implement this?All I have...
6 Jan 2012 by Dan Colasanti
This is a port of Invasion (originally posted on CodeProject by Mauricio Ritter) to Windows Phone 7 (with some enhancements).
1 Jul 2013 by Dan Colasanti
Advertising Network Options for WP7 XNA Games – Revisited
4 Aug 2011 by Dan Colasanti
Review of WP7 Mango Beta’s Advertising SDK
5 Feb 2014 by Dan Colasanti
This article describes my experience porting Invasion from XNA/WP7 to MonoGame/WP8 and includes Invasion's complete source code.
25 Mar 2013 by Daniel M. Kane
A RenderTarget2D-derived class to blend textures at runtime that internally deals with some common headaches.
7 Jan 2013 by Dave Kreskowiak
It isn't possible to answer this question as we know nothing about what your app does nor how to implemented things, nor exactly what you mean by "poor performance".For an editor, I highly doubt that XNA/DirectX is going to give you any benefit at all. On the surface it sounds as though...
5 Sep 2014 by Dave Kreskowiak
Don't put your Random in the Ball class. Instead, pass it into the constructor. A better method would be to wrap the Random class in an Interface so you can supply various implementations of random number generators, especially useful for testing your application. This is called "dependency...
26 Jun 2011 by DaveAuld
XNA is a effectively a Game engine XNA Wiki[^]WPF is Windows Presentation Foundation WPF Wiki[^]Check out the articles on CodeProject, for example, here is a WPF 3D Primer[^], there are plenty other ones.So, for 3D, WPF certainly is an option :)
23 Dec 2011 by Deepak NW
Hey Vinit,I was using your bounce ball as a template to create a game. The buttons are my issue. I want a toggle state button, kinda like the 'sound button' and 'vibration btn'. do you have any idea how to go about it??Deepak
25 Dec 2011 by Deepak NW
Sorry bout that.Thanks for this solution.:D.Deepak
19 Aug 2013 by Deviant Sapphire
Hello Codeproject,I'm created a Minecraft 2D Clone.I draw every block via the screen size(So I can find the middle of the screen).But when I change the screen to 'FullScreen' it moves the middle point to the left of the screen, is there any way to fix this?Here is my code:/* Screen...
19 Aug 2013 by Deviant Sapphire
After a few hours of Googling I came across the code I should have used, and that is this:/* Set the screen's size(Width and height) to the chunk width and height. */GraphicsManager.PreferredBackBufferWidth =...
15 Mar 2014 by Deviant Sapphire
Hey Codeproject,If I have a polygon that resembles a square with the cooardinates:0: 0, 01: 0, 322: 32, 323: 32, 0How would I fill those cooardinates(The square) with an existing Texture2D, and convert the polygon with the texture to another Texture2D?Here's what I...
15 Mar 2014 by Deviant Sapphire
I've been Googling for a while, and I came across this. I'll be testing this out.private Bitmap ClippedBitmap(Bitmap texture, Point[] pointsArray, out Point position) { int minX = pointsArray.Min(x => x.X); int maxX = pointsArray.Max(x => x.X); int minY =...
8 Jul 2014 by Dimitris K.
This is a long standing bug that involves (as far as I can tell) OpenTk and MonoGame. Probably the best solution, for the time being, is to set the Window.AllowUserResizing property like so:public Game1(){ graphics = new GraphicsDeviceManager(this); Content.RootDirectory =...
31 Dec 2012 by DinoRondelly
This might help,http://www.gavindraper.co.uk/2010/11/25/how-to-loadsave-game-state-in-xna/[^]
25 Nov 2013 by Diya Ayesa
i have xna 3.1 how do i load multiple models in xna 3.1 for rendering either from array or button click or switches anything i just need to load multiple 3d models to renderthis is the linkhttp://xboxforums.create.msdn.com/forums/p/15459/80961.aspx[^]where i get code but this code is...
15 Jul 2011 by DominicZA
Im busy working on a top down shooter in XNA and would like to know which is the best pathing algorithm? I have implemented the A* algorithm but this takes a while to calculate the path. Which algorithm do major game developers use in their games?
22 Mar 2011 by Eduard Keilholz
I found this[^] great beginners guide to 3D development. About finding 3D models, check google, I found this[^] library in no-time!
24 May 2011 by ely_bob
Your going to Need to roll your own... sorry..References: XmlReader[^], XmlWriter[^].Shawn Hargraves[^] has a good number of posts in the IntermediateSerializer[^] portion of his Index
20 Apr 2012 by Espen Harlinn
Have a look at this page:List of game engines[^]Best regardsEspen Harlinn
7 Feb 2013 by F.moghaddampoor
Hello Friends,I am very interested in helping others in coding especially xna these days, but my tip and tricks are continually closing by some members here and this is not good for me. I don't want score or sth like this. and i did a lot of effort on my tip and ticks. i think those who are...
11 Feb 2013 by F.moghaddampoor
Here we get clipboard text to use in an XNA app.
31 May 2011 by fithri
Hi, i have some problem..I want to show images and capture the cursor position according to coordinates / pixel image coordinates not screen,,approximately how??please help me...
21 Mar 2011 by fjdiewornncalwe
For XNA stuff I would go here. You can download sample games to learn from and has a pretty good user community as well.
13 Jul 2014 by Francisco T. Chavez
I've been building a small racing game in C#, and I've hit a bit of a block when it comes to the impulse resolution of the car to car collisions. At the moment, the cars are able to hit and push each-other, but there's no resulting rotation from these collisions. The problem I'm having is...
16 Nov 2013 by Francisco T. Chavez
I ended up using the point of minimum extent along the normal axis, from CarB. It's the possible solution I mentioned in the question. Things are a little bouncy, but I think that has more to do with the constants I'm using. Besides, most people that have tried the game out tend to get a bit of...
1 Dec 2011 by Gabriel Sas
Hello, I had a conversation with a friend about what kind of games can XNA 4.0 support, can a game like counter strike or WOW be made? or an even better requirements game can be made like Call of duty? or just simple games?I've also search on google about this question and i didn't find...
26 Nov 2011 by ge-force
I have been converting the Robot Game Starter Kit to 4.0 and Reach on PC. But for some reason, I can't get the booster flame to show correctly. All of the other effects (lens flare, gun flames, explosions), work great, but only black lines come out of the booster engine when turned on.Here...
26 Nov 2011 by ge-force
Actually I figured this out. The textures were being rendered with the wrong sprite batch arguments, and so it didn't work.This was also an effect of switching to the Reach profile, which does not support everything HighDef does :(.But, I know what's wrong now.P.S. And thanks for...
27 Nov 2011 by ge-force
I am trying to do boundary checking in XNA Game Studio 4.0, but my models keep gliding off screen, instead of appearing on the other side of the screen. Here is where I edit the position:if (Position.X > windowWidth){ Position = new Vector3(0, Position.Y, Position.Z);}else if...
9 Dec 2011 by ge-force
I have a PacMan clone I am making in XNA 4.0 that is tile-based. Everything is drawing in the correct position - except PacMan. It seems as if he is offset by 16 pixels on both x and y, but I don't know why.Here is where I draw him:/// /// Draws PacMan. ///...
11 Dec 2011 by ge-force
Well guys, it's me again.First of all:I got PacMan working. Yay! It is now a (almost) complete game with pellets and powerups...Now to the question.I am upgrading the Racing Game starter kit to XNA 4.0, because I am going to totally redo it. But for some reason, it will not run...
12 Dec 2011 by ge-force
It depends on what you want to do in your game.WPF is better for small games, because you get all the controls that you can put down on your Window without having to custom-make controls.XNA, however, cna do some amazing stuff.Here are a few games by XNA:Robot Game (3rd person 3D...
31 Dec 2011 by ge-force
Hi everyone!First off, I found out the positive negative values problem. Reach did not support the negative values, but I git a sweet graphics card that fixed that.Now, I am making an role playing game in XNA, and I am almost finished (got the world, storyline, bonuses, etc working). But...
3 Jan 2012 by ge-force
Thanks.Yes...
28 Jan 2012 by ge-force
Hi,I assume that you are doing a save operation. If so, make sure you aren't saving a game in something like C:\. There are specific places where you cannot read or write files, and you can not delete them either.If you want to save games, use the SavedGames directory in...
28 Jan 2012 by ge-force
Hi,You would first get the touch location, which is very simple (and you probably already know how to do :-)).Next, create a source rectangle (a rectangle that specifies part of the image), and set it to the touch position, with about the size of a finger (maybe 64x64).Finally, you...
28 Jan 2012 by ge-force
Are you saying you want to change a bush to a tree, or is that a bug that you are trying to fix?If it is the first one, you would have multiple groups of sprites (or tilesets), and have an enum in your class stating which tileset you are currently using.Then, you use DateTime.UtcNow to...
28 Jan 2012 by ge-force
I think I know what it is :P.When you install Visual Studio 2010 Express Edition, it does not automatically install XNA Game Studio 4.0 Refresh and the Windows Phone SDK.You can download and install these from...
28 Jan 2012 by ge-force
Are you meaning that you want the game to "pause*, while the scores are shown? If so, store a boolean (or a game state), stating if the score window is up. Next, in your Update() method, only update the main game, dealer, etc if the score window is not up.I think that is what you...
2 Feb 2012 by ge-force
I was browsing around on App Hub (http://www.create.msdn.com/), and I clicked on a link that tried to automatically sign me into the App Hub. But since I'm 13, it gave me the error that You do not meet the requirement for App Hub. You must be 18 to register.Now, whenever I go to the App Hub,...
2 Feb 2012 by ge-force
You can also go to the App Hub: http://www.create.msdn.com/
16 Oct 2014 by Geoff Arnold
fter participating in an earlier Intel contest, developer Dave Gannon took on these challenges, coming back with a vengeance with Wormhole Pinball, the winning app in the games category in the Intel App Innovation Contest 2013 in partnership with the Intel® Developer Zone.
6 Sep 2014 by George Jonsson
First of all, true randomness does not guarantee that two numbers with the same value never occur in a sequence.For example, throwing a die is considered to be random, but you would not be shocked if you get three sixes in a row, right.That said, the solution to your problem is to store...
15 Jun 2013 by Ghost_x
Hello, I'm trying to draw a terrain using the points given by this function:public static Level GenerateDummyLevel(int width, int height) { Level level = new Level(); bool up = false; for (int i = 0; i