Tagged Questions

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

2
votes
2answers
152 views

Mandelbrot generation using custom HLSL shader in XNA

So I made a Mandelbrot generator in C# and I'm learning about HLSL and custom shaders in XNA (For a college course). I was hoping to do the mandelbrot calculations on the graphics card to make them ...
3
votes
2answers
94 views

How can I read the color of a specific pixel in XNA?

I want a way to find out if, for example, the pixel at Vector2(2, 5) on the game window is color Color.Red, or some other color or set of coordinates. How can I do this?
0
votes
1answer
51 views

Revert to closest non intersecting position

First, let me start by saying: Please forgive me if this question have already been asked. I've tried to search but didn't find any solution. (It might be due to my lack of terms). I have two ...
2
votes
1answer
83 views

XNA 4.0 - Strange edges with multilight shader

I am generating a light, a depth and a normalmap to calculate the lightning at each pixel with multiple lights. On both rendertargets, i set the preferredMultiSampleCount parameter to 16 samples ...
0
votes
1answer
55 views

Scaling/Rotating triangle

I have a Triangle class and a list of triangles representing my 3D model shape. When I update the position, the rotation or the scale of my model, I also want my triangles list to be updated. I ...
0
votes
1answer
70 views

Why is the player not resting in the center of the camera?

Is it possible to create a combination of the following two cameras described in Andrew Russell's answer? XNA Platformer Sample: Supporting multiple resolutions? I want to implement a scrolling ...
1
vote
1answer
339 views

How can I create a resizeable 2D camera with parallax scrolling?

I want to create a Windows Phone jump-and-run game with parallax scrolling. The character should always be in centered in the viewport. I use the following camera so that the viewport looks on every ...
1
vote
1answer
109 views

Understanding how texCUBE works and writing cubemaps properly into a cube rendertarget

My goal is to create accurate reflections, sampled from a dynamic cubemap, for specific 3d objects (mostly lights) in XNA 4.0. To sample the cubemap I compute the 3d reflection vector in a classic ...
3
votes
1answer
140 views

How should I draw the GUI if I use a 2D camera?

I have a camera in my 2D side scrolling game and I want to implement the GUI. How can I do that? For the moment, I draw everything like this: spriteBatch.Begin(SpriteSortMode.Deferred, ...
2
votes
0answers
391 views

Controlled rotation on 3D object with mouse movement

I've a scene with a cube that I can rotate around yaw, pitch and roll. I do this by click the circles and drag the mouse on x/y-axis. I want similar functionality as the Unity rotation tool in editor ...
0
votes
2answers
135 views

Text contains characters that cannot be resolved by this SpriteFont

I'm trying to draw currency symbols in an Arial Spritefont. According to thissite, the font contains these symbols. I've included the Unicode character region for these symbols in the Content ...
1
vote
1answer
145 views

How to correctly handle multiple movement key presses resulting in double the speed?

I am trying to implement acceleration and drag into my top-down 2D game. The player can move using the WASD keys. Acceleration works fine, but the way I handle the directional velocity causes the ...
2
votes
1answer
185 views

How do I make a sprite appear to sway with the wind?

I'm trying to find a method to simulate the effects of wind on various sprites in a side-view 2D scene. What relatively simple technique could I use for this? What I have in mind is to give these ...
1
vote
1answer
119 views

[ C# ]xna to monogame

I'm thinking of going back to xna and c# because I have used java 2d, slick 2d and some other libraries. I started off with xna and c# but ignored it for java. I'm thinking of going back, but I see ...
1
vote
0answers
50 views

Mouselook stutters [closed]

I'm trying to set up mouselook for a 3d game in XNA. The mouselook itself is working but it seems to be stuttering a lot when I use it. The problem is, I have no way of reliably reproducing this ...
0
votes
1answer
83 views

3D Background for a Verticle Shooter: Making it loop?

I know how to scroll a background using spritebatches + 2D background images, but how would I do it with a 3D model?
1
vote
0answers
52 views

Setting up 3d Collision for Primitive shapes

Im having some trouble understanding how to set up collision detection between my first person camera and my primitive shapes which are made using the vertex buffer. Do i give my camera a boundingBox ...
2
votes
1answer
99 views

Issues with 2D Body/Limb system [closed]

In my game I have programmed Body and Limb classes. The Body is guaranteed to have an origin in the center of its sprite. The Body class has a List of children Limbs, each with their own offset. Every ...
3
votes
1answer
74 views

Why is my cursor not working if I add a scaling matrix?

After moving the camera to any direction, my cursor isn't getting drawn on the correct position. For example: I move my camera to the right, after that I click on the screen, but the cursor isn't ...
1
vote
1answer
172 views

How to rotate vertices of 2D shape using a transform matrix?

I am making a top-down 2D game and am currently working on implementing improved collision using SAT. I programmed a Shape class with a Vector2 center that is its position in world space. On top of ...
2
votes
1answer
140 views

2D physics rotation w/ XNA

I'm creating a simple game with space ships made of blocks that are all the same size. After having looked at this: Calculating the rotational force of a 2D sprite I have created the following code ...
1
vote
1answer
140 views

XNA Diffuse Shader Issue. Edge lighting problem. Image Attached

As you can see in this image the diffuse shading is working correctly in some places but in other places such as the the bottom of the sphere you can see the squares/triangles of the mesh. Any ...
0
votes
0answers
56 views

Animation of a 3D model's parts from code

I'm creating a game in XNA where will be an object called a tower. Its action can be described as two phases: aiming and firing. Here's a model I'm creating in Blender: I want the tower to have 3 ...
1
vote
2answers
157 views

Colors set in Blender not displayed in XNA

I'm trying to create a colored 3D model for my XNA game in Blender. I don't want to use textures - I need only solid colors. Here's the model, as seen in Blender: After exporting to FBX and opening ...
1
vote
1answer
74 views

XNA C# Mario Collide

I'm trying to make Mario so im trying to do the collision part but whenever I do the side collision it bounces back too far. I want to make it so that it only stops Mario not bounces him back. ...
1
vote
1answer
137 views

How can I use a camera matrix with different resolutions?

I created a little jump'n'run game. The character(Mario) is always the center of the viewport. The game is running correctly if I use the resolution 800x480 pixel. But when I use another ...
0
votes
0answers
36 views

XNA 2D Stencil Buffer Rotation

I am currently working on a 2d game related to planets and am trying to get a stencil buffer working with rotation. I currently have a stencil buffer found from another related answer but it refuses ...
1
vote
1answer
207 views

How do you make a bullet ricochet off a vertical wall?

First things first. I am using C# with XNA. My game is top-down and the player can shoot bullets. I've managed to get the bullets to ricochet correctly off horizontal walls. Yet, despite using similar ...
1
vote
0answers
326 views

How can I use custom shaders in Monogame?

I wrote a shader in XNA and I want to use it in a Monogame Windows Phone 8 project. I converted my Effect1.fx file to Effect1.mgfxo. But the program doesn't work correctly. The screen of my emulator ...
0
votes
1answer
90 views

How to retrieve a cube collision by faces

I work for a while on a minecraft game (voxel). I am front a problem for a long time about the collision detection. I want recover the cubes collision from my highlighted black's cube like on the ...
0
votes
0answers
31 views

XNA - Link between Create Rotations matrices

A friend of mine have been coding some rotations on my XNA project, but the order of the matrices rotation are not good. Some are of form : Matrix.CreateRotationZ(1.21f) * ...
0
votes
0answers
34 views

XNA - Store and define level event [duplicate]

I am currently developing a game in C# using XNA/MonoGame and I face an issue to manage and store my level event. I store my level in XML (Enemies, Spawn location...) and I would like to store my ...
2
votes
2answers
110 views

How to use camera transformation without depending on (1,-1) scale during spriteBatch.draw()

I am creating a 2D platformer type game in XNA. I currently have a camera object, with a position/rotation/zoomlevel that I use to generate a transformation matrix to pass to SpriteBatch.Begin(). ...
-2
votes
1answer
48 views

Multiple collisions with single texture in XNA [closed]

I am developing a game where I want to implement two or multiple time collision with single object.i mean if two bullets collide to a ship then only it will explode... If a two bullet rectangles ...
1
vote
0answers
85 views

How calculate a new node after cutting a node into an octree

I'm working on a small XNA game, voxel-based like minecraft. I've recently faced a problem in how to delete a node (cube) from an octree and re-calculate the new octree afterward. I have already ...
3
votes
2answers
520 views

How can I tell what a rectangle intersects with?

I understand XNA's Rectangle class is rather limited, but surely there is a way to tell what a Rectangle is intersecting with? If I had Rectangle boundingBox = new Rectangle(stuff here); how would I ...
1
vote
0answers
52 views

Collision repositioning/resolution help

I've been having a trouble with moving objects out of the hitboxes they've just collided with. Here is my (relevant) code so far: Vector2 oposo = other.position; Vector2 poso = ...
0
votes
0answers
47 views

How to import fbx into XNA?

I am developing basic XNA car game. I used 3D fbx car models to represent car objects. I drag and drop all tga and fbx files into content and I succesfully showed car in my game by using some basic ...
0
votes
0answers
26 views

How to use CCGrid3DActions in Cocos2d-XNA?

For example, I want to add a CCLiquid action to my player shield in my game. In my Player class: public Player() { // code snippet when creating new Player CCSprite shield = new ...
2
votes
1answer
190 views

How can I implement scrolling endless road in XNA? [duplicate]

I am developing XNA game like following screenshot. I created my 3D objects and camera so I have models. But how can I implement scrolling road in XNA?
4
votes
2answers
2k views

How can I use XNA with Visual Studio Express 2013 for Windows?

http://dev.windowsphone.com/en-us/downloadsdk I downloaded the current version of Visual Studio to develop Windows Phone apps, but I don't know how to add XNA. I tried to install XNA, but it's not ...
0
votes
1answer
51 views

Why do I get an error about being unable to change rasterizer states in this code?

I'm trying to toggle between wireframe and full mode while drawing a 3d model. So far I have this rs = new RasterizerState(); In my update method: if (state.IsKeyDown(Keys.V)) { ...
0
votes
1answer
117 views

How do I right-align text?

I'm using SpriteBatch.DrawString, which seems to not have an overload for text alignment. How can I draw aligned text?
0
votes
1answer
82 views

How can I determine if an object hit the top of a tile rectangle in MonoGame? [duplicate]

I've been implementing an AI system in my 2D game using MonoGame. In some situations when a collision between two objects occurs, I need the NPC to move in different directions depending on the ...
0
votes
0answers
84 views

Farseer: How can I break a body into multiple pieces?

I created a breakable body but the pieces are not flying around if the ball touches it. What is wrong? Why is the breakable body not breaking into pieces? I made a video and I enabled debugview, so ...
0
votes
0answers
31 views

How do I optimally give current UVs to the shader for animating a spritesheet?

I've implemented sprite animation by passing UVs into the shader with the good-ol' shader.SetParameters[] call. In the vertex shader, I lerp the new UVs with the Texture Coordinates of the original ...
0
votes
2answers
229 views

best way to implement movement after A* pathfinding? tile-based movement vs pixel-based?

I was able to implement the A* pathfinding algorithm to calculate a path from the enemy to player. After trying to do movement well, I realized I ran into all sorts of problems. I was able to add ...
0
votes
2answers
171 views

Farseer: What can I do so that a body can move through a special kind of bodies?

I have three different kinds of rectangles. Black, white and blue rectangles. The rectangles are moving and can collide with each other. But with one exception, the blue rectangle can collide normally ...
4
votes
1answer
546 views

How do I convert a .dds texture to .png bitmap in C#?

This question is from someone who has not written a line of code for games, but several Game Save editors and other game tools. I'm working on a Save Editor and would like to display icons of some of ...
0
votes
1answer
148 views

How can I scroll my tile maps?

I've been trying to understand how I can use matrix to implement a smooth tile scrolling system but I fail miserably. So I have a pretty big world stored in a multi-dimensional array which is ...