-1
votes
0answers
75 views

How to fasten the avatar's feet on the ground

I'm developing a Kinect Project using C# and XNA 4.0.Now facing a problem that I couldn't solve. When the player bends to near side , the avatar's feet are leaving the ground and it is moving like ...
0
votes
0answers
43 views

How to block Kinect rotation

I'm developing a Kinect Project using C# and XNA 4.0. Now facing a problem that I couldn't solve. When the player turn around himself, the avatar doesn't turn, but its arms and legs are trying to ...
-4
votes
0answers
30 views

Add button to xna Gamewindow and implement click event for the button [closed]

I'm developing a windows phone xna game.I want to add button to GameWindow as a Pause Button.And I want to implement click event for that.how to do this?.
0
votes
0answers
28 views

graphics.IsFullScreen resetting to false after game constructor and graphics.ApplyChanges()

This is a MonoGame 3.2 Windows (DirectX) Project. I've tried setting graphics.IsFullScreen to true in the game's constructor and in the game's initialize function, both times running ...
0
votes
1answer
79 views

Find world matrix

I'm making my first 3D-game with XNA (MonoGame) and have come to a point where I wish to add a crosshair for the player. To do this I need the on-screen coordinates of the location where my fighter ...
0
votes
1answer
31 views

XNA - Autodeploy .exe of game upon succesfull commit to GIT

I know of ClickOnce which creates an .exe file so a user can play my XNA game. However, I have to manually go through a wizard in order to create this file. I would like for the new .exe to be ...
1
vote
2answers
75 views

Loading and storing content efficiently

So for example I have a class called TypingKeyboard. It allows you to display a string while it's being typed by the computer with sounds. I need one in the menu, for the title. And one for the ...
1
vote
1answer
64 views

How can I determine whether a unit is in range or not?

I'm programming a small game that's going to be somewhat like a tower defence. I was playing around with how I determin whether a unit is in range or not. public void Update(GameTime theGameTime) ...
1
vote
0answers
57 views

Any easier way to add networking to an XNA game? [closed]

I know that the MSDN has an article on this but I'm not developing for Xbox so I'm not sure if I should use NetworkSession or LocalGamer etc etc because I think they are Xbox only. But I haven't tried ...
1
vote
3answers
112 views

Removing something on Collision?

I have my collision detection code working so how would I tell my HealthPickup to disappear when my Player collides with it? I haven't played around with it yet but I think I may have to somehow ...
1
vote
2answers
124 views

Detecting Hitbox Collisions (Rectangle)

So I have some Hitboxes set up on 2 classes, HealthPickup and Player. public static Rectangle Hitbox; public override void Initialize() { Hitbox = new Rectangle(Pos.X, Pos.Y, 32, 32); } That's ...
1
vote
2answers
97 views

How to Calculate Velocity in a 2D space game

I am currently using screenpos.X = (float)(screenpos.X + velocity * Math.Sin(r)); screenpos.Y = (float)(screenpos.Y - velocity * Math.Cos(r)); For my Movement with r being the Rotation in Radians. ...
0
votes
1answer
62 views

XNA 4: RenderTarget2D textures getting transparent on fullscreen

I'm generating a Texture2D object using RenderTarget2D as in the following code public static Texture2D GetTextTexture(string text, Vector2 position, SpriteFont font, Color foreColor, Color ...
0
votes
1answer
55 views

XNA tempory pause

I need to do a temporary pause. If I do a collision with an enemy I want to pause the game for 1.5 seconds. Take a look here to my code: bool tPause; float timer; public ovveride Update(GameTime ...
1
vote
3answers
105 views

Rotation matrix for a 3D vector

I have a direction vector on which I have to apply some rotation to align it to positive z-axis. To use Matrix.CreateRotationX(angle) of XNA, I need the angle for which I'd have to compute cos or tan ...
0
votes
0answers
28 views

Transparency in XNA-4 primitives

I'm using XNA 4 with Visual Studio 2010. I'm trying to create a simple 3D world with walls and doors in which the user to free to roam around. A wall is just a rectangle which is currently being ...
3
votes
1answer
365 views

XNA, how to draw two cubes standing in line parallelly?

I just got a problem with drawing two 3D cubes standing in line. In my code, I made a cube class, and in the game1 class, I built two cubes, A on the right side, B on the left side. I also setup an ...
2
votes
1answer
97 views

SpriteBatch, trying to reduce draw calls

This my main draw call: Matrix Camera_transformation = player_camera_.GetTransformation(); // Background - AlphaBlend spritebatch.Begin(SpriteSortMode.Deferred, ...
3
votes
1answer
109 views

Explanation of matrix transformations

I've been looking for something that can help me understand matrix transformations. I've been to multiple different sites, including Wikipedia and quite a lot of related questions on SE and other ...
0
votes
0answers
146 views

Implementing Exponential Shadow Mapping

I've been following the tutorials (link1) and (link2) to implement Shadow Mapping. However, I'm getting shadowing artifacts which are quite ugly. I've done some research, and found that ESM ...
-2
votes
1answer
90 views

explosion spritesheet is not working [closed]

I want to do a simple explosion on a collision.Here is my code... public explosion(Texture2D newTexture, Vector2 newPosition) { texture = newTexture; position = newPosition; ...
2
votes
0answers
29 views

Xna 4 Model Rotation with inertia not working as expected with variable updates

I am trying to rotate a model with inertia damping with the keyboard. The code works great with a fixed time step but it doesn't behave the same with a variable update frequency. Update method: ...
1
vote
1answer
41 views

Proper Directional light on multiple models

I've been trying to implement a Directional light into an XNA game I'm working on, but for what ever reason, I cannot seem to get the directional light to be a true directional light. Instead, I am ...
2
votes
2answers
137 views

XNA: Non-overlapping shadows

I want to create an effect similar to the following in XNA / MonoGame: There's a background and a semi-transparent shadow consisting of several objects (two circles in this example). However, the ...
1
vote
1answer
110 views

Scale adaption based on distance to object

I have situation illustrated on image above, name displayed over the player. Text is rendered as 3d rectangle and rotated to face camera as billboard. (I am using this article ...
1
vote
1answer
97 views

Dealing with angles in 3D

In 2D everything is easier to understand. I'm not enought experienced to join people who say that 3d is the same: you JUST need to add a dimension - THAT adding a dimension is my problem, bacause I ...
1
vote
2answers
196 views

How can I project a vector on another vector?

I have a generic not normalized Vector3 v1 and I want to calculate its component along another Vector3 v2. I used to normalize the vector I want to be the direction and then multiplying the other ...
0
votes
0answers
71 views

Interactions between camera and procedural terrain

QUESTION REWORKED I need to update every frame camera position along a surface with hills and drops. In this picture you can see a particle of the surface terrain (just one triangle) and a sphere ...
0
votes
0answers
95 views

Smooth circular collisions with edges/collision boxes [C# + XNA]

So, me and a friend are working on our top-down perspective 2D game, and have come to work on perfecting our collisions. In its current state our player sprite is colliding with walls, but is ...
1
vote
2answers
174 views

XNA blurring moving images

Why does XNA blurs the images which moves less than 1px in between two draws? It is quite annoying, because everything looks really blurry. Is there a way to disable it? I have tried to set the ...
0
votes
1answer
165 views

How can I create my own GameTime for timing things in my game?

I have a Game class and a GameComponent class. I want to perform operations inside the GameComponent class which depend on calling gameTime.ElapsedGameTime.TotalSeconds, but I've noticed that that ...
2
votes
1answer
100 views

map the section of a procedurally generated surface on a plane

I'll try to be as clearer as I can. I have a surface on a 3D space which is not flat, it has hills and depths. My goal would be intersect it with a plane so that I can map the section of the surface ...
1
vote
2answers
97 views

margin of error trying to check if a point lays on line

Working with floating point values it is as easy as breathing to run on approximation errors by comparing quantities which should be the same. I want to know if there is a way built in some MSDN (or ...
-1
votes
1answer
79 views

Why doesn't my XNA model render at all? [closed]

I am trying to draw a 3D Model in XNA 4.0, but it doesn't show up. I think I made it correctly, but maybe not. My code follows: Here is the LoadContent and Draw method of my Main class. Spaceship is ...
2
votes
1answer
108 views

How do I check if a surface is sloping?

I'm implementing gravity over a 3D terrain and I'm struggling with how to check if surface "under your feet" is flat or sloping. I read some tutorials but gravity is always considered along a single ...
0
votes
2answers
296 views

Add a “fake” Loading Screen

I'm working on a 2D game for WPF8 using XNA 4.0. Everything goes great, but it's too fast. I was just wondering, what could I do between the end of the game and the score screen, and before the game ...
0
votes
1answer
118 views

Where does XNA 4.0 takes memory from to perform operations?

I found this question which talks around the question I'm interested in. In particular I focused on the line where the guys says that GraphicsDevice object is literally a representation of the ...
1
vote
1answer
306 views

Get screen bounds of 3D object

I'm trying to draw a 2D plane that has minimum dimensions to contain a 3D model (a sphere). How do I calculate the minimum size and position of the rectangle to completely cover a 3D model on screen?
0
votes
1answer
176 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
120 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 ...
-1
votes
1answer
866 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 ...
1
vote
1answer
263 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 ...
0
votes
1answer
260 views

XNA Arcball and moving model - the model is altered instead of the camera

I'm trying to implement an arcball type camera, I've got all controls working very nicely. I can rotate the X/Y axis with my mouse and zoom in and out with the Z/X keys. The problem is, that the ...
0
votes
0answers
461 views

XNA 4.0 - stretch full screen window?

I have an issue with resolution in XNA 4.0. I'm running fullscreen. The game runs standard at 1920x1080, and can be scaled down to 1280x720. The resolutions are both 16:9 (1920/1,5 = 1280, 1080/1,5 ...
0
votes
1answer
222 views

render sprites with a transparent background (XNA)

For my game I want to make a map of the world. Per country I made a file with the border of the country and the rest of background is transparent. This way all my files have the same width and height. ...
0
votes
1answer
154 views

Texture2D can't find my sprite - how to setup the content directory in XNA

So I keep getting told that spr_lives can't be found. I'm working out of a book and using the samples given to me (have not changed the code or folder structure, so it /should/ work) but nothing's ...
6
votes
2answers
288 views

Where to put Entity Death Events in a Component/System Design

Entities in my game are nothing more than a collection of components, tied together with an entityID. I have (near) data-only components, and systems that work on the data. One of these components is ...
0
votes
1answer
127 views

How to control in the vertex shader where pixel ends up in the renderTarget?

What if I have an arbitrary renderTarget, that is smaller than the screen (say it is 1x1 pixel) and I want to make sure in the VertexShaderFunction that all my pixels end up exactly in that 1 pixel ...
1
vote
0answers
104 views

DepthStencilState System.ObjectDisposedException [closed]

I developed a Windows Phone 7 & 8 game and released it already. Having integrated BugSense, I received a handful of errors mainly from specific versions of Windows Phone 8 OS (mainly ...
2
votes
0answers
292 views

XNA 4.0 Pixel Shader 3.0 Exact Texture Lookup/Sample Issue

I am stuck on trying to solve this problem. I originally had some shaders written that worked for XNA 3.1, but after converting to XNA 4.0 they would no longer compile due to instruction counts, flow ...