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
votes
1answer
135 views

Why are the coordinates interchanged in Monogame?

If I use XNA Gamestudio, I can draw a sprite on a specific position like this: spriteBatch.Draw(Texture2D, new Vector2(PositionX, PositionY), Color.White); But in Monogame, I must change the ...
0
votes
1answer
245 views

How can I support different resolutions with Monogame? [duplicate]

I want to support the following 4 resolutions in my Windows Phone 8 game: 480 × 800, 768 × 1280, 720 × 1280, 1080 x 1920. How can I do that with Monogame? If I draw a sprite with Monogame, the sprite ...
6
votes
0answers
238 views

Rotation pitch/yaw reverse problems when picking a tile (2.5D) [closed]

Set-up: 3D world, isometric sprite rendering (4 fixed angles). This transform matrix is used as camera: _transform = Matrix.CreateRotationZ(Roll) * ...
0
votes
1answer
37 views

implementing different users in XNA - XML

So I am making a simple 2D game in XNA, and I want to implement different users (players), so each person playing can have their own high score, can only play levels they've already played, can only ...
0
votes
0answers
214 views

C# XNA game window's ClientBounds not equal to Viewport/BackBuffer at native resolution

I'm having a rather strange issue involving my game window and its resolution. I have a function in my Engine that sets the resolution (with the appropriate checks to make sure the resolution is ...
3
votes
2answers
180 views

Colour intersection of two alpha-blended sprites

In XNA, is it possible to merge two alpha blended sprites so they look like one contiguous shape, eliminating the merge of colour at the overlap? At the moment when I try, the intersection is quite ...
1
vote
2answers
147 views

How do I hide the console window for my released MonoGame game?

I am just finishing up my first game for the One Game A Month challenge which I wrote with the current MonoGame framework in Xamarin for Windows. I built the program in release mode, but running the ...
0
votes
3answers
170 views

How can I properly rotate a 2D vector in the “flipped” XNA client space?

In my 2d XNA game, because SpriteBatch treats world space as client space and has positive Y axis down and negative up, I've built my game's world space with that coordinate system too. However, I've ...
2
votes
3answers
779 views

Event/Trigger System Architecture

The Plan I am up to write write an own Trigger/Event System, an event engine or how you call it. I would like to achive something similar to Blizzard's most level editors, like Starcraft 1-2, ...
0
votes
1answer
125 views

How long will it take to jump from point A to point B?

I need to know how long it takes to jump from one point to another. Because if the jump time takes for example 2.0f(float jumptime = 2.0f), a jump animation is played during a time interval of exactly ...
1
vote
2answers
186 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 ...
1
vote
1answer
192 views

Tile Based Sprite Collision With Lots of Sprites [duplicate]

I am running into lag when loading many sprites onto the screen. If I have less than 12 on the screen it runs smoothly until I add a couple more and then it bogs down. I currently have this as my ...
0
votes
0answers
32 views

Farseer Physics, mass affecting velocity

I have just started with Farseer Physics, so I am kind of a newbie in this theme, so not a surprise that I have encountered something that is not involved by the engine, or I just don't know about it. ...
0
votes
1answer
184 views

Creating a gradient for a texture - Why is the color becoming dark on one side?

Updated While debugging I looked at the lerp and it was calculating into a negative number at the start. So I added in checks for to low or high a value, and that seems to have fixed it. I'll answer ...
0
votes
1answer
179 views

How do you calculate a gradient value within multiple colors (gradient stops)

In WPF/Silverlight XAML you can have a brush with multiple gradient stops at different points along the color line. I was able to replicate this behavior with two colors, a single color lerp, from ...
1
vote
1answer
232 views

How do I find two points at an angle on opposite sides of a circle?

With reference to my previous question: I'm using micklh's answer, which works perfectly. However, it calculates the gradient based on two points, a starting point and an ending point. I want to ...
1
vote
4answers
224 views

Cell Lighting Propagation Problem

I have in place a cell-based lighting system that works basically like this: (Not my actual code) //Light moves up for (int x = 0; x < width; x += 1) { for (int y = 0; y < ...
0
votes
0answers
53 views

Need Help with the Syntax for a Simple 3D Effect to Manipulate Quad Points/Vertices for PSM

I have been porting a game made in XNA, a 2D RPG, to PSM using Monogame. Unfortunately, I use a simple 3D effect that cannot be translated because Monogame did not write translation code for the ...
0
votes
1answer
333 views

XNA 2D Camera, zoom into player

My 2D camera follows the character fine without any zooming. However, when I tried adding a zoom feature using the Matrix.CreateScale(), the camera no longer follows the character properly. public ...
2
votes
1answer
132 views

2D lighting causes black rings to appear

A year ago I implemented 2d lighting in XNA using sprites. The sprites I used were created by placing a soft white photoshop brush on a transparant background. The result was this: (lights only) ...
1
vote
1answer
142 views

GameTime Replacement / Wrapper for Pausing , Slow-mo and 'Fast-mo'

I'm looking to change the way in which my game uses GameTime to run the game so that I can easily pause the game (elapsedTime = 0) or change how slow/fast the in game elements interact as a scaler of ...
1
vote
0answers
111 views

Using obj file in an XNA game [closed]

Sorry if this is a bit novice but I am far more into engineering than game development but I just want to make a small 3D game for fun with XNA (well actually MonoGame). The thing is that I don't have ...
1
vote
1answer
358 views

Sprite collision with color?

Is this possible? To elaborate, I am making a PacMan offshoot. Essentially it is a "zoomed in" version of the game, but the board is randomly generated. I have 11 .png files each to be used as a ...
0
votes
0answers
47 views

FBX animation file - Fixing Multiple Roots

I have a collection of nicely animated fbx files that all have the same issue explained here http://www.unwrap3d.com/u3d/quicktip_xna.aspx under 'Fixing multiple roots' section. This requires ...
0
votes
1answer
111 views

Farseer: How can I calculate the needed velocity in this case?

I have two platforms and one ball. The ball should fly from the red platform to the blue platform. The ball should land somewhere in the purple rectangle of the blue platform. How can I know how ...
0
votes
2answers
1k views

Simple 2d tile based lighting in xna

I am currently trying to implement simple lighting into my game. My world is represented in a 2d array of numbers, each number being a certain tile. I am changing the color parameter in the ...
1
vote
1answer
49 views

A Sensor’s ContactList Keeps Old / Ignores New Contacts, When That Contact Is still

Okay this is a hard one to explain so I’ll try my best. Basically every time my enemy class updates, it runs a SightCone Sensor Contact List test, so this is every single frame it checks for all the ...
1
vote
3answers
266 views

Code to generate a color gradient within a texture using a diagonal line

I want to generate a color gradient between two colors from x1,y1 to x2,y2. I'm unsure how to do this though. I can use Color.Lerp to get all of the color steps, but the problem is that I don't ...
0
votes
0answers
17 views

XNA 4.0- Help with firing projectiles at the mouse cursor [duplicate]

I'm making a Zelda-esque RPG in XNA and I'm confused on how to fire a projectile from the location of the mouse cursor? I've been trying to find a solution on the internet but to no avail.
-2
votes
1answer
85 views

Clamp the scroll wheel value [closed]

I'm having something like an inventory bar at the bottom of the screen. However, when the highlight square (indicates what object you are going to place) reaches the end. The value of the scroll wheel ...
1
vote
1answer
82 views

Update Camera manually after Camera's target updates, bypassing the game loop. Is this a good or bad practice?

This question may be suited better for codereview.stackexchange.com? I've been experimenting with a camera implementation / matrix SpriteBatch transformations and have run in to a bit of a snag. The ...
1
vote
2answers
267 views

Anti-aliasing a sphere

I render everything in my game in 2D with SpriteBatch with the exception of a spherical entity (orb) that I render as a spinning and dynamically lit (custom effect) sphere in 3D. I capture the sphere ...
0
votes
0answers
38 views

Matrix transforms with SpriteBatch overloading - how do you rotate/zoom around a point? [duplicate]

I have a transform matrix which works as intended for game objects I want to be completely controlled by my camera: _transform = Matrix.Identity * Matrix.CreateTranslation(-_position.X, ...
0
votes
2answers
76 views

If SpriteBatch.Draw's SourceRectangle is null does a rectangle still get created?

If you use the following SpriteBatch.Draw overload, does a Rectangle get created for the texture? spriteBatch.Draw(texture, textureRectangle, null, Color.White, 0f, textureOrigin, SpriteEffects.None, ...
-1
votes
2answers
104 views

How can I add a bullet every time the player clicks?

I'm not understanding how to dynamically add object instances in my games. I'm really having trouble understanding the general concept. If I want to quickly generate unknown numbers of objects, going ...
0
votes
1answer
108 views

How to loop through objects in class (XNA)? [closed]

In my game I have an Enemy class, and in that I have a constructor which I use to make Enemy objects. How do I add all Enemy objects to a list or loop through all of them using a foreach loop? I ...
2
votes
2answers
282 views

How can I provide a scrollable inventory list?

Does XNA have a built in method for drawing a scrollable list? There would be a scroll bar on the right that can be selected and moved up and down to scroll the list inside the inventory screen. The ...
0
votes
2answers
62 views

Attaching a Body to another, without the new body impacting the physics of the first in ANY WAY

Basically I want to add a vision / sight cone to an enemy body, So I have the sight cone body, and enemy body, but every joint or weld I have tried so far has caused the sight cone to severely ...
2
votes
1answer
289 views

Scaling textures with nearest neighbour without having to use seperate sprite batches

I'm interested in being to scale textures up via nearest neighbour. I can do this via a SpriteBatch.Draw() overload however this means that any other sprites drawn within that batch will also have the ...
0
votes
1answer
285 views

“Fading” effect between different screens?

I'm not sure what the correct word for it is, but I'm thinking like the fading effects when you move between different screens in Powerpoint or Keynote; that the screen fades black before the new ...
2
votes
1answer
131 views

How to smoothly track and draw player movement?

I am currently using C# XNA Framework to simply connect some development concepts that I've learned/used over the past few months. Right now I have a Web Service that keeps track of connected clients ...
0
votes
1answer
75 views

In an XNA game object, what should I use to represent a texture for serialization?

While trying to save to a file a list of objects needed to run my game, I noticed that Texture2D is not serializable. Why? What was the purpose? The object I want to serialize looks like this: ...
0
votes
1answer
273 views

XNA 3D Unable to Position Bounding Sphere

I have a collision method which seems like it would work, and it does, but the bounding sphere is always at 0, 0, 0. How do I fix this? Any more code and or details are avaliable upon request. Any ...
5
votes
4answers
2k views

How can I develop in MonoGame without relying on .xnb files?

I'm new to game development, and MonoGame seems like a beginner-friendly framework, so thought I'd start with that. However, as I started reading tutorials on it, I noticed a common theme: That at its ...
0
votes
1answer
59 views

how to make a onMouseEnter events in xna

I have been trying different things all day to get the answer. What I need is a sound to play one time when I enter a given rectangle I need the sound to fire one time and never fire again until I ...
1
vote
1answer
198 views

Is setting the render target back to backbuffer supposed to take long?

I am creating a game in Monogame (XNA extension). I draw to a render target to display menu items for my game. Everything works fine, however... Whenever I set the render target back to the back ...
3
votes
2answers
393 views

What's wrong with using a static class to load and expose all of my assets?

What are the pitfalls associated with loading and storing all references to all of your content/assets within a single static class? I've been trying to ask myself why I would want to instantiate an ...
0
votes
1answer
129 views

Blurry Background Images When Player is moving

So I've been developing a platformer and the when the player moves around the world the background images and tiles become really blurry. I've tried a number of fixes. I've made sure that the position ...
1
vote
1answer
95 views

XNA Render Targets Depth Testing

I imagine this is a problem that gets asked quite often, but reading up on it I can't seem to get a definitive answer on how to solve it. I've got two HLSL shaders (I've simplified them in the ...
1
vote
1answer
111 views

Better way to handle ordering and visibility of renderable objects?

I'm just wondering whether there is a more effective way to handle the ordering and visibility of renderable components that fits into the design of my already existing engine. How I do it now: In ...