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

1
vote
2answers
551 views

Sprite collision with color?

Is this possible? To elaborate, I am making a PacMan offshoot. Essentially it is a "zoomed in" version of the game, but the board is randomly generated. I have 11 .png files each to be used as a ...
0
votes
2answers
79 views

2d camera shaking back and forth

I'm trying to create a smooth moving 2d camera but the camera is shaking back and forth 1 pixel. Player camera rectangle: public Rectangle recCamPosition(Global global) { return new ...
0
votes
2answers
85 views

XNA My Texture's Transparency is shown Black

I am trying to draw an image on to the screen. My image is drawn correctly but the background color which is transparent is shown black. Why is this so? My code: spriteBatch.Draw(Texture, Position + ...
0
votes
2answers
71 views

How can I determine the number of pixels drawn within a predefined shape on the screen?

In the image above, I want to know how can I calculate the number of pixels of the rendered players' shadows that are inside the elephant outline. An occlusion query is used to count the number of ...
-1
votes
2answers
467 views

C# - How to properly play background songs in XNA

So I'm using the game states (enum) to change my game screens. I have 2 songs for main menu and game playing states, respectively. To play songs, I'm using an old code example I saw at MSDN, like ...
0
votes
1answer
79 views

Camera movement constrained to pixel boundaries

So a friend and me, we are currently making a game in C# using XNA. We are trying to get the camera to move in full pixel motion, but we just don't get it right. This concept is hard to explain, but ...
0
votes
1answer
143 views

How i can do colisions with irregular hitboxes [XNA]?

I'm developing my new platform engine and i don't know how to program collisions with slopes - I'm using hitboxes. For the collisions of rectangles i use this: if (player.rec(Position, ...
0
votes
1answer
170 views

Lightning bolt effect with particles is not continuous

I am Drawing a lightning effect animation using this image: Below the result: As you can see the outcome is not a continuous purple color as I wanted it to be, but it has black spaces in ...
0
votes
1answer
122 views

XNA: How to capture precise time of button press?

I'm guessing the default XNA model encourages checking for button presses in Update(). However, I am developing a game-like application for research and need to measure reaction times as quickly as ...
0
votes
1answer
65 views

How to order objects with the same depth in the spritebatch cycle?

I have a tilemap in a isometric 2.5 view and i have also many objects moving and static. The problem is many statics are standing in a "integer" place for obvious reasons and the depths of each object ...
0
votes
1answer
91 views

XNA/Winforms - Nothing being drawn after calling SetRenderTarget(null)

I'm creating a basic scene/level editor using XNA/Winforms using the base classes from http://xbox.create.msdn.com/en-US/education/catalog/sample/winforms_series_1 Everything works fine and gets drawn ...
0
votes
1answer
121 views

Having trouble getting shader to work with sprite batch in XNA #4

I found a neat "CRT screen" effect shader on the web, but I've never used shaders before and I can't seem to get it working properly. If I do the second sprite batch in my code here normally without ...
0
votes
1answer
176 views

Remove item after crafting

I'm having one last problem with my crafting system. Say an item takes 2 rocks, 1 twig, and 1 vine. When I craft the item, only 1 of each item is removed instead of the correct amount of items related ...
0
votes
1answer
115 views

Incomplete mesh using DrawIndexedPrimitives after rotating mesh

Through help on this site I was able to draw the triangles of an unrotated, nonscaled nontransformed mesh created in Blender and exported to OBJ, accurately imported through Assimp and rendered in XNA ...
0
votes
1answer
385 views

How to update “dynamicVertexBuffer” correctly with “setdata” on XNA?

I developed a small 3d games xna and uses a "DynamicVertexBuffer" and "DynamicIndexBuffer" to store and draw my vertices. Everything works fine, but my problem is the "Update" function where I update ...
0
votes
1answer
369 views

How can I disable mipmapping on textures loaded from .X files?

I'm trying to render a plane mesh textured with a simple grid pattern. The problem is that XNA keeps mip-mapping the texture in horrible, horrible ways. What I'm trying to achieve is to get this ...
-1
votes
1answer
51 views

Logic outside of game loop running slower than calculated

I've been trying to figure out what is happening when I run functions from the update loop in XNA that the game freezes for a few seconds until the function is done. When I do performance testing to ...
-1
votes
1answer
160 views

Why are the coordinates interchanged in Monogame?

If I use XNA Gamestudio, I can draw a sprite on a specific position like this: spriteBatch.Draw(Texture2D, new Vector2(PositionX, PositionY), Color.White); But in Monogame, I must change the ...
-1
votes
1answer
1k views

Xna tile map collision

I finally found a tutorial on tile maps and loading them in from a file that I understand (http://circlessuck.blogspot.co.uk/2012/09/xna-tutorial-basic-tile-engine-part-2.html), however the tutorial ...
-1
votes
1answer
209 views

XNA changing color alpha

I know I can take a color and multiply it by a float to reduce its alpha like that: Color color = Color.Green * 0.15f; But how do I return the color's alpha to it's original value? I tried doing ...
-1
votes
1answer
322 views

3d Wall sliding collision

I'm working on collision for walls in my game and the way I currently have it I get stuck walking into a wall. I'm trying to make my character slide on the walls but still collide. My character moves ...
-1
votes
1answer
96 views

Setting texture in effect pass

I created different types of cubes for my cube class and based on the height of the cube, the cube type is different. This means changing the texture for the cube. if (y >= 1) ...
-1
votes
1answer
82 views

A quick question about culling

So I have some vertices that I'm drawing with XNA and the issue I had ages ago was that they weren't appearing when the camera was placed above them. By turning on backface culling this fixed it, but ...
-1
votes
1answer
236 views

Issues with touch buttons in XNA (Release state to be precise)

I am trying to make touch buttons in WP8 with all the states (Pressed, Released, Moved), but the TouchLocationState.Released is not working. Here's my code: Class variables: bool touching = false; ...
-1
votes
1answer
154 views

SpriteBatch memory leak

I have a strange problem with XNA 4. I'm constructing a SpriteBatch using this.spriteBatch = new SpriteBatch( GraphicsDevice );. This leads to a memory leak up to 600 MB memory consumption. This ...
-2
votes
1answer
114 views

How to remove line between two Points XNA 4.0?

I'm new to XNA and wondering if it is possible to remove a line (that lies between two vectors) when the mouse clicks on that line. I've searched everywhere but I can't seem to find anything. My ...
-2
votes
1answer
295 views

Programmatically creating a 3d mesh in XNA

Surprise! Another question related to Minecraft. Anyways: Rather than drawing thousands of blocks each frame, I remember reading somewhere that Minecraft breaks the map into 16x16x256 chunks, and ...
-3
votes
1answer
182 views

How to shoot lasers from Ship(XNA)?

I want a code which allows me to shoot multiple lasers from my Ship. Its a 2D game and the laser TEXTURE2D moves in a straight line. My Solution: I use List<> class of my Laser Class. ...
-4
votes
1answer
214 views

How Do Game Timers Work?

I don't understand the whole game timer things, I know XNA comes with one but im realying on VSync to do the work rather then a game timer. I know what they are It's just can someone show me of a ...