Click here to Skip to main content
15,867,308 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 Score

XNA 

7 Jan 2013 by Adam David Hill
All the juicy tricks and scandalous shortcuts which helped us ship our competition game on time
8 Aug 2012 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.
3 Dec 2012 by Adam David Hill
Sensor-controlled XNA tunnel game with VR head-tracking.
16 Jan 2013 by Simon Jackson
Some of the other frameworks which use XNA as a baseline.
19 Jul 2013 by Ron Beyer
I don't believe this is possible. dB-SPL depends greatly on the speakers attached to the system. I can have my volume turned all the way up in the control panel, and my speaker volume all the way down, etc. Think the way car audio competitions work, dB is dependent greatly upon the...
7 May 2013 by zoyobar
I will explore and learn XNA for Windows Phone with you.
10 Dec 2013 by Matt T Heffron
Don't you mean:if (bool232 == true)or even better:if (bool232)(A better name for that boolean wouldn't hurt, either.)
16 Oct 2014 by Bruno Sonnino
MonoGame is an open source implementation of the XNA application programming interface (API).
20 Oct 2011 by N_tro_P
You are making a common mistake for random numbers.See the MSDN Documentation on Random[^] Seeding.Random numbers are actually pseudo random and the clock is used by default for its seed (you can provide your own though).To solve, you can make a single random object and have your own...
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. ///...
9 Dec 2011 by LanFanNinja
Well you are setting the origin of your pacman texture to half the textures width and height (the center of the texture) and this would offset your texture position 16 pixels on the x and y if your texture is 32x32 pixels.If my mind is working correctly today I think you will need to add the...
17 Feb 2013 by Sergey Alexandrovich Kryukov
It really depends on your UI library and what you call rendering. In WPF, for example, rendering is already a thread separate from UI thread. I don't think this is a correctly posed question. In all cases, you should separate the game scenario from UI. Then you just have to render the scene in...
3 Apr 2013 by Kenneth Haugland
Im assuming that this is what you want:http://devmag.org.za/2009/04/25/perlin-noise/[^]It was just a quick search away :-)
3 Apr 2013 by Sergey Alexandrovich Kryukov
You can also find some implementations here: http://en.wikipedia.org/wiki/Perlin_noise[^].Even the original code by Ken Perlin can be easily translated to C#.—SA
17 Oct 2013 by Patchrick
Learn the basics of game development in C# and XNA
10 Dec 2013 by Ron Beyer
Ok, you edited the question to make it ever so slightly different, but here is what is going on...if (bool232 == true)When that is true, it will start executing inside the if... next isif (gameTime.TotalGameTime.TotalSeconds >= 3)Here, if the TotalGameTime is over 3...
1 Nov 2014 by OriginalGriff
"can you reply with an example"Assuming your screen is 1000 pixels wide:int x = 700; // BAD!int x = (WidthOfScreen * 700) / 1000; // Better!int xPercent = 70;int x = (widthOfScreen * xPercent) / 100; // Best!
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?
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...
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...
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...
20 Apr 2012 by Espen Harlinn
Have a look at this page:List of game engines[^]Best regardsEspen Harlinn
22 Sep 2012 by Wes Aday
Plenty of resources to look at right here on CP[^]
31 Dec 2012 by DinoRondelly
This might help,http://www.gavindraper.co.uk/2010/11/25/how-to-loadsave-game-state-in-xna/[^]
3 Mar 2013 by Richard MacCutchan
Try using the Rectangle.Intersect Method[^].
31 Mar 2013 by Shahin Khorshidnia
HiTry this:var randomNumber = new Random();/* Loop through the chunk to generate. */ for (int i = 0; i 0) { var r...
31 Mar 2013 by Maciej Los
Try to generate random numbers outside the loop./* Loop through the chunk to generate. */ for (int i = 0; i 0) { int r =...
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.
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 :)
4 Aug 2011 by Dan Colasanti
Review of WP7 Mango Beta’s Advertising SDK
6 Sep 2011 by OriginalGriff
To back up what GParkings said:Don't use equality tests: they will not work except under special conditions: always use greater-than-or-equal and less-than-or-equal instead.Don't use Magic Numbers: Define a constant as:const int resizeDelta = 16;This way, if you want to make it bigger or...
10 Jan 2013 by Pawel Gielmuda
How to set orientation to landscape mode for XNA game in mixed mode (Silverlight & XNA)
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...
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...
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.
25 Oct 2012 by haitrieu749
I want to check the collision of one model with another model.I use collision check function as follows://Built Bouding Sphere private void builtBoudingSphere() { BoundingSphere sphere = new BoundingSphere(Vector3.Zero, 0); foreach (ModelMesh mesh in...
10 Oct 2012 by haitrieu749
Harmonic oscillator(Pendulum).Optical.Or you can create one library such as BEPU physics library :)
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....
5 Nov 2012 by Simon Jackson
XNA to MonoGame and beyond
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[^]
9 Nov 2012 by haitrieu749
Plan to split into smaller pieces to review collision.It can be a solution acceptable. Use BoudingSphere to check that pieces.Example: the airplane, split: head airplane, tail airplane, wing airplane. And check each part for collision.
1 Dec 2012 by Thomas Daniels
Hi,Have a look here:http://www.xnaresources.com/default.asp?page=tutorial:stardefense:2[^]http://rbwhitaker.wikidot.com/2d-tutorials[^]http://www.c-sharpcorner.com/uploadfile/iersoy/particle-animations-using-microsoft-xna-part-ii/[^]
6 Jan 2013 by Simon Jackson
So far in this series I’ve covered: MonoGame – a raw XNA implementation allowing you to create games but you have to code everything yourself UnityXNA – a way to host your existing XNA projects (or new ones) and deploy them using the Unity3D engine, but without utilising the advanced …
7 Feb 2013 by Simon Jackson
Does lightning really strike twice?
16 Apr 2013 by Rddezh
I'm trying to make some games in XNA, but I have the following problem:When I load and show the 3d model on the screen, there is everything ok. You can see it on this picture:Img1But when I add a font to my programfont1 = Content.Load("Fonts/Fon1");and show some...
18 Apr 2013 by Rddezh
I could not find the RenderState property inside GraphicsDevice, but I found this:GraphicsDevice.BlendState = BlendState.Opaque;GraphicsDevice.DepthStencilState = DepthStencilState.Default;on that site:...
22 Apr 2013 by HarkBack
Hi! I found a lot of similar themes. But have not found a solution to the problem for Linux.public Game1 (){ graphics = new GraphicsDeviceManager (this); graphics.PreferredBackBufferHeight = 600; graphics.PreferredBackBufferWidth = 800; Content.RootDirectory = "Content";}Size...
23 May 2013 by zoyobar
Use ResourceManager to manage resources in XNA
24 May 2013 by PaulPrice
Good afternoon all,I am trying to use the XmlContentImporter to populate a data structure as followstarget class objectpublic class UiElement{ public List Elements { get; set; } public Point Position { get; set; }}my source xml is as follows
3 Jul 2013 by zoyobar
Using the CommandScene class to create command scenes in the XNA, WPXNA (12)
19 Jul 2013 by Sergey Alexandrovich Kryukov
You need to understand that dB is relative measure: http://en.wikipedia.org/wiki/Decibel[^].—SA
27 Aug 2013 by zoyobar
Using NPC and NPCManager to create NPC and custom actions in XNA, WPXNA (19)
25 Sep 2013 by Sergey Alexandrovich Kryukov
There is no such thing as miracle. If you don't have enough memory, it's not enough.It is possible to implement an array of objects using the disk file storage. But I strongly suspect you need to review all your architecture. You did not give us a clue why would you need so many instances of a...
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"[^].
8 Nov 2013 by Ron Beyer
Actually what I think you are looking for is Binary Space Partitioning (BSP) trees. They are a tried-and-true method for finding objects that are near other objects, which will cut down on your collision detection code.https://www.google.com/search?q=bsp+tree+collision+detection[^]
8 Nov 2013 by Sergey Alexandrovich Kryukov
Software development is done not by "seeing" "this code", but by writing code, which is performed by using developer's brain.Good luck,—SA
10 Nov 2013 by Mehdi Gholam
Read this : http://stackoverflow.com/questions/2544431/collision-detection-of-huge-number-of-circles[^]
15 Apr 2014 by Simon Jackson
A new breed of samples for MonoGame
20 Aug 2014 by valentasm
Silverlight and XNA animation class with automatic animation and flexible sprites loading.
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...
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...
4 Aug 2015 by Patchrick
Learn the basics of game development in C# and MonoGame
18 Apr 2016 by Ronnie Kong
I know this is very late, but in case anyone reads this, or if you haven't figured it out yet; you should not be handling the timer in your draw routine. You're basically trying to sleep the thread here with your while loop. What would be more appropriate is using the Update() method which...
20 Apr 2009 by Inaki Ayucar
Collision detection in XNA
14 Mar 2011 by Raztor0
Well I solved this on my own after more troubleshooting. The problem was pretty silly (as I assumed). I wasn't positioning the map on the screen for my camera to see >.I solved my problem by adding this line before performing all my texture rendering:mapMatrix =...
15 Mar 2011 by Ognjen2
I'm trying to create a XNA maze game, but at the very beginning, I got a problem. Here's my Update method:if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.Escape)) this.Exit();if...
21 Mar 2011 by CDP1802
And another good link:http://www.riemers.net/[^]
21 Mar 2011 by XNAndroid
HiI'm beginner in game programming and I need some good resources to start(some books or video tutorials and examples). I need the fastest way to learn it(XNA and DirectX games or even something else). So if you can give me something to start with fast I'll be grateful. Yeah and I would like...
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.
25 Mar 2011 by Lasse TM
I need a function that return if a certain point is inside a directx 3d model(.x)...I have tried but i can´t get it to work so i need some help.Something like this:public bool IsInsideModel(Vector3 point, Model model){ //This would of course be nice but i don't think such...
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...
22 Mar 2011 by Ognjen2
I'm trying to build a 3D game from a 2D game. Can you give me some hand about it? Do you know where can I find free .fbx and .x models?
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!
6 Apr 2011 by Olivier Levrey
I think you will have more answers if you ask your question here (in the XNA section): http://forums.create.msdn.com/forums/[^]
6 Apr 2011 by Tomoash
Hi, I try to do some driving simulator with intro menu and driving with colision... but the video is allways in loop and i have to stop it with key... i don´t know how to exit game when i hit exit ;-) and finally i don´t know how to do a collision :-( itś difficult for me do this game to this...
20 Apr 2011 by mauricemcse
I write to inquire about an XNA "corner" on this site. My queries could not locate one. I seek guidance on the development of the graphics environment for games developed in XNA/C#. Much thanks in advance for an informed reply.
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.
23 Apr 2011 by Nish Nishant
As Edman pointed out, you only check one collection, you also need to check the other one.Another possibility is that you have multiple threads that may be accessing the same collection. If so, you need to add some thread-sync in there.
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
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...
13 Sep 2011 by steersteer
Thank you very much for your response. I am thinking of developing a small game. will learn XNA soon.
1 Jul 2013 by Dan Colasanti
Advertising Network Options for WP7 XNA Games – Revisited
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...
25 Aug 2011 by Simon Bang Terkildsen
The documentation is the source that can help you the most SpriteBatch.Draw[^]From the error message I can see that Square.Colors[] is an array of strings, but you're setting the color parameter to a string, but it only accepts Color[^] so you need to convert your string to Color[^]If...
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,...
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...
12 Oct 2011 by Tokisan
Hi everyone,I am a newbie in xna game .My trouble is having a group of sprites and i want to change its state by second, as after 10 seconds one of them will change from a bush to a tree in 5 seconds then change to bush. In next 10 seconds of previous sprite will change.i merely want...
20 Oct 2011 by Tokisan
Hi everyone,I am developing my own game and I have a problem with Random().When game runs, the Random() merely gives me a same number. if (seconds % 5 == 0 && seconds != 0 && animal_appearance == false) { animal_appearance = true; ...
23 Oct 2011 by Tokisan
thx^^.Sr for being late.I have been busy recently. Thx for ur answer.I will try my best.Thx alot. Sincerely.
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...
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...
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...
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...
11 Dec 2011 by LanFanNinja
Congratulation...
11 Dec 2011 by Sergey Alexandrovich Kryukov
What else would you expect of f is negative? The value f is to be raised in the power e. Everyone should know from elementary school algebra, that power operation is not defined on the whole set of real numbers. (It is defined on complex numbers which is not the case.)Consider this (square...
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...