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
36 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
11 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 and Visual Studio Express 2013 for ...
0
votes
1answer
48 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
24 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
30 views

XNA - Store and define level event

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 ...
1
vote
2answers
46 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
39 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
62 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
455 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
23 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
24 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
104 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
122 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
42 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
73 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
55 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
166 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
100 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
81 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
139 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
31 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
82 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
252 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
44 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
126 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
46 views

gap when drawing string with xna

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
953 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
96 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
59 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
495 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
85 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
122 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
119 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
58 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
83 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
75 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. ...
0
votes
1answer
68 views

Rectangle touch sides of another rectangle

I am making a platformer game and im trying to make the player collide with all the blocks, here's a picture: The blocks is stored in List and im trying to get the side's of the block usin static ...
1
vote
1answer
376 views

Why is my Texture becoming slower when it approaches it's destination?

I have a texture drawn on screen. Whenever I click on the viewport it remembers its destination and starts moving towards it, until it is there. This is the code I am using therefore: //Check if ...
3
votes
1answer
88 views

Cubic bezier for easing?

I would like to find out what Y is if X is a certain number from a cubic bezier curve to make a custom easing function, like it's done on this site: http://cubic-bezier.com/ Does anyone know a formula ...
1
vote
0answers
44 views

Precalculating timespan of bullet collision on cubic bezier curve circles?

I'm fairly new to game logics, C#/XNA (The language/library of choice) and bezier curves in general, and is stuck in my current project. I'm going to try to explain as thoroughly as I can what the ...
0
votes
0answers
35 views

Texture visualization problem on camera movement (xna)

I'm trying to move a camera over a model that is used as the floor of the game. When I move the camera, the texture of the model is not showing correctly (video of the problem: ...
1
vote
1answer
57 views

XNA - Prevent Holding of Mouse Button as Part of an Input Handler Game Component

I'm using C# XNA 4.0 Refresh. I'm working to create an InputHandler Game Component for my XNA game to handle all of the keyboard and mouse input. I used SixOfElevens RPG Game Tutorial (Here - ...