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
3answers
2k views

Problem loading content in WinForms using XNA

I'm currently having trouble implementing loading content with the content pipeline into my WinForm application. I'm using the "WinForms Series 1: Graphics Device" sample provided by microsoft. By ...
2
votes
2answers
333 views

Can XNA's content pipeline be used to load C# source files?

I am wondering if its possible to use the XNA Content Pipeline to load C# files? I'm working on a game and am currently writing a FSM. I would like to be able to load states from the content ...
2
votes
1answer
384 views

How to create a view looking down the sight of the gun

I am in the midst of creating an FPS game using XNA. I am using the camera class from the First Person camera demo from dhpoware.com, and everything is working great. What I'd like to implement is ...
2
votes
2answers
2k views

What's efficient way to draw a lot of textured cubes in XNA4?

Title says it all. What's efficient way to draw a lot of textured cubes in XNA4?
2
votes
1answer
2k views

Multiplayer XNA without a LIVE account? (PC)

I decided it was time to stick in a bit of multiplayer into my game, but came across my first hurdle when i quickly downloaded an example from the XNA website. It prompted me with a login to live. ...
2
votes
2answers
1k views

When applying Bloom postprocess, error: “XNA…requires TextureFilter to be Point when using texture format Single.”

I have an almost unmodified copy of the bloom sample in my project. I pass it a texture to apply the bloom post process on. The only modification is that, instead of calling BeginDraw() (to set a ...
2
votes
2answers
3k views

Texture2D.GetData fails to return pixel colour data

Because I'm using sprite sheets instead of an individual texture per sprite, I need to pass in a Rectangle when calling Texture2D.GetData() in my collision detection for per-pixel tests. ...
2
votes
1answer
224 views

How can I deploy a Xbox 360 game onto a disc?

I'm making some games for Windows now since about 3 years using the Microsoft XNA Framework and C#. Now I finally came to buy myself a Xbox 360 and now I want to deploy some games I converted to Xbox ...
2
votes
2answers
3k views

Weird behavior with XNA SpriteBatch.Draw origin

I have a texture with 256x256 pixels. Consider this piece of code: protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); ...
2
votes
3answers
320 views

Scaling 3D furniture while keeping the thickness constant

I am creating a program in WindowsForms and Xna that allows users to create a 3D room. By dragging and customizing different .fbx models, they can "build" a room or whatever and then look at it in 3D. ...
2
votes
3answers
2k views

Creating Rectangle-based buttons with OnClick events

As the title implies, I want a Button class with an OnClick event handler. It should fire off connected events when it is clicked. This is as far as I've made it: public class Button { public ...
2
votes
1answer
549 views

How do I modify a Boids algorithm to be player controlled?

Found source code on Boids in C#. http://3carrotsonastick.wordpress.com/2012/11/01/boids-in-c-xna/ How do I go about making the raven class in the above player controlled? If I could control it ...
2
votes
1answer
388 views

Can someone explain this Pulsate code to me

// Pulsate the size of the selected menu entry. double time = gametime.TotalGameTime.TotalSeconds; float pulsate = (float)Math.Sin(time * 6) + 1; scale = new Scale(1 + pulsate * 0.05f,1 + pulsate * ...
2
votes
1answer
3k views

XNA 2D - How can I draw a sprite over another?

I'm working on a simple 2D game that is similar to the classic Invader arcade. What I want to know is: How can I draw a new sprite over the player sprite upon colliding with an enemy/a bullet? Better ...
2
votes
2answers
688 views

How to store “chunks” of tiles or How to make my implementation work

I asked a previous question about the loading and unload of chunk data and people noted that my way of storing chunks is weird and I was wondering how I would go about doing it properly. @Byte56 ...
2
votes
1answer
604 views

Is there a technique to creating a “black hole” background in XNA?

I'm creating application in XNA 4.0 and am trying to create a specialized background. I'm familiar with the creation of a parallax scrolling background but I'd like to create a background image that ...
2
votes
1answer
1k views

Why is a fully transparent pixel still rendered?

I am trying to make a pixel shader that achieves an effect similar to this video http://www.youtube.com/watch?v=f1uZvurrhig&feature=related My basic idea is render the scene to a temp render ...
2
votes
1answer
931 views

Inaccurate 3D model collision using XNA

I am creating a classic game in 3D that deals with asteriods and you have to shoot them and avoid being hit from them. I can generate the asteroids just fine and the ship can shoot bullets just fine. ...
2
votes
1answer
867 views

How to track position on a map vs position on screen with XNA 4.0?

I'm working on my first XNA 2D game (overhead view), and I'm pondering how to manage the difference in position on screen vs. the position of a sprite on a global map. The solution I'm currently ...
2
votes
1answer
1k views

Create shadow for SkinnedEffect model

I've followed a tutorial that uses the XNA 4 SkinnedEffect for my animation on that model . How can i also make a shadow for my SkinnedEffect model ? Thanks !
2
votes
2answers
629 views

Scaling sprites in XNA 4.0/Monogame

So I looked up a tutorial on how to scale sprites in XNA and I think I have it all figured out. The only problem is that I want to use a spriteBatch.Begin() method overload without changing anything ...
2
votes
2answers
846 views

World space and model space the dummies version [closed]

I'm by no means a 3d programmer but have recently taken it upon myself to build a Voxel based game and I'm having a little trouble understanding some of the concepts around matrices (what with my ...
2
votes
1answer
158 views

How to get an affect for balloon bursting in XNA?

I am a noob in XNA. I want to create an effect which shows a balloon bursting? Any pointers would be highly appreciated.
2
votes
2answers
2k 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
151 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
1k 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
2k 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
453 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
3k 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
648 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
566 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
1answer
280 views

XNA 4.0 HLSL - strange depth map

I want to draw my pre-rendered depth map to the scene. I get my depth value in the following way: basically (Pixel Shader) // Depth is stored as distance from camera / far plane distance, 1-d for ...
2
votes
3answers
169 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
831 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
598 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
66 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
127 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
193 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
247 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
408 views

How do I detect when the Xbox home button is pressed XNA?

How do I detect when the big Xbox button in the middle of the gamepad is pressed in XNA?
2
votes
1answer
151 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
1k 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
522 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
368 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
2k 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
332 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
2k views

Creating 2D billiard game with realistic movement [closed]

I'm new to XNA and game programming. I'm creating a 2D billiard game and I want to add balls with realistic movement (like 3D). Is it possible to achieve this without using 3D models? I only want to ...
2
votes
2answers
496 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 ...