XNA is a game framework by Microsoft that allows deployment for Xbox Live Indie Games as well as Windows Phone 7.

learn more… | top users | synonyms

5
votes
2answers
312 views

How can I optimize a parallax effect consisting of multiple transparent layers?

I have a parallax effect in MonoGame consisting of multiple semi-transparent layers of textures. The effect is simple, but rendering multiple transparent layers on top of each other is rather slow. ...
1
vote
3answers
203 views

Lag created when detecting collision

I'm fairly new to gamedev and have encountered a problem with the collision detection system. The collision is essentially worked out like this: for (int x = 0; x < playerprojectiles.Count; x++) ...
2
votes
2answers
226 views

Workaround for Texture2D.GetData

I’m converting a game from XNA to iOS with Monogame. In the code snippet below, smallDeform is a Texture2D on which I call the GetData method. smallDeform = ...
0
votes
1answer
145 views

Why does my game exit immediately if I restart it after calling Exit()?

When launching a game multiple times in a console, the first time this.Exit() on the game class is called, all following games do not properly run. Instead they exit immediately. For example, if I ...
0
votes
3answers
369 views

Encode two integers into colour values and compare them in a HLSL shader

I am writing a 2D point and click adventure game in Monogame, and I'd like to be able to create an image mask for every room which defines which parts of the background a character can walk behind, ...
0
votes
1answer
143 views

Programming and drawing to deal with different screen sizes and resolutions

I started making an XNA game years ago and picked it up recently. I'm looking later to convert it to use Monogame so that it can be deployed on various mobile devices and OS, though I have a sinking ...
0
votes
1answer
85 views

Where is the LocalizedFontProcessor in XNA?

I tried this tutorial to localize my XNA Windows Phone game, but I can't find the LocalizedFontProcessor in the drop-down list. Why is the LocalizedFontProcessor missing in the drop-down list? What is ...
0
votes
1answer
94 views

Finding a way to display objects efficiently

I am making a 2D simple Breakout game, and I would like to know of an efficient way to display all the blocks on the screen. I was thinking of dividing the whole screen into little squares that can be ...
0
votes
1answer
111 views

Why do I get an exception when accessing my sprite members in this fashion?

I'm getting a NullReferenceException error on the line where I do new Vector2(...). I think the problem is with the variables I'm using even though they're working to control the player sprite, so ...
0
votes
0answers
90 views

Create random level platforms on screen

I'm trying to create random level platforms like this: public Level(int platfromsInLevel, Texture2D sprite, int screenWidth) { rnd = new Random(); this.screenWidth = screenWidth; ...
0
votes
3answers
871 views

Basic 2D Enemy AI

This is the basic layout of my game: http://www.youtube.com/watch?v=qcd-CcKWjGU&feature=youtu.be To make him move I just made it so you click left or right to move, just for a test. Anyway, I ...
0
votes
0answers
82 views

XNA - Draw FPS Hands? [duplicate]

I'm creating a FPS game in XNA 4. I'm trying to display two hands and a gun in front of the camera. I already the models Hands: How can I do so the fingers and hands position adapts to the gun ...
3
votes
1answer
242 views

Is multipass rendering possible with SpriteBatch?

I'm trying to implement a bloom effect. This requires three shader passes: a brightness threshold, a horizontal blur, and a vertical blur. It also requires resizes, but these are irrelevant to the ...
0
votes
1answer
203 views

How can I support more than one resolution/language on WP7/8?

I want that my Windows Phone game runs on the following three resolutions: 480x800, 768x1280 and 720x1280. And maybe later on 1920x1080. But in the XAP file information, it's just written ...
1
vote
1answer
60 views

XNA flip SpriteBatch on click

Is there any way to make a SpriteBatch flip when its clicked, something like Android Animation? I know that spriteBatch.Draw() have SpriteEffects, but it literally flip it and I want to flip it like ...
1
vote
1answer
569 views

Drawing sprites to a permanent Texture2d using Monogame / XNA

I'm working with Monogame to do a 2d sprite engine. I've gotten it work pretty well where I can move lots of sprites around the screen with the effects and positions that I want. Last night I tried ...
0
votes
1answer
65 views

Layer depth problem in XNA puzzle game

I am working on puzzle game where tiles are needed to be dragged to their correct place, but at the time of dragging one of the textures goes behind the other texture. How can I bring the texture to ...
0
votes
0answers
44 views

XNA speed up content compile with multiple content projects: what to do when two assets reference the same sader file?

Right now our content is being compiled over the course of 10 minutes. Given that we literary have no content yet, it is a huge timebomb waiting to explode once we start ading it. As we build the game ...
0
votes
1answer
145 views

HLSL postprocessing for day to night (DTN)

I am trying to implement a "day-to-night"-filter (as commonly used in cinema) for a 2D game (XNA) by using a full screen HLSL pixel shader. The aim is to transform any bright and colorful image into a ...
1
vote
0answers
238 views

Monogame is not using GPU? [closed]

I have the following code in Draw loop: for (int i = 0; i < 512; i++) { for (int j = 0; j < 512; j++) { spriteBatch.Draw(Textures.Grass, ...
0
votes
0answers
121 views

Incorrect frustum culling with center/half-size AABB

I'm trying to implement an axis-aligned bounding box with center/half-size instead of min/max. And I have some problems when it comes to create a method to detect if the aabb is visible or not. I try ...
1
vote
1answer
95 views

XNA soundEffect is null in when loaded in main class and called in another class

I have loaded a sound effect file into the main class in xna, but when I try to run it in another class I am given this error {"Object reference not set to an instance of an object."} I am new ...
3
votes
3answers
263 views

Does passing uniform constants from technique into shader cause branches?

I am trying to find a way to organize my evergrowing number of shader techniques/functions (I am coding in sm_3.0). One way is to do this: float4 PS_Crossroads(PS_INPUT input, uniform bool ...
0
votes
1answer
80 views

Map editor undo function - Not actually setting values to tiles

I'm currently attempting to implement an undo/redo function for my map editor for a tile-based 2D platformer game made with XNA. I've found a lot of resources online about this and decided to try to ...
0
votes
0answers
124 views

Overlay partially transparent texture onto another, but not the background

I'm using XNA and C#. I have two shapes (texture2ds), and I want to overlay shape 2 (50% transparent square) over shape 1 (opaque circle), but I want to get Option B, not Option A. I basically want ...
2
votes
1answer
312 views

How can I deal with actor translations and other “noise” in third-party motion capture data?

I'm working on a game, and I've run into a problem with motion capture data. My team is using 3DS Max 2011 and trying to put free motion capture files on our models. The problem we're having is it ...
-2
votes
1answer
91 views

How to do a multishot in xna?

I am trying to simulate a gun in which shoots multiple bullets at the same time(similar to a spread out shot). I am thinking I have to create another bullet array then do the same as I have below but ...
0
votes
0answers
68 views

Loading assets in Monogame [duplicate]

I'm creating a MonoGame application on Visual Studio 2012, yet when trying to load a texture I get the following problem: Could not load Menu/btnPlay asset! I have set content directory: ...
0
votes
1answer
70 views

OcclusionQuery: how to ignore some objects?

I'm trying to make a LensFlare effect when the player watch the sun in my XNA 4.0 Game. To do this, I use OcclusionQuery, here's my code: http://pastebin.com/meAkdwmD I also have some models, a ...
5
votes
6answers
363 views

Increasing efficiency of N-Body gravity simulation

I'm making a space exploration type game, it will have many planets and other objects that will all have realistic gravity. I currently have a system in place that works, but if the number of planets ...
22
votes
7answers
1k views

Multithreading 2D gravity calculations

I'm building a space exploration game and I've currently started working on gravity ( In C# with XNA). The gravity still needs tweaking, but before I can do that, I need to address some performance ...
1
vote
1answer
263 views

Unknown error XNA cannot detect importer for “program.cs”

I am not too sure what I have done to cause this, but even after undoing all my edits, this error still appears Error 1 Cannot autodetect which importer to use for "Program.cs". There are no ...
2
votes
1answer
149 views

XNA calculate normals for linesegment

I am quite new to 3D graphical programming and thus far only understand that normal somehow define the direction in which a vertex faces and therefore the direction in which light is reflected. I have ...
1
vote
0answers
149 views

write to depth buffer while using multiple render targets

Presently my engine is set up to use deferred shading. My pixel shader output struct is as follows: struct GBuffer { float4 Depth : DEPTH0; //depth render target float4 Normal : COLOR0; ...
1
vote
2answers
172 views

Input of mouseclick not always registered in XNA Update method

I have a problem that not all inputs of my mouse events seem to be registered. The update logic is checking a 2 dimensional array of 10x10 . It's logic for a jewel matching game. So when i switch my ...
3
votes
2answers
98 views

Multiple ( V- / I- ) Buffers, is it sane?

Currently I am developing an RTS game using XNA ( / ANX.Framework ). There is one thing bothers me. I am not sure in what way or how to organise Buffers. Should I use a new Vertexbuffer for any object ...
1
vote
2answers
683 views

How AlphaBlend Blendstate works in XNA 4 when accumulighting light into a RenderTarget?

I am using a Deferred Rendering engine from Catalin Zima's tutorial: His lighting shader returns the color of the light in the rgb channels and the specular component in the alpha channel. Here is ...
2
votes
0answers
92 views

Game performs poorly when sideloaded [closed]

My game runs smooth when I deploy it to my windows phone directly from Visual Studio 2012 in debugging mode. But when I sideload/deploy the same .xap file with the Application Deployment Tool, the ...
3
votes
2answers
270 views

Laser Beam End Points Problems

I am building a game in XNA that features colored laser beams in 3D space. The beams are defined as: Segment start position Segment end position Line width For rendering, I am using 3 quads: ...
1
vote
1answer
531 views

Grid-Based 2D Lighting Problems

I am aware this question has been asked before, but unfortunately I am new to the language, so the complicated explanations I've found do not help me in the least. I need a lighting engine for my ...
1
vote
1answer
116 views

ContentManager in XNA cant find any XML

Im making a game in XNA 4 and this is the first time I'm using the Content loader to initialize a simple class with a XML file, but no matter how many guide I follow, or how simple or complicated is ...
1
vote
2answers
177 views

Physics for moving blocks

I'm working on a 2D game for windows phone where the player moves blocks around to bounce a laser beams. I need to create some simple physics for moving the blocks. For the moment I have a simple ...
2
votes
1answer
121 views

What's the difference between Textures and VertexTextures in XNA?

The GraphicsDevice class of XNA has the properties Textures and VertexTextures. What is the exact difference? I don't really understand what MSDN tells me about this. I usually use Effect parameters ...
3
votes
1answer
213 views

How to give a ball a following texture trailing effect

How do I draw copies of the leading texture so that there is a line of the leading ball following behind it? (that don't collide) So far I have tried to create the effect by placing another graphic 2 ...
6
votes
2answers
278 views

Improving the efficiency of my bloom/glow shader

I'm making a neon style game where everything is glowing but the glow I have is kinda small and I want to know if there's an efficient way to increase the size of it other than increasing the pixel ...
0
votes
1answer
69 views

Figuring out what object is closer to a certain point?

I'm trying to create fog of war, I have the visual effect created but I'm not sure how to deal with the hiding of other players if they're within the fog of war. So right now the thing I'm trying to ...
0
votes
1answer
93 views

How can I compute a velocity proportional to the difference between two hand positions?

I'm working on a project with the Kinect SDK and XNA 4. I need take the position of the hands and draw a sprite over it. I'm was doing it directly and because of that I get a "trembling hands" effect. ...
0
votes
0answers
198 views

Best way to go about sorting 2D sprites in a “RPG Maker” styled RPG

I am trying to come up with the best way to create overlapping sprites without having any issues. I was thinking of having a SortedDictionary and setting the Entity's key to it's Y position relative ...
9
votes
1answer
298 views

Fast lighting with multiple lights

How can I implement fast lighting with multiple lights? I don't want to restrain the player, he can place an unlimited number and possibly overlapping (point) lights into the level. The problem is ...
1
vote
1answer
118 views

Automatically zoom out the camera to show all players

I am building a game in XNA that takes place in a rectangular arena. The game is multiplayer and each player may go where they like within the arena. The camera is a perspective camera that looks ...