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

0
votes
1answer
94 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 ...
0
votes
1answer
190 views

Obtain rectangle indicating 2D world space camera can see

I have a 2D tile based game in XNA, with a moveable camera that can scroll around and zoom. I'm trying to obtain a rectangle which indicates the area, in world space, that my camera is looking at, so ...
0
votes
1answer
232 views

Why i can not load a simple pixel shader effect (. fx) file in xna?

I just want to load a simple *.fx file into my project to make a (pixel shader) effect. But whenever I try to compile my project, I get the following error in visual studio Error List: Errors ...
1
vote
1answer
118 views

How to load a simple minimap, and hide the background?

I developed a small and simple 3D games minecraft style. I would add a "MiniMap". Until here everything is fine. I had the idea to load the entire map in the background, and then I added the edge of ...
2
votes
1answer
402 views

Xbox Controller Not Connecting in Monogame Project

I have recently been playing around with the support of the wired XBox 360 controller in Windows development. I am developing in C# in Visual Studio 2012. I have created 2 projects. The first ...
1
vote
0answers
129 views

Diamond Isometric Tile Picking C# Xna [duplicate]

I recently converted the display style of a isometric map from staggered to diamond and I can't figure out the tile picking process. I'm well aware of the other existing threads regarding this subject ...
0
votes
1answer
162 views

Stacking items, c# XNA: When item reaches maximum stack, new items added are also maximum stack

haven't used this site before so I'm sorry if I format my post badly. I am trying to build a stackable inventory for my game in c# XNA and the problem I've encountered is when an item in my inventory ...
0
votes
2answers
158 views

XNA C# Making the game scaleable for different resolutions [closed]

I am currently developing a game in C# and XNA, and I want it to look right at all resolutions. How would I get started with doing that?
12
votes
3answers
944 views

Camera for 2.5D Game

I'm hoping someone can explain this to me like I'm 5, because I've been struggling with this for hours and simply cannot understand what I'm doing wrong. I've written a Camera class for my 2.5D game. ...
1
vote
1answer
98 views

XNA - Distribution and Patching

I have a couple of questions. Some of this I've done some research on, and some of it may be lacking, but any help is appreciated. 1) When distributing an XNA game for PC that uses custom fonts ...
0
votes
1answer
131 views

Changing enum in a different class for screen

I'm trying to make a start menu for my game and my code uses Enum's to moniter the screen state. Now i want to change the screenstate declared in the main class, in my Background class Screen screen ...
6
votes
1answer
267 views

What is the most efficient way to blur in a shader?

I'm currently working on screen space reflections. I have perfectly reflective mirror-like surfaces working, and I now need to use a blur to make the reflection on surfaces with a low specular gloss ...
2
votes
2answers
136 views

Filling in a shape from vertices

What I'm trying to do is set a bunch of points to create a shape and then fill everything in within those points. It needs to be done in 3D becasue this is being used as a way to generate a texture ...
0
votes
1answer
64 views

How to rotate two scaled objects

I have two objects. The head and tail of a future "grapple". The head and tail always point in the same direction. However, when I tried using scaled rectangles (that were bigger/smaller than the ...
1
vote
1answer
481 views

Correct rotation with Quaternion

I have some problems with a rotating marble. I've tried it with Matrix.CreateFromYawPitchRoll and Matrix.CreateRotation but there were some problems, I think it's due to the Gimbal lock effect. So, ...
1
vote
0answers
62 views

Spritebatch draw over drawstring [closed]

I'm trying to create a pause screen where I draw a black alpha texture over everything including the text. I've got everything working but for some reason no matter what the draw order is drawstring ...
-1
votes
1answer
1k views

How do I make a health bar that drains when the player takes damage? C#/XNA

I've drawn a Health Bar before and had it drain/refill on a button press using if statements and rectangles. First I loaded the image, then I set a new rectangle to be equal to the image's height and ...
3
votes
1answer
75 views

Finding the monitors orientation in XNA for Windows

Just to be clear this is not for Windows Phone 7. =) I've got some interesting requirements for a project and I'm having trouble trying to find the information I need. I have two monitors. The ...
1
vote
1answer
307 views

XNA - Where should I start playing a song?

I am just wondering where is the best place to start playing the background song for a game. In the loadContent() method, Draw(), or Update() methods or when I initialize it? I am trying to make it ...
2
votes
2answers
119 views

Get GameTime's milliseconds in plain format

I am trying to fire an action every 125ms. To get the current milliseconds, I go this way: double passedMs = GameTime.TotalGameTime.TotalMilliseconds; //this is a double as well currentMs += ...
1
vote
0answers
55 views

Changing the position of a Gravity Controller - Farseer

I'm trying to create mini black holes for my XNA game using farseer physics. Problem is I can not get the gravity source to stick to the Body I've attached it to, as it scrolls across the screen, the ...
0
votes
1answer
107 views

How to clip textures when drawing?

How do i draw a texture2D in a specific area (rectangle) where the texture is bigger than the rectangle, and i dont want to draw outside the rectangle. So that means i want to cut the texture so it ...
0
votes
1answer
303 views

Hardware instancing for voxel engine

i just did the tutorial on Hardware Instancing from this source: http://www.float4x4.net/index.php/2011/07/hardware-instancing-for-pc-in-xna-4-with-textures/. Somewhere between 900.000 and 1.000.000 ...
2
votes
2answers
466 views

Cube worlds, instancing vs mesh generation

For a Minecraft type game, what are the pros and cons of hardware instancing the terrain vs generating a mesh of vertices based on what's visible? The terrain is dynamic so cubes will be ...
1
vote
0answers
163 views

XNA 4 / Monogame 3d tunnel collision

I am trying to collide an aircraft with a FBX tunnel model. I don't know how to create multiple bounding boxes for a tunnel. The tunnel is contains a single mesh. I tried using the triangle picking ...
0
votes
2answers
176 views

Collide with rotation of the object

I'm developing a mirror for lazer beam(Ball sprite). There I'm trying to redirect the laze beam according to the ration degree of the mirror(Rectangle). How can I collide the ball to the correct angle ...
1
vote
1answer
155 views

generating complex maps in xna

I just wonder how does these maps like in this video are made. http://www.youtube.com/watch?v=TM6kcOau5oQ I was looking for some tutorials on the web but no success. All I found was some 2D Vectors ...
0
votes
3answers
1k views

how to add different class items to the same list C# XNA

I am trying to make a modular ship system, where parts can be added or removed to the ship entity. I am using a class I made called ModuleManager and it has a list of ShipModules. this works fine for ...
2
votes
1answer
213 views

how do I make an enemy target an ally unit?

I have 2 different classes, a EnemyFighter class, and a EnemyBomber class. both are planes that I have that can fly around the map.( i also have AllyFighter, and AllyBomber) So far they can follow ...
0
votes
1answer
82 views

XNA Shader has an unwanted tint

I'm working on a shader but it has a weird tint to it and I'm not sure why. Right now it's extremely simple, it just sets a rendertarget, draws to it, passes it as a texture to the shader then oututs ...
2
votes
1answer
176 views

When do you get Mouse.getstate().X or Y as negative?

I am creating a game in which I use a function: int x() { int px = 100; int pxend = 128; int xx = 0; for (int i = 0; i < 6; i++) ...
2
votes
1answer
139 views

Light is not spreading evenly

I am using SunBurn for lights and rendering, when i create sceneobject in code, effect is like this see in this light is in the middle so sceneobject in middle is well lit and as we go to corner ...
1
vote
1answer
152 views

Spritebatch not working in winforms

I'm using the Winforms sample on the app hub and everything is working fine except my spritebatch won't draw anything unless I call Invalidate in the Draw method. I have this in my initialize method: ...
0
votes
0answers
22 views

Invalidate not working (winforms & xna) [duplicate]

I'm using winforms with xna. Everything's working so far except for the drawing because invalidate won't refresh the screen unless repeated. This is the initial code I had: protected ...
0
votes
1answer
52 views

Change emission level of a set of vertices within a mesh

ok so here is the problem I need to solve. I have a known set of vertices that I need to "animate" the emission level of. Currently I have a vertex definition setup and RGB color data for each ...
1
vote
2answers
132 views

XNA Calculate two points of triangle with given Z

I want to calculate the two points of a 3D triangle that have a specified Z coordinate. I guess the way to do this would be to somehow create a plane which is perfectly flat with my given Z coordinate ...
0
votes
0answers
87 views

How to encode float3 into float2 and back again in HLSL?

Good afternoon, I am looking to offload some 3D calculations to the GPU without raising my requirements to DX10. Specifically, I am generating densities in 64x64x64 3D blocks, which fit nicely into ...
0
votes
0answers
59 views

XNA inverted matrix acting strange

First of all, I am trying to calculate the two points of a triangle that have a given z position. I have figured out what I think to be quite a good method. First of all I move the triangle to be ...
0
votes
1answer
151 views

Port a WP7 game to WP8 with Monogame

I have a full working game for WP7, I want to port it to WP8 with Monogame. I have installed Monogame and I have done all tests to see that it is working inside Visual Studio Express 2012 for Windows ...
1
vote
2answers
143 views

Making a quad cover the screen

I'm trying to make a shader and I need a fullscreen quad to do so. I have everything set up and working, but when I render the quad it appears as a small square. This would probably be because I'm ...
1
vote
5answers
355 views

Drawing transparent and opaque 3D objects. How do I preventing z-fighting?

I am using a transparent weighted average algorithm to draw my transparent objects. The transparent object is drawn with the following notable render states (the rest are default XNA values): ...
4
votes
1answer
171 views

GetData() error creating framebuffer [closed]

I'm currently porting a game written in C# with XNA library to Android with Monogame. I have a Texture2D and i'm trying to get an array of uint in this way: Texture2d textureDeform = ...
0
votes
2answers
257 views

Udp VS Tcp connection for a platformer multiplayer

Tcp is connection based so it's really good for chat or login or anything that needs reliability. Udp should be used for lots of small packets like position packets... The problem is that in a game ...
2
votes
1answer
183 views

Calculate Distance Using Lifetime, Speed, and Time Between Ticks

I am trying to draw a line from the player to where he is facing, with the line being the distance his rockets will travel. I have ShipMissile.Speed, which is the number of pixels to move per tick, ...
0
votes
1answer
246 views

MonoGame crash trying to load font from .xnb file

My MonoGame project uses a pre-compiled .xnb file to load a sprite font, and it works fine on Windows XP. The .xnb file is marked as content and copied to the output directory. I've copied the ...
0
votes
1answer
238 views

XNA Zoom in/out on model instead of scaling the model

I'm trying to implement zoom in/out functionality into my game. I can change the cameraDistance value with the Z and X keys. Instead of zooming, it looks like the model is scaled smaller or larger ...
0
votes
1answer
143 views

XNA - how to prevent a sound from looping

So in XNA I have this code: Variables: SoundEffect optionSelected; In the LoadContent() method: optionSelected = Content.Load<SoundEffect>("gameSounds\\selectOption"); In the Update() ...