xna

Can we wrap individual 2D games developed in XNA in dll?

We have to develop 5-10 individual 2D game modules using XNA. Is it possible to wrap these individual games as dlls and use it on one console(Exe)? If yes, How we can read the user input(using input devices like Keypad, Mouse, Joystick) from dlls? Need an input from XNA experts. I am new to XNA technology. Thanks in advance. ...

XNA Game, Full Screen Animation / Video Playback

I have an XNA game (its a slot machine). I have some really cool animations my artist made for me that are more or less 1600x1000 and over 50 frames. For all of the animations so far I have been using sprite sheets. (Where all the frames are in one image file and when its rendered it chooses what part of the image to show). The proble...

How to embed flash into XNA on windows mobile

Can I embed flash in XNA? how? Can I get data(flash game result) from the embedded flash? Thanks. http://en.wikipedia.org/wiki/Microsoft_XNA http://www.xnadevelopment.com/tutorials.shtml http://www.code-magazine.com/article.aspx?quickid=0709051&page=7 ...

Choosing an Open Source Hosting Service/License

I am starting a game design project with a group of three other students. We would like to use some open source hosting service for version control, a wiki, etc. I have looked at threads like these (http://stackoverflow.com/questions/10490/best-open-source-project-hosting-site, http://stackoverflow.com/questions/29736/what-open-source-ho...

WPF<->XNA - how to combine these two technologies?

I've read on few places already, that it's possible to combine XNA and WPF. What I personally need is a game/map editor, which would actually be the game itself (would have the engine running in background), because map system writes serialized versions of objects to XML, which are later loaded. My problem is that I want an standard app...

XNA: If classes hold the structure, what holds the instances? XML?

Let's say I have my class Level: public class Level { public Vector2 dogStart; public List<Pickup> pickups; public string backgroundAsset; public Level() { pickups = new List<Pickup>(); } } How do I store/load instances of the Level class? XML files? Do I create class LevelOne, class LevelTwo, etc. and...

XNA game tutorial

I have been coding for a while in C# and want to learn XNA game development, I have googled around but unable to find a good tutorial. Can someone provide link to some tutorial that can teach me from the begining. ...

Structs in C# (type could not be found)

I'm new to C#, so forgive this noobish question. I'm playing with a simple XNA game demo. I have a struct that I want to be available to several classes. It is defined as follows: PhotonType.cs using System; namespace ShipDemo { public struct PhotonType { public Color tint; } } In another file in the same folder/namespace,...

C# XNA: Looking for a function like MathHelper.Clamp

I have a function that will take a range of values, which need to be normalized to the range [-1, 1]. MathHelper.Clamp() just takes values that are outside the range and sets them to be whichever bound it exceeds. Does XNA or C# have anything that does what I'm looking for? (I'm looking through the documentation but can't find it.) This...

Open a web browser in C# XNA?

Under certain conditions, I would like to open a web browser of some sort directly from a C# XNA game. The browser would be pointing to a site I would specify. Is this possible? ...

Checking for .NET dependencies before launching

I have several apps that I work on and like to distribute to friends that require Microsoft Provided .dlls and or frameworks. Specifically, XNA. I'm tired of getting emails back from them saying "It crashed" when in reality, all that's happened is they don't have XNA (or .NET 3.5, or whatever) installed. However, Main can't catch thes...

C#: Cannot assign to foreach iteration variable

I'm trying to condense this by wrapping it in a loop: if (pos.X + pixelRadius < 0) { pos.X = bounds.Width - pixelRadius; } else if (pos.X + pixelRadius > bounds.Width) { pos.X = pixelRadius; } if (pos.Y + pixelRadius < 0) { pos.Y = bounds.Heigh - pixelRadius; } ...

C# XNA: stopping and playing Cue (sound) objects

I am trying to stop a Cue, then play it again. This code is in the Update() loop: Cue torpedoSound = soundBank.GetCue("torpedo"); torpedoSound.Stop(AudioStopOptions.AsAuthored); torpedoSound.Play(); // Invalid Operation Exception However, I always get an InvalidOperationException at the above location. The documentation says that will...

How to import XNA types (and other types) in MS Visio?

Hello people, I'm working on the UML of a game we will do in XNA, but Visio does not provide XNA types (like Vector3 or Model). For the moment, I replace those types by C#::Object but it's not really useful to understand... Is there a way to import XNA types in Visio, or do I have to recreate them manually ? Thanks Altefquatre ...

XNA Collision Detection - Vector2.Reflect - Help Calculating the Normal of a Circle Sprite - C#

I'm having trouble wrapping my mind around how to calculate the normal for a moving circle in a 2d space. I've gotten as far as that I'm suppose to calculate the Normal of the Velocity(Directional Speed) of the object, but that's where my college algebra mind over-heats, any I'm working with to 2d Circles that I have the centerpoint, ra...

Storing vector XNA Animations

I'm working on XNA C# when I came upon this problem where I need to store easily editable animation data such that my game will be able to render and play it. It's something like this: I have a texture flying across the screen from (0,0) to (800,600) pixels. This will last 5s. How do I represent it in data and also write it such t...

C# XNA equivalent of Java's PriorityQueue with Comparator?

I'm implementing Dijkstra's on a board of tiles. I want to store all the tiles in a Priority Queue, sorted by their distance from the starting location. In Java, this would be something like: Queue<Point> pq = new PriorityQueue<Point>(new Comparator() { /* sort by distance from start */ }); What would the equivalent by in C# XNA? C# ha...

XNA - Why does it use Vector2 and not Point?

I'm used to WinForms graphics, but I've been dabbling in XNA, and one thing I've noticed is that the Point object isn't very useful, and doesn't seem to be used very much. For positioning, the various SpriteBatch Draw methods use either a Rectangle or a Vector2. And Vector2 has a lot of useful static and instance methods, whereas Point...

Farseer or Box2D? Top-down shooter physics implementation

Which one of these would fit a top down shooter better? I've heard that Box2D performs faster, but I've also noticed that it lacks wider community support for XNA (it rather seems to be used for flash - for a reason unknown to me). Farseer is however built for XNA, and seems to fit it and perform pretty fine. Farseer's advantage in my ...

How do I define orthographic view in xna?

If I want a orthograpic view of the region (-10,-1),(-2,-1),(-2,-7),(-10,-7) how do I define the view and projection matrices? (I set the world matrix to identity). I tried this but it did not work: worldMatrix = Matrix.Identity; projectionMatrix = Matrix.CreateOrthographicOffCenter(-10,-2,-7,-1,-1.0f,100.0f); viewMatrix = Matrix.Create...