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,057
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
  • 25.3k
7 votes
Accepted

Change in direction should slow down object and accelerate in new heading (2D grid-based)

I'm not familiar with xna... but I know maths. And implementing physics without understanding the math behind it is like going into politics without knowing how to ...
cprn's user avatar
  • 254
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

Will unlocking the framerate in XNA/MonoGame tell me how efficient my code is?

I don't see why you couldn't use it! Keep in mind that you may have to code differently to account for the differences between fixed/variable timestep, so if you're planning on making it fixed when ...
tandersen's user avatar
  • 419
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

Can I make this physics simulation any faster?

So the first thing I noticed was that when you do previousTouch = currentTouch; currentTouch.Clear(); this should also clear previous touch since List is a ...
Nils Ole Timm's user avatar
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,057
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
  • 118k
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

MonoGame Pipeline

What it looks like you're seeing is the file opening as a plain text in Visual Studio. I often open the file this way because I find it handy to be able to edit stuff outside the GUI. As mentioned by ...
craftworkgames's user avatar
4 votes
Accepted

increase and decrease coin count

void Update(){ playerprefs.Setint(TotalCoinKey, iCoin); playerprefs.save(); } what that is doing is, it is setting total coins value to the number of coins ...
SanSolo's user avatar
  • 1,159
4 votes
Accepted

In Monogame, why does Rectangle.Offset not work?

This is because Rectangle is a struct, which causes this to be a bit of tricky case. Since structs are passed and returned by value in C#, calling Paddle.Box will return a copy of Paddle.Box. After ...
Athos vk's user avatar
  • 240
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,057
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
  • 118k
3 votes
Accepted

Collision detection

Instead of updating your object's Rectangle variable each frame, you should instead create a read-only Property for it: ...
jgallant's user avatar
  • 8,374
3 votes
Accepted

new graphicsdevice returning null

Typically, you would use the GraphicsDevice object that is created in your Game class. You should be able to create a second Graphics Device, however, I think there is a access issue when you attempt ...
jgallant's user avatar
  • 8,374
3 votes
Accepted

Replace black color by transparent color XNA

If your image background is already transparent, then you may need to enable alpha blending on the basic effect if its not already enabled. If the textures background is not transparent, the easiest ...
Seta's user avatar
  • 1,398
3 votes
Accepted

Drawing collision detection boxes

Code to create a blank texture at runtime (after discussing with you via comments above): ...
jgallant's user avatar
  • 8,374
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

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