20 votes
Accepted

Why is sin = Y and cosine = X?

I will try to answer briefly. Why is the circle represented as 1,1 and -1,1? This thing is usually called Unit Circle, because its radius equals to 1. How it is relative to trigonometry you're ...
Joshua Light's user avatar
11 votes
Accepted

How to create shockwave of objects in other shapes than circle?

To maintain the shape while spreading, each bullet needs to have a different speed. Suppose you are going to create a "wave" of bullets originating from a centerpoint, what you need to do is to ...
Felsir's user avatar
  • 4,067
11 votes

Why is sin = Y and cosine = X?

When you ask Why is sin = Y and cosine = X? I read your question as Why is the function that gives me the Y axis called "sin" and why is the function that gives me the X axis called "cosine"?, so I'll ...
Theraot's user avatar
  • 26.7k
6 votes
Accepted

How to change screen resolution in XNA?

The easiest way is to set it through the GraphicsDeviceManager. ...
Pharap's user avatar
  • 1,627
6 votes
Accepted

How to convert png images to True Type Font?

Truetype fonts are vector based. So you would have to trace the glyphs with a vector editor and then use a program like FontForge (which also is a vector editor) to build a font from that. That said, ...
CobaltHex's user avatar
  • 2,238
5 votes

How to correctly enable anti aliasing in XNA?

If anyone here is using MonoGame instead of XNA, the process is ever so slightly different. Notice that we change the graphics profile to HiDef. This allows more ...
Pyroglyph's user avatar
  • 131
5 votes
Accepted

2D Platformer AABB collision issues

The first problem where the collisions were handled wrong, were solved with this solution posted by David. Instead of solving the two axis at the same time, the solution solves each axis individually. ...
Rafael Almeida's user avatar
5 votes
Accepted

Position vs Destination Rectangle

The simple answer is: the Vector2 positions the sprite at the X,Y coordinates, while Destination rectangle fills the sprite to fit that rectangle. More advanced answer: Sprites are in reality quads ...
Felsir's user avatar
  • 4,067
5 votes
Accepted

Efficiently updating building effect radius coverage

Caching building coverage The idea of caching the information which buildings are in range of an effector-building (which you can cache either from the effector or in the affected) is definitely a ...
Philipp's user avatar
  • 119k
5 votes

3D objects with animated bones Monogame in the year 2017, is it possible?

Finally I've found the solution to my problem. First I've created a new content pipeline by following this blog: http://community.monogame.net/t/tutorial-how-to-get-xnas-skinnedsample-working-with-...
J. Dove's user avatar
  • 105
5 votes
Accepted

Is there an advantage to creating a tileset instead of multiple content items?

Nowadays the most important reason to use a tilemap instead of separate pngs is just for organisation. Do you want a stage to have a different theme? Then you simply create a new tilemap, that follows ...
Tom Tsagkatos's user avatar
4 votes
Accepted

Can I use xna tutorials to learn monogame?

Yes. The MonoGame API is intended to be exactly the same as XNA. In most cases this is entirely true. If MonoGame doesn't work just like XNA it's usually considered a bug. The exception to the rule ...
craftworkgames's user avatar
4 votes
Accepted

Is it possible to have a diagonal movement animation in monogame/xna?

Instead of directly modifying the position of the player you could add another Vector2 variable named, for example, Direction. When a player pressed W you set direction to (0,1) and if it was up & ...
Mikael's user avatar
  • 444
4 votes
Accepted

HLSL texture sampler always returns white

The problem is this: the compiler optimizes the effect file. So in your code only ONE sampler is created. However in reality you are using TWO textures. The first one, being the Texture provided as ...
Felsir's user avatar
  • 4,067
4 votes

Drawing huge amount of tiles in Monogame (XNA) efficiently

Graphics cards are optimised to draw a few things lots of times rather than the other way around. In your case, you have a lot of things (different textures) that you want to draw a lot of times (...
loodakrawa's user avatar
4 votes
Accepted

Why is the mana regenerating too fast?

You forgot to reset your currentTime variable. Do it like this instead: ...
John Hamilton's user avatar
4 votes
Accepted

How does ECS handle systems which need to know more about the environment of the entities it processes?

My solution to this would be to create a component AITarget which marks an entity as something zombies are supposed to attack (like a player or a civilian). Now ...
Philipp's user avatar
  • 119k
3 votes
Accepted

Using sourceRect or cropping out a Texture 2D to draw? MonoGame/XNA

The sourceRect is much better for this. Watch this if like a funny video explaining why: https://www.codeandweb.com/what-is-a-sprite-sheet-performance The more technical explanation: I am using ...
Andreas Löw's user avatar
3 votes
Accepted

Monogame - how to make a smooth color transition with Color.Lerp()?

If you look at the Color.Lerp documentation you'll notice that the third parameter is the amount. ...
craftworkgames's user avatar
3 votes
Accepted

How to avoid recursive and or infinity loop monogame return function

You don't need to use recursion for this (and without a base case, you'll get an infinite loop, like you are). Just change your method to: ...
House's user avatar
  • 73.2k
3 votes
Accepted

Problems with converting from Screen Space to World Space

The short answer is that the standard perspective projection has a side effect of focusing Z resolution near the camera, which is actually beneficial. A perspective projection turns out to be linear ...
Alex Sherman's user avatar
3 votes

Monogame - Sprite sheet animation

Store your animations in an animation dictionary. You can use a Dictionary<string,Rectangle[]> or create a more elaborate construction that holds more frame ...
Felsir's user avatar
  • 4,067
3 votes
Accepted

Get the difference between 2 matrices

Your problem is that you're trying to compare floating-point numbers for equality. The matrix inversion and multiplication, however, will inevitable introduce slight rounding errors that will make ...
Ilmari Karonen's user avatar
3 votes
Accepted

Publishing an XNA project on Windows Store

XNA games aren't directly support in the Windows Store. The "appx" file types are generated when building a Windows Store app (it's one of the project options when you are creating a new project). As "...
SaviorXTanren's user avatar
3 votes

Getting Sprites from a SpriteSheet with Rows and Columns

Your y-coordinate is always 0, so only the first row is used. You need to change this line: ...
SurvivalMachine's user avatar
3 votes
Accepted

Very weird C#/XNA bug, not drawing a magenta dot

What you're experiencing is the color key part from the XNA content processor. You can find the setting in the properties windows. What you want to do is disable color key entirely.
William's user avatar
  • 2,724
3 votes

How Should I Go About Updating My XNA Game?

As David already mentioned, get a website and program an auto-updater for your projects. It works as follows: When your game starts check for the server version located on your website in a file. If ...
Byting Games's user avatar
3 votes
Accepted

How to draw Tiled map with MonoGame.Extended v0.6.266 beta?

I'm the creator of MonoGame.Extended ;) Quite a lot has changed since the 0.5 release. We've been working heavily on the Tiled renderer to solve some memory and performance issues and make it ...
craftworkgames's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible