Tag Info

Hot answers tagged

4

You should be using layers. That is you have a naked character sprite. On top of that you add layers for hair, armor, gear, weapons. Depending on your actual game, you might do that in generic form, or split in parts or even add skeletal system. For example in Diablo 2 character was split into parts that were combined: Here's another example of ...


3

So as a warning I'm quite rusty with regards to shaders, but lets take a look at the BasicEffect's source code and see how Microsoft did it. Overview of the shader pipeline. Most interesting bits below. For a fog shader BasicEffect utilizes the below 2 components. A vertex shader performs per-vertex processing such as transformations, skinning, vertex ...


2

Unfortunately Monogame cannot (yet) generate XNB files so you will need to use the original content builder from XNA 4.0. You can use the libraries from https://msxna.codeplex.com/releases to install XNA on Visual Studio 2012 or 2013, so that you can use it with Windows 8.1.


1

Though Fault's comment is correct, what I usually do is to store the rotation and translation and then recreate the view matrix when required. (Full article here). The gist of the idea is: (btw the type of camera you are creating is often referred to as an Arc-Ball camera.) public class ArcBallCamera { public ArcBallCamera(float aspectRation, ...


1

Lets see what you're trying to do : you're trying to check if 1 entity collides with N other entities, but I suppose those collide as well. Basically (if I understood you right) you`re trying to do N*N comparisons every frame, or even N. You should, first and foremost, switch your data structure. Use a quadtree, with that, you will have a complexity of ...


1

You can use Texture2D.GetData() to copy texture pixel data to a Color[] in XNA. Texture2D texture=Content.Load<Texture2D>("asd"); Color[] tcolor=new Color[texture.Width*texture.Height]; texture.GetData<Color>(tcolor); After you have your Color array, you can do whatever you want with it, for example you could change certain colored pixels to ...


1

What you want to do is test how far the rectangle can move in a direction, then change it. For example: desiredX += speedX * timeSinceLastUpdate; desiredY += speedY * timeSinceLastUpdate; desiredRect = new Rectangle(desiredX, desiredY, width, weight); intersect = Rectangle.Intersect(desiredRect, collider); collisionWidth = intersect.Width; collisionHeight ...


1

Look again at your else/ifs: regardless of key combination pressed, only ONE direction is saved, because you override them. (the last of them in code) if left/right direction is pressed collision from the other side(right/left) is always assumed. (if (direction == Direction.Right) => move player to left side regardless where he is) quick fix: add another ...


1

Perspective shadow maps like that are usually not used to shadow the whole scene, but for a single lamp or flashlight. If you want to shadow the whole scene, You probably don't want to use perspestive shadow maps, but rather orthographic ones (I guess you want shadows from the sun?). When you are creating an othographic matrix (MSDN) you specify its ...



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