XNA is a game framework by Microsoft that allows deployment for Xbox Live Indie Games as well as Windows Phone 7.
3
votes
2answers
48 views
Why would a Bounding Sphere and BoundingBox not intersect (when they should)?
I have a bounding sphere and a bounding box that should be intersecting, however, Intersects(...) is returning false. For example, the following returns false:
new BoundingSphere(new Vector3(500, ...
1
vote
0answers
43 views
Persist or Recreate Ads?
I am developing an XNA game for windows phone 7 & 8.
The game is level based. After finishing each level a screen comes up with a bit of level stats summary. I wish to embed an ad in this screen ...
-1
votes
1answer
43 views
Why is Farseer not working in Windows Phone 7/8?
I created a new Windows Phone Game (4.0) project in Visual Studio Express 2012 and added the Farseer project to the solution explorer. But adding a reference to the Farseer project is not working. I ...
1
vote
1answer
87 views
Making a 2d tile based world/map
I've been trying to develop a very basic 2d tile based game for self experience..
Googled and looked at hundreds upon hundreds of tutorials on 'tile based maps'
Almost every tutorial i see is ...
0
votes
0answers
32 views
C# Client to PHP server authentication [migrated]
My XNA game needs to connect to my website with a WebRequest to a PHP page that checks the database for the user and checks to see if the password is correct.
I already have a login script that will ...
1
vote
1answer
33 views
How to grab textures from a texture atlas to be applied to 3d objects
Fairly basic question, but I'm having trouble on finding information on this sort of thing for beginners. I'm just trying to make cubes with different textures on the sides as a starting point. I have ...
0
votes
0answers
54 views
Something other than Vertex Welding with Texture Atlas?
What options would there be for texture usage in a procedural generated 3D world made of cubes to increase performance? Yes, it's like Minecraft.
I've been doing a texture atlas and rendering faces ...
0
votes
2answers
50 views
XNA Texture2D positioning problem
I'm currently stuck on something that just seems extremely odd. I'm creating a game with kinect, and when the player performs an action I want to place a texture onto the screen where their hand is.
...
0
votes
1answer
49 views
XNA Creating a directional vector from two other vectors
Could somebody please tell me what I'm missing?
I have a scene where the camera is fixed in the sky looking down on a plane. On that plane is a 3D model. I want to move the 3D model in the direction ...
0
votes
1answer
55 views
Getting a 3d mouse position
I've looked at a few tutorials about picking and the method Unproject, so I have an idea of how getting the mouse in 3d space is done. The code I have does display a mouse position, but it is way off ...
1
vote
1answer
45 views
Matrix transforms in XNA
So in my most recent 2D game I draw objects like so.
_spriteBatch.Draw(_sprite, Center(), null, Color.White, _rotation, new Vector2(_sprite.Width / 2, _sprite.Height / 2), _scale, ...
0
votes
1answer
40 views
3D drawing precision problem. XNA
I have a simple scrolling camera positioned 2000 units about the 3D 'floor' that moves forward by 1 unit every frame and looks down on the floor at a point that also moves forward by 1 unit every ...
2
votes
1answer
47 views
How to determine depth of a pixel perfect collision
I am trying to figure out how to determine the depth of a pixel perfect collision in XNA. I want to know the depth in order to be able to use it in my collision response.
At the moment I have the ...
1
vote
2answers
98 views
Why would you use a negative value for Bounding Box?
I have the following code I'm working with in XNA from the book Professional XNA Programming.
It's just pong on a 2d screen plane. We use bounding boxes for collision detection. I'm just having ...
0
votes
2answers
59 views
HLSL Pixel Shader Compile, Flow Control, Instruction Count, XNA Issue
im trying to find help with an issue im having moving from the XNA 3.1 framework to XNA 4.0. The shaders I wrote for my 2D game work fine in XNA 3.1, but wont even compile in 4.0.
At first I got ...
0
votes
0answers
26 views
Error in Pixel-Pixel-Collision [closed]
I have got this pixel-pixel-collision code, but unfortunately, it gives me an error: Index outside range of the array on if (((t1[i] & 0xff000000) > 0) && (t2[i] == 0xffC3C3C3)) inside ...
1
vote
2answers
79 views
Moving models with a matrix
Currently I have a playerWorld matrix which holds the position of my player, just a simple sphere. When I press a key to move the model, it does some crazy thing and flies off the screen really fast, ...
4
votes
1answer
83 views
Per frame: Many draw calls with fewer total vertices vs fewer draw calls with more total vertices?
Is there any chance draw calls like XNA's Graphics.DrawIndexedPrimitives has an extremely low overhead and performance issues are more than likely due to the complexity of the meshes?
If I had a ...
-4
votes
0answers
43 views
Xna (temp. perma) spawn / terra forming [closed]
Im a bit new in XNA 3D working and got a problem by spawn new models in game ...
Im trying to spawn a kind of Wall behind me, while moving in a direction. That wall should just follow me everywhere ...
1
vote
2answers
44 views
Defining lines from a heightmap
To a pixel shader of a 2D game, I'm passing a 1-row heightmap that holds the height in UV coordinates of evenly distributed points throughout the texture I'm drawing, but as for n points there will ...
0
votes
1answer
164 views
What is the status of Monogame now that XNA has been discontinued?
XNA has officially been discontinued, with support no longer being offered by Microsoft. Does this mean that Monogame has died also? I see that the site still says it is based upon XNA 4. What is the ...
-1
votes
1answer
110 views
Loop through arrays to create a map
I have a 2D array called map which holds the coordinates to my level like this:
float[,] map =
{
{1, 0, 1, 0, 1},
{0, 1, 0, 1, 0},
{1, 0, 1, 0, 1},
{0, 1, 0, 1, 0},
{1, 0, 1, ...
2
votes
1answer
68 views
How I support different display resolutions?
I'm developing a 2D windows phone game. The game should look the same on every windows phone device. But I have no idea what to do so that my game looks great on every display resolution. How can I do ...
0
votes
1answer
51 views
Formula throwing a ball to destination [duplicate]
I am throwing a ball using this:
double v, vx, vy, alpha, t2 = 0;
if (Keyboard.GetState().IsKeyDown(Keys.Up))
{
alpha = MathHelper.ToRadians(60f);
v = ...
-1
votes
1answer
134 views
Is this a efficient implementation of a pool?
This is how I realized a pool, to prevent stutters during gameplay.
I load everything I will probably need during runtime upfront, and take each model
I need from the pool during runtime. Now, my ...
0
votes
0answers
86 views
From XNA to Monogame to Unity
I have heard tales that one could port his XNA game to Monogame and from there on to Unity, more or less seamlessly.
The Goog won't answer my question, so is there any dev with some experience here?
1
vote
1answer
50 views
MonoGame WP custom vertex decleration
How do I go about implementing and using a custom vertex deceleration in monogame for windows phone 8. I want to be able to store a position, a colour and a normal?
0
votes
1answer
24 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;
...
0
votes
0answers
53 views
HLSL weird floating point behavior?
I have a small ray tracer, I'm storing values in a 3d texture, when the ray goes through the next cube it checks the value from the 3d texture, then on returning this it generates a colour for that ...
1
vote
2answers
89 views
Third person camera xna
I'm trying to create a third person camera in my XNA game. I'm able to move the model I have and the camera at the same time, although the camera is not "following" the model. The model moves faster ...
5
votes
1answer
103 views
Do I need to rewrite my HLSL shaders when porting from XNA to MonoGame?
I'm looking at porting an XNA project I have to monogame, but I have a fair number of HLSL shaders. It seems that Monogame for PC uses OpenGL as the rendering backend, and I'd rather not have to ...
-4
votes
1answer
84 views
XNA PC vs Monogame Online Multiplayer [closed]
I've got a mostly working PC game in XNA 4, and am looking to make it networked. From the documentation it seems that I can use XNA Networking through GFWL to do LAN sessions, but not online sessions ...
0
votes
0answers
46 views
Drawing one texture with different Color fps issue
I'm trying to change texture color by aplying mask, which is exactly the same texture but with changed color and alpha < 150.
I'm doing smth like this:
spriteBatch.Begin();
spriteBatch.Draw(pic, ...
1
vote
2answers
63 views
SpriteBatch does not draw on graphicDevice
I'm using a control which is using XNA inside.
But when I try to draw something, it doesn't appear.
I already did a lot of tests but can't figure out what's wrong.
Here is the test I set up:
...
0
votes
1answer
84 views
Collision Resolution: Objects “swap” places
I am working on making my own simple collision resolution class so I can learn a bit about how it works, while also improving my entity-component model framework. For those of you unfamiliar with a ...
1
vote
2answers
69 views
XNA Using velocity
Previously when making games I have just been using a Vector2 as the sprites position and altering that for movement, i.e.:
if(right key pressed)
Position.X += movementspeed * gametime...;
...
2
votes
1answer
34 views
How to get max viewable X-Value in Viewport
How can I calculate or get the farthest X-Value of a Viewport during gameplay?
Say a model is moving in from the right-hand side (beyond Viewport) and starting from a certain X-Value it is visible on ...
3
votes
1answer
75 views
How do you get the collision plane when using AABBs? [duplicate]
My collision detection initially seemed to work well enough, but my answer to this question shows that I have went with SAT testing now instead. My goal was to find the plane at which to slide the ...
-1
votes
0answers
44 views
White line flickering on right window border [closed]
Lately during gameplay, a thin white line pops in and out quickly during gameplay on the right border of my screen (Windows Phone 8).
I tried to screenshot it, but it simply comes and goes too fast ...
-1
votes
1answer
124 views
How to change a bool through a key press? [closed]
In my small game engine, I've made a system to detect whether or not the user is using a gamepad or the keyboard; however, the system is not working all too well.
Here's the code:
public void ...
-2
votes
2answers
169 views
Check for Updates [duplicate]
How would you make your game check for updates at the beginning of startup, and if there are any updates, how would you make them install? Thanks in advanced
1
vote
1answer
60 views
Strange rendering in XNA/Monogame
I am trying to render G-Code generated for a 3d-printer as the printed product by reading the file as line segments and the drawing cylinders with the diameter of the filament around the segment. I ...
2
votes
1answer
57 views
Farseer: Shooting a ball in a certain angle?
How can I shoot a ball in a certain angle? When I press the Space key, the ball should be shot in a 45 degree angle. How can I do that?
-1
votes
3answers
116 views
Looking for detailed pathfinding examples
I am currently working on a 2D-TopDown game. Now I was looking for pathfinding algorithms. I read and understood A* and Dijkstra. But there are still some questions I have. So I am looking for ...
2
votes
1answer
79 views
Implementing a wait function in a game script
I have been implementing behavior for enemies in my game and so far I have been doing it sort of like below:
public void update()
{
if (frame > 60 && frame % 30 == 0)
{
...
0
votes
1answer
52 views
XNA GameDefaults Class Settings
Are items such as the GameDifficulty enum, game settings, and other things in the GameDefaults class used for a lot? If so, is there a way to edit them or anything of the sorts?
2
votes
1answer
56 views
How to rotate a cell of sprite sheet?
I can draw an animated sprite sheet without problems.
But when it comes to rotation, the single cell (which gets drawn) rotates around the center of the whole sheet.
How can I get my cell to rotate ...
0
votes
1answer
43 views
XNA 4.0 thick triangle strip to fix aliasing issues upon rotation
My triangle strip based lines are disappearing intermittently when I rotate my camera around the X axis.
I was advised that this is due to aliasing issues and that "At a certain angle when its edge ...
0
votes
1answer
46 views
Rotating sprites
I'm a beginner at making games, i'm currently only working in 2D using XNA.
So far all of my games i've been using the following logic for sprite movement:
if(left key pressed)
sprite_x_position ...
0
votes
1answer
36 views
Trouble using Ray.Intersect method on bounding boxes in a 2D XNA game
I am trying to use a ray and bounding box to determine if a box is between the player and the mouse pointer in 2D space. When I try testing the code, the collision will return true when pointed at ...

