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

-1
votes
2answers
71 views

Why does my character scroll off the screen instead of staying within the bounds of the screen? [closed]

In my XNA game, I have my "big boss" loaded and in the game screen. I put the code to update its position in the Update method of the main class. The objective is to get the "big boss" to move from ...
0
votes
0answers
59 views

“Blinking” graphical bug when rotating shadow matrix

So, we have implemented Krypton shadows into our code for our 2D game, and it's working beautifully. Only issue is that we're running into a bizarre graphical bug when rotating the shadows with the ...
-2
votes
1answer
111 views

Random movement of enemy [closed]

I am making a game in XNA, and I am trying to make an enemy move randomly.The game is a platform game, so the enemy only moves left and right.I want it to move right or left a little, then stop.I ...
1
vote
3answers
833 views

How can I port an XNA game to iOS and Android?

I made a little Windows Phone game with XNA and Farseer Physics engine and I want to port that game to iOS and Android. Is Monogame the only software that I can use or are there alternatives? I don't ...
0
votes
1answer
238 views

How can I find the perpendicular to a 2D vector?

I'm making a top down game where the player moves forwards towards the position of the mouse cursor. As part of the player's movement code, I need to determine a vector that is perpendicular to the ...
-1
votes
1answer
51 views

XNA spritebatch drawing order

Im new in this and im making XNA game. I have problem with spritebatch drawing order. To be explained : i click button to open inventory and i need all drawing to be behind my inventory layout. But ...
0
votes
0answers
112 views

Smooth circular collisions with edges/collision boxes [C# + XNA]

So, me and a friend are working on our top-down perspective 2D game, and have come to work on perfecting our collisions. In its current state our player sprite is colliding with walls, but is ...
1
vote
0answers
37 views

Squashing screen resolution in XNA [duplicate]

I've made a game in 1920x1080 res in XNA, and I can't seem to find a way for the graphics device to squash the screen images to other resolutions like 1600x900 when played on different computers. How ...
0
votes
1answer
307 views

Monogame: Why is my sprite looking the same on every resolution?

I want that my sprite(Mario) don't look the same on every Windows Phone resolution. If I use this code, the sprite is on every resolution on the right position but it also has the same size on every ...
0
votes
1answer
44 views

XNA SoundEffect with offset

I've been trying to make a soundmanager recently which has several functions which fits my needs. But one thing I can't solve, is the offsetting the soundeffects. Is it possible to play a soundeffect ...
-1
votes
1answer
138 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
266 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
241 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
242 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
190 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
154 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
189 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
829 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
126 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
197 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
200 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
33 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
196 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
186 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
243 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
55 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
370 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
134 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
128 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
2answers
391 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
48 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
113 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
281 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
95 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
281 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
85 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
111 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
307 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
302 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
307 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 ...