XNA Game Studio 4.0 is a programming environment that allows you to use Visual Studio to create games for Windows Phone, the Xbox 360 console, and Windows-based computers.

learn more… | top users | synonyms (1)

2
votes
2answers
925 views

Using 2D sprites and 3D models together

I have gone through a few posts that talks about changing the GraphicsDevice.BlendState and GraphicsDevice.DepthStencilState (SpriteBatch & Render states). . however even after changing the states ...
2
votes
2answers
125 views

How do I drag my widgets without dragging other widgets?

I have a bunch of drag-able widgets on screen. When I am dragging one of the widgets around, if I drag the mouse over another widget, that widget then gets "snagged" and is also dragged around. ...
2
votes
1answer
609 views

XNA and Draw rotation

From Wikipedia the (image) conversion degrees / radians shows the quadrants so that the increase of radians causes a counter-clockwise rotation but when using the following code the sprite is rotated ...
2
votes
2answers
1k views

XNA 2D - How to switch to a new sprite upon collision and delete itself

Let's say I have a 2D spaceship that shoots at moving rocks. If a bullet intersects one of the rocks' bounding boxes, that rock will animate according to a new spritesheet and remove itself. My ...
2
votes
2answers
396 views

How often to SendData() in my peer-ro-peer XNA game?

Currently I call myLocalNetworkGamer.SendData(myPacketWriter, ...) every Update(). 60 times a second sounds too much. Is there an inbuilt way to only send less often? How often should network ...
2
votes
3answers
2k views

Depth Buffer not working in XNA?

I'm stumped. I have been fighting this for about 2 hours now. Here are the interesting parts of my code: protected override void Update(GameTime gameTime) { // Allows the game to exit if ...
2
votes
3answers
1k views

Rotate 3D Model from a custom position

I have a 3D Model like above in which i want to rotate it from a given location(pointed in red) but I can only rotate it from the middle. How can I rotate it from a custom point. Edit: I ...
2
votes
1answer
419 views

What are the GPU requirements for XNA 4.0?

I tried to build a sample application using XNA, but I got an error saying that Pixel Shader 1.1 was required, so I got a used Radeon X300 GPU that supports Pixel Shader. I tried to build it again, ...
2
votes
2answers
448 views

Why doesn't this ContentLoader project (VS2010 e) recognize Microsoft.Build.dll?

I am working with an XNA content loader sample. In the references for the project (VS 2010 Express) there are: Microsoft.Build Microsoft.Build.Framework //as well as the standard XNA framework and ...
2
votes
3answers
151 views

Should Draw method calculate the element's screen location?

Should Update take care of calculating the drawing position of element or should it be done exlusively in Draw method? If I calculate the drawing position of element in Update and then store it as ...
2
votes
1answer
370 views

Collision avoidance (AI)

Now my 3D model has complete AI behaviours, but my model has no collision avoidance while he is moving towards the player! Because of this, he gets stuck in front of 3D blocks sometimes. I think the ...
2
votes
1answer
247 views

Include a custom font when publishing in Visual Studio XNA

I have a custom font called "Gold Box Games" that I want to use in a game I'm making. I have the font installed on my computer and it works just fine in the program when I run it in test. However, ...
2
votes
1answer
186 views

Issues upscaling pixel art with SampleState.PointClamp

I'm developing a 2D game, and I'm striving to create a nice blocky low-res appearance for the game, yet allow it to be played at variable resolutions. So, I've researched resolution independency and ...
2
votes
1answer
60 views

Saving model image

How can I get a top-down,side view of the model imported into XNA and then save that view as an image, that can be used later in the program? Thank you for your time
2
votes
1answer
118 views

XNA project won't target .NET 4.0

I am trying to reference the System.Threading.Task assembly. If I am not mistaken, it should be part of mscorlib. But no matter what I do, my project always defaults to the .net 2.0 runtime. Even if I ...
2
votes
2answers
144 views

Create a variety a sprites from a single image in XNA?

I want to be able to take a single image and cut them up into a lot of images to make the sprites. How would I do that in XNA since I only know how to load the texture then use it without changing it? ...
2
votes
1answer
176 views

How to implement in-game purchase?

I am currently developing an indie game using XNA/C#. I would like to give players the opportunity to try a free (but somewhat limited) demo version of the game. Nevertheless, the player should be ...
2
votes
1answer
124 views

What size window should i use for making an Xbox 360 game in XNA

I have a basic understanding of XNA 4.0 and i want to create an xbox game. What size window should i use? should i use the 16:9 aspect ratio then put it in full screen?
2
votes
1answer
777 views

How to convert pitch and yaw to x, y, z rotations?

I'm a beginner using XNA to try and make a 3D Asteroids game. Update: I'm having a slightly hard time describing this so I made a little animation to show what I'm talking about: ...
2
votes
2answers
387 views

One-way platform collision

I hate asking questions that are specific to my own code like this, but I've run into a pesky roadblock and could use some help getting around it. I'm coding floating platforms into my game that will ...
2
votes
1answer
301 views

Xna model parts are overlying others

I am trying to import in XNA an .fbx model exported with blender. Here is my drawing code public void Draw() { Matrix[] modelTransforms = new Matrix[Model.Bones.Count]; ...
2
votes
2answers
1k views

XNA Camera 2D confusion

I have followed the tutorial at http://www.david-amador.com/2009/10/xna-camera-2d-with-zoom-and-rotation/ to implement my 2D camera and everything works just fine. However this leaves me confused. ...
2
votes
2answers
1k views

XNA 2D line-of-sight check

I'm working on a top-down shooter in XNA, and I need to implement line-of-sight checking. I've come up with a solution that seems to work, but I get the nagging feeling that it won't be efficient ...
2
votes
1answer
234 views

2D Object 'Targeting' / 'Selecting'

I'm currently working with C# with the XNA framework. I'm trying to create a list of objects that are individually target-able after they are created and set in a list and displayed on a tile map. ...
2
votes
2answers
390 views

Rotating a planet around a ships axis

I have a planet rotating around its own axis (like regular planets, and Pluto) and a spaceship that can fly around in space. The idea is to lock the player (ship) in a deadzone "above" the planet and ...
2
votes
1answer
817 views

Combine 3D objects in XNA 4

Currently I am writing on my thesis for university, the theme I am working on is 3D Visualization of hierarchical structures using cone trees. I want to do is to draw a cone and arrange a number of ...
2
votes
1answer
647 views

How to create projection/view matrix for hole in the monitor effect

Lets say I have my XNA app window that is sized at 640 x 480 pixels. Now lets say I have a cube model with its poly's facing in to make a room. This cube is sized 640 units wide by 480 units high by ...
2
votes
1answer
509 views

Smooth Camera Rotation around 90 degrees

I'm developing a third person 3D platformer in XNA. My problem is when I try to rotate the camera around the player. I would like to rotate (and animate) the camera 90 degrees around the player. So ...
2
votes
2answers
1k views

Alpha in model XNA

OK been googling nonstop for ages... My problem is, i need transparent models in my game. After a lot of annoying fiddling around with my code, i changed the blendstate to alphablend. This allowed ...
2
votes
1answer
332 views

Why are my polygons not opaque?

A newbie to XNA here. This is a followup to my previous question that showed me part of what I was doing wrong but I'm still not getting what I want. I'm setting up a BasicEffect thus: Effect = new ...
2
votes
2answers
299 views

TitleSafeRegion isn't available on XNA 4?

I'm following the book Microsoft XNA Game Studio Creators Guide v2. and there is a snippet in the book that is used to return a Rectangle that represents the safe area you can draw without the fear of ...
2
votes
1answer
86 views

XNA: Non-overlapping shadows

I want to create an effect similar to the following in XNA / MonoGame: There's a background and a semi-transparent shadow consisting of several objects (two circles in this example). However, the ...
2
votes
1answer
65 views

map the section of a procedurally generated surface on a plane

I'll try to be as clearer as I can. I have a surface on a 3D space which is not flat, it has hills and depths. My goal would be intersect it with a plane so that I can map the section of the surface ...
2
votes
1answer
209 views

Resize texture in code

I need to change texture size from for example 800x600 to 80x60. I have two ideas of how to do that, but i have problems with both approaches. 1) changre render target then draw and save resized. the ...
2
votes
1answer
247 views

How to use elapsed game time for timing

I want that my ship shoots beam after every 2 seconds. How do I make that happen? and also I want that after 50 shots I want to give 10 seconds to reload the gun. I know both of my problems can be ...
2
votes
1answer
203 views

XNA matrix order problem

I want a matrix that scales first and then rotates. I tried the code below, but it didn't work. zRotation, yRotation and xRotation are rotations that shouldn't be affected by the origin. allrot should ...
2
votes
1answer
88 views

XNA Scale and Render Targets

I'm working on a top down Strategy/RPG/Tower Defense XNA Game for Windows, and I'm running into an issue while scaling. My display mode is 1680 X 1050, and that is what I'm setting the ...
2
votes
2answers
212 views

Collision detection against large arbitrarily shaped textures

What is the most effecient way to do collision detection on strangely shaped textures in XNA? Here is an example texture: As you can see, it is far from a perfect square. I want the player to ...
2
votes
2answers
267 views

Applying Angular Acceleration in a Basic Physics Model

I'm attempting to use a basic physics system to create an arcade flight model. So far I have managed to get the aircraft moving forward, apply gravity, etc. However, after trying to implement torque I ...
2
votes
1answer
172 views

CPU Usage on the UI thread Warning - XNA WP7.1

When I run the Store Test Kit's profiler against my game, I get a warning that says something along the likes of "Very high CPU usage on the UI thread for operations other than frame drawing." ...
2
votes
3answers
608 views

MonoGame and normal windowed desktop application

I am trying to move all my XNA projects to Monogame. But in project templates I found only XAML and horrible metro application template. Is MonoGame support creating application in good old windowed ...
2
votes
1answer
264 views

Artificial intelligence for targeting 3D flying objects

I'm working on a 3D game in Xna in which there is my jet which I am controlling. I want to add other jets as enemies. For that I need their AI so that I could have them able to target my jet. I've ...
2
votes
2answers
449 views

Organize game classes C# XNA

I've just begun working on my game and I don't know how to organize my game in separate classes, because I need some variables/methods to be available to every class. I have a screen manager class and ...
2
votes
2answers
554 views

How do I tile a specific region of a sprite?

I have a sprite that I use as a sprite sheet, where regions of the image represent various UI elements (window corner, border, background, etc.). I want to use a certain region of that sprite as a ...
2
votes
1answer
872 views

Handling hitboxes

So I have an issue that I'm laughing at myself about, because it really seems like it should be something that I should be able to figure out pretty quickly. I am designing a 2D action platformer; I ...
2
votes
1answer
441 views

XNA: Good way to queue up animations

I'm writing an AnimatedSprite class that has an Animation object (which itself contains a sprite sheet). The AnimatedSprite plays certain animations during key input. My problem is that how do I ...
2
votes
2answers
1k views

Dealing with 2D pixel shaders and SpriteBatches in XNA 4.0 component-object game engine?

I've got a bit of experience with shaders in general, having implemented a couple, very simple, 3D fragment and vertex shaders in OpenGL/WebGL in the past. Currently, I'm working on a 2D game engine ...
2
votes
1answer
257 views

Free physics library?

What are some good recommendations? I have a vertex buffer and indices and I want to be able to detect collision between it and a bounding box or another object.
2
votes
1answer
313 views

XNA extending an existing Content type

We are doing a game in XNA that reacts to music. We need to do some offline processing of the music data and therefore we need a custom type containing the Song and some additional data: // Project ...
2
votes
1answer
2k views

How do I draw thick lines in XNA 4.0?

I can draw some curves using this: GraphicsDevice.DrawUserPrimitives<VertexPositionColor> (PrimitiveType.LineStrip, Points, 0, count); Now I try to set the PointSize to make the ...