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

1
vote
3answers
122 views

Is this way of making an XNA game window borderless safe to use for various Windows PCs?

I have found a way to simply make an XNA 4.0 game's window borderless. Here is the code from the article: IntPtr hWnd = this.Window.Handle; var control = System.Windows.Forms.Control.FromHandle( hWnd ...
0
votes
2answers
73 views

HLSL Shadow Mapping occurs only around player

I've recently begun playing around with Monogame (OpenSource "remake" of XNA). My current task is to write a simple shadow mapping shader. After following Riemer's XNA Tutorial I got the shadows to ...
2
votes
1answer
131 views

How can I simulate a magnet that attracts a ball in a 2D enviroment?

I am making a top-down game where you have to move a ball from point A to point B. You are attracting the ball using magnets that are standing still. The ball needs to get pulled by multiple magnets. ...
0
votes
2answers
112 views

Building a chunk w/ blocks: making ramps. How to detect if blocks are making “stairs” (like in a mountain) and should be turned into ramps?

My question is quite simple, but the answer may be not. I am studying and making a voxel engine, generating block vertices around its center position with TriangleList primitive at C#/XNA. The ...
0
votes
1answer
71 views

Creating refraction map problem [on hold]

I'm reading riemers tutorial on how to make a water effect and trying to translate it from xna 3 to xna 4. So far I figured out I have to create a shader in order to clip the planes for my refraction ...
2
votes
2answers
100 views

Multi-colored text and kerning

Drawing multi-colored text or highlighted text in XNA/MonoGame is pretty annoying, and the standard way I've seen to do it is to just to make multiple SpriteBatch.DrawString calls, and place them ...
0
votes
2answers
95 views

Vertical Collision Detection, Falling Through Ground

After much work trying to learn collision system theory and apply it, I've got my collision system working for the most part. The player can collide horizontally with no issue, sliding against walls, ...
1
vote
1answer
83 views

Inventory management syncronized network

I'm implementing an inventory system with items in 1x1 slots in a open-world multiplayer game. But I can't decide how I want to synchronize the item management with the server. I see two options here. ...
1
vote
1answer
98 views

Why are my sprite outlines partially rendering in the wrong place?

I've been trying to draw an outline around a sprite using the code from this answer. Details My sprite is called Ship2Sprite. This is how I create the rectangle: rectangle = New ...
4
votes
1answer
124 views

How do I letterbox a C#/Monogame viewport within a resizeable window?

I am making a 2d game with xna/monogame. I want the main view area to always show 15x15 tiles, or 480x480px. I've got something that sort of works, following this guide. It expands the view range ...
0
votes
1answer
165 views

Multiple tile drawing in monogame is slow

So I have this drawing function (which is by the way recomended as an solution here). It draws tiles on the whole window with no problem but my game slows down to ~30fps after maximizing it to ...
0
votes
0answers
24 views

Wall Collision on a model

I am building a model of a house in XNA and made a collision system so that when the player goes into the wall they stop. Also I made it so if the player is pressing the key 'up' and collides into the ...
0
votes
2answers
63 views

Performance Difference Between Content.Load and Texture.FromStream xna

Is there any performance difference between Texture2Ds loaded using the content pipeline and Texture2Ds loaded using Texture2D.FromStream()?
2
votes
1answer
76 views

Wall-sliding Collision Response Only Works On One Axis (2D)

"sprite" is the player object, velocity is a Vec2 that tracks movement (is set to -1, 1, or 0 at any given time), each sprite in "sprites" is a wall of the same size as the player (everyone is a block ...
1
vote
3answers
117 views

Get highest (Y-axis) vertices from primitive d20 dice in xna

I have created a d20 dice (icosahedron) in xna and used BEPU physics to roll it. But now I'm trying to get the value from the dice after its rolled. I was thinking about looking for the 3 vertices ...
3
votes
4answers
270 views

RPG like hit points growth algorithms help

I am currently making an XNA game in C#. I want to increase health as the player level up. I am currently using this equation. MaxHealth = Convert.ToInt32(100 * Math.Pow(1.17, level - 1)); Its ...
0
votes
1answer
58 views

How does Texture2D.GetData return coloured pixels?

I'm trying to work out how the pixels are stored in the returned array but I'm not having a lot of luck (and thus my calculations don't seem to be working). I realize that the pixels are stored in ...
0
votes
1answer
66 views

XNA: Camera's Rotation and Translation matrices seem to interfere with each other

I've been following the guide here for how to create a custom 2D camera in XNA. It works great, I've implemented it before, but for some reason, the matrix math is throwing me off. public sealed ...
0
votes
0answers
27 views

XNA `tex2Dlod` always returns transparent black

I want to sample a texture in a vertex shader, so at first I just tried using float2 texcoords = ...; color = tex2D(texture, texcoords); But apparently I cannot use tex2D in a vertex shader, and ...
0
votes
1answer
119 views

How do you create a .XNB Font file for use with CocosSharp?

I know the .XNB file format is an XNA thing and that CocosSharp inherits this from its MonoGame roots. However there doesn't seem to be any information on how to create your own .XNB fonts to use with ...
1
vote
2answers
133 views

XNA How to change the sprite texture to white color

as the title, how can i do to take the sprite to white color here is some example, turn to follows image and my game planform is XNA now, and developed winphone game thanks for reading!
0
votes
2answers
47 views

Collision detection problem in XNA

I'm having two problems with my collision detection in XNA. There are two boxes, the red box represents a player and the blue box represents a wall. The first problem is when the player moves to the ...
1
vote
1answer
64 views

how to define a field of view for the entire map for shadow?

I recently added "Shadow Mapping" in my XNA games to include shadows. I followed the nice and famous tutorial from "Riemers" : http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series3/Shadow_map.php . ...
3
votes
1answer
95 views

Character creation using spritesheets

I am currently creating a 2D fighting game and have implemented a system where upon starting a new game, the player is presented with the option to create a custom character. I have a set of string ...
-1
votes
1answer
277 views

How add fog with pixel shader (HLSL) XNA?

I started to make a small game in XNA . And recently i tried to add a "fog" on "pixel shader HLSL" with the class Effect from XNA . I search online about some tutorial and found many sample. But ...
0
votes
1answer
62 views

Problem with sprite direction and rotation

I have a sprite called Tool that moves with a speed represented as a float and in a direction represented as a Vector2. When I click the mouse on the screen the sprite change its direction and starts ...
1
vote
1answer
139 views

Draw lines from the center of the screen at specific angles

I want to draw multiple primitive lines which start at the center of the screen and end at the edges of the screen, traveling at specific angles: How can I set the angle for each line? Here is my ...
1
vote
1answer
64 views

Collisions and Lists [closed]

I've run into an issue that breaks my collisions. Here's my method: Gather Input Project Rectangle Check for intersection and ispassable Update The update method is built on object_position * ...
1
vote
0answers
58 views

XNA HLSL UV Mapping

I was testing my hlsl lighting shader, I've copied it from a tutorial and it works perfectly, but all the meshes in the model needs to have texture coordinate, I guess this is because this part: ...
1
vote
1answer
51 views

(XNA) Stretching Images (Sprites) without Blur (Rasterizing?)

thanks for clicking on this question although it has likely one of the most un-specific and confusing titles on this site. I am somewhat new to XNA and I have only posted 1 question on this site ...
-4
votes
1answer
47 views

How can I modify this projectile class to support movement in an arbitrary direction?

Hi I have the following class which Updates and Draws a projectile: public class TierOneProjectile : IProjectile { private AnimatedTexture animation; private Vector2 screenPosition, ...
0
votes
2answers
98 views

Draw a never-ending line in XNA

I am drawing a line in XNA which I want to never end. I also have a tool that moves forward in X-direction and a camera which is centered at this tool. However, when I reach the end of the viewport ...
2
votes
0answers
136 views

How to implement simple shadows on XNA?

UPDATE: See photos below the description I try desperately to implement shadows on my XNA games. My game is a style of games like Voxel (minecraft). The problem is that I do not find support / ...
0
votes
0answers
99 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 ...
2
votes
1answer
71 views

Cancel a SpriteBatch I've started drawing

Background: I'm working on a control library for XNA to use in a couple game clients I've written. The way I've implemented Dialogs is to have them derive from the base XNAControl class. XNAControl ...
1
vote
1answer
47 views

XNA Veiwing cubes behind others

I am learning 3D at the moment. It is going well but I am stuck on the viewing of the camera. I have two cubes, one next to each other made up of vertices, all the faces/triangles in the cubes are ...
2
votes
2answers
116 views

(XNA) Possible to hide, compress, or rename .XNB files?

I'm fairly new to XNA (only a week into C# and XNA at this point) but I have been developing games for a while now, and the program I used did not require any/many external files in creating an ...
0
votes
0answers
75 views

How can I create a 2D camera with zoom and parallax scrolling that works on every Windows Phone resolution?

Mario game that uses parallax scrolling: http://www.youtube.com/watch?v=de5f3mvRyIY I want to create a Windows Phone jump-and-run game with parallax scrolling. The parallax scrolling should be like ...
1
vote
2answers
76 views

XNA graphics.PreferredBackBufferWidth's new value doesn't immediately change window size

I set the width and height of the window in my game constructor, and then pass the graphics manager to a class to check the value. In the game's initialize function, it doesn't seem to recognize the ...
0
votes
1answer
152 views

Save Texture2D to file in Monogame

I'm working on a tilesheet builder tool for my game to speed up tile creation, and I need to save a generated texture2D as a png. I've tried using the .SaveAsPng function but it isn't implemented in ...
1
vote
2answers
81 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 ...
0
votes
1answer
80 views

XNA Masking Mayhem

I'd like to start by mentioning that I'm just an amateur programmer of the past 2 years with no formal training and know very little about maximizing the potential of graphics hardware. I can write ...
0
votes
1answer
83 views

Trying to understand the XNA fixed time step game loop logic

I came across the blog post Understanding GameTime, and after lots of reading on fixed time steps in game loops this is the approach I would like to take. In summary, this is the logic from the post: ...
0
votes
1answer
59 views

Detect which key was pressed last each frame

Why hello there, im developing a 2D game using XNA. My character movment is currently based on the keyboard state. Example (in the right order): if (state.IsKeyDown(Keys.W)) { //Do ...
0
votes
1answer
78 views

Blender animation to XNA distortion bug

I followed the instructions on the following video: http://www.youtube.com/watch?v=SissgQ0IXvk I'm using XNA 4.0 and Blender 2.69 I export the model with animation to a .FBX file. The animation is ...
0
votes
1answer
125 views

2D terrain with midpoint displacement and collision

I followed this theory Here to implement a simple scrolling 2D terrain for my running game. I am used to dealing with collision via a tile system but am looking for a good theory on how to perform ...
0
votes
0answers
70 views

Why isn't my Blender FBX not appearing in XNA?

I am trying to display a simple cube in XNA. The cube is the default Blender cube exported to a .fbx. Re-exporting the cube has had no effect. I have also varied the camera's z-distance from 5 to ...
1
vote
1answer
137 views

Resolution independent game world in 3D

I'm developing a game similar to Don't Starve - 2D billboards in a 3D world. Now I have encountered a problem with resolutions. I want the player to be able to change resolution, but I don't want to ...
1
vote
1answer
62 views

XNA Library DrawPrimitives throwing primitiveCount error

I downloaded the project from here http://silverlight.bayprince.com/tutorials.php?tutorial=13 and tried adding a new OBJ file with a few thousand vertices listed. The classic teapot works but when I ...
1
vote
0answers
70 views

How would I warp a mesh with code?

I recently asked a question about putting a camera at the head of a 3D human model here and it worked out rather well and whatnot, but there is still a problem that bothers me: How would I ...