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
0answers
11 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 ...
0
votes
0answers
12 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 ...
0
votes
0answers
9 views

XNA 2d weird rotation from quaternion in scene-graph

I have been trying to set up a scenegraph in XNA. It uses matrix transformations to accomplish this. So far, I got position and scale working perfectly, however rotation is behaving weirdly and I'm at ...
0
votes
1answer
50 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
27 views

Deferred Rendering Optimization

I've followed http://www.catalinzima.com/xna/tutorials/deferred-rendering-in-xna/ for my little renderer(using sharpDX - Toolkit) and everything went good, until i noticed some problems: If I'm ...
0
votes
0answers
18 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 ...
0
votes
1answer
89 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 ...
0
votes
0answers
49 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. How can I convert the effect file(.fx file) to an .xnb file? I use Monogame 3.2. How can I add a custom shader to ...
0
votes
1answer
54 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
27 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
31 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
54 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
42 views

Multiple collisions with single texture in XNA

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
63 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
460 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
25 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
28 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
8 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
110 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?
2
votes
1answer
131 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
43 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
75 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
45 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
61 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
29 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
167 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
152 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 ...
-1
votes
0answers
40 views

XNA Inverting Controls

I want to invert the controls for the player after colliding with a certain sprite. I have this method (I'm not even sure if it's a method, sorry I'm new at this). This is in my PlayerSprite class. I ...
2
votes
1answer
105 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
86 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 ...
6
votes
1answer
141 views

Optimize state changes within a render queue

I am refactoring some parts of the game engine I am working on. This engine is made in C# with XNA. The part I have trouble with is shader/material and the render queue. In the new version I will ...
0
votes
0answers
12 views

Data storage in game objects [migrated]

I'm building a game with XNA at the moment, and I currently have my game object components set up like so: class Character : GameComponent { public int health, state; public float speed; } etc. ...
0
votes
1answer
34 views

XNA 4: GetData from Texture2D and Set it into Texture3D with specific order

I am trying to convert my color grading 2d lookup texture into 3d LUT. When I simply use: ColorAtlas.GetData(data); ColorAtlas3D.SetData(data); I get this: I tried building my 2d atlass ...
3
votes
0answers
32 views

Problem building a color grading map

I am trying to build a default color grading map into a 1024x32 RenderTarget. Here is my shader code: VertexShaderOutput VertexShaderFunction(VertexShaderInput input) { VertexShaderOutput output; ...
-2
votes
1answer
84 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 ...
3
votes
2answers
253 views

How can I determine the contact point of a collision?

I have two Farseer bodies. A static rectangle and a dynamic ball that is flying around. I want to determine where the ball touched the rectangle. I need the exact coordinates of the contact point. ...
1
vote
1answer
47 views

Height and width of a Farseer body?

I have a body named PersonA. If PersonA collides with another body, the width and height of that body should be saved. I tried it like this but I always get error messages that "Width" and "Height" ...
1
vote
1answer
127 views

How do I avoid pathfinding characters getting stuck in corners?

I used A* pathfinding to return a list of Tiles to get from an enemy to the player. After that, I wasn't sure how to actually move the enemy. What I ended up doing was get the first Tile in the path. ...
1
vote
0answers
48 views

gap when drawing string with xna [on hold]

This is how the drawing works without the camera2D class: and when I add the camera2D class from this link This is the result: I changed the "Play" text to "PlayAAAAAAAA" to show you the gap. This ...
12
votes
2answers
956 views

How can I create a bomb explosion in Farseer that pushes nearby objects away?

I'm trying to create a bomb explosion in Farseer. I created a circle for the bomb. However, if the bomb explodes, the objects (bodies) that are around it should fly away because they're pushed back by ...
0
votes
1answer
98 views

Tile System with moving Platforms

I am using a tile based system where the level is stored in a char: char[,] Level2 = {{'.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.'}, ...
0
votes
2answers
60 views

Adding 'xna content project' reference to monogame project(visual studio 2013 pro)?

I want to add reference to an xna content project. Which should be like the content project reference we have in an xna windows game. I am on visual studio 2013. I got the xna extensions to work by ...
4
votes
4answers
498 views

How can I draw a shadow under my character?

I created a 2D tile-based jump and run game for Windows Phone and I want to draw a shadow under the character. How can I do that? The shadow must also be drawn on the tiles if the character jumps. The ...
1
vote
1answer
120 views

Why does my collision detection code cause my framerate to drop?

I have this code: foreach (CollisionTiles tile in map.CollisionTiles) { player.CollisionBox(tile); foreach (Enemy enemy in enemys) enemy.CollisionBox(tile); } This is the CollisionBox() ...
2
votes
2answers
86 views

Sweep collision between two moving spheres?

Say I have a scenario like this: Here I got two spheres (sphere A and B) that moves from on spot to another during a frame. How can I predict where these two collide if they collide at all? In ...
2
votes
1answer
126 views

C# - XNA - Making a Modular Screen / State Manager

I'm not entirely sure how to ask this question since its somewhat broad, but also a bit specific to my code. I'm making a game in C# XNA and attempting to have the parts of it be fairly modular so ...
3
votes
1answer
121 views

How can I use a Texture2D larger than 2048 x 2048?

I'm having issues working with a large image. I've read other threads on using images larger than a Texture2D supports, but found nothing that addresses my problem specifically with implementation ...
1
vote
1answer
59 views

Is Spine's XNA runtime missing an importer? [closed]

I'm writing an XNA 4.0 game and use Spine for animation. Until now, I've been making spritesheets with Spine and using them with a custom animation class. I recently discovered there is an official ...
0
votes
1answer
84 views

Looking for XNA patterns [closed]

Hello mature game developers. Im just started with XNA, but i got solid expirence with C#. I wonder is there any common code patterns for XNA games? Like should i make classes wich handle draw and ...
0
votes
2answers
76 views

how to make a spritefont with multiple colors and black?

I want to make a multicolored font like: My problem is that black is someway "set" as the transparency background for the font, so if i use black or any dark color xna takes it as background too. ...