New answers tagged

1

I finally succeeded to get rid of this behaviour. (Thanks @Jon !) "Don't let the snake change its direction if it heads backward from its current heading. " It actually works :) Example with 'Up' Direction : int X = _snake._parts.Last().X; int Y = _snake._parts.Last().Y; if (newDirection == Direction.Haut) { Rectangle test = new Rectangle(X, Y - ...


0

Not sure if this will work but I did a few tests and it seems to be fine. Define your enum like this : enum Directions { Up = 1, Down = ~Up, Right = 2, Left = ~Right }; Now you can a check about the current direction and next direction like this if(currDit == ~nextDir) { //the snake will go into itself ...


0

I know, it's a bit late but try boundingSphere.Center += entityPosition; before you return your sphere in CreateBoundingSphereForModel


1

You need to download and install the Visual C++ Redistributable Packages for Visual Studio 2013. These two posts on https://github.com/mono/MonoGame/issues/3556 worked for me: tomspilman: Hum... the redist we need vcredist_x64.exe is only 7MB. If you download and run it from the command line: vcredist_x64.exe -? It tells you that it has ...


0

I would abandon the though of perfectly averaging all pixels in a block. Instead, sample the color from say 3x3 underlying (but not neighbouring) pixels, while using biliear filtering. This is only 9 texture lookups per final painted pixel - not at all a big job for the GPU. As opposite to per-painted-pixel sampling all pixels in a block and averaging. Say a ...


0

You could render your image to a lower resolution rendertarget with point sampling to achieve a pixelation effect. This way you could use a simple pass-through pixels shader but the sampling of the texture alone would make it pixelated. An other way would be a compute shader. You could dispatch it with the number of desired blocks, and for each block ...


1

No. You have a condition in CheckCollision() that only prints 'Inner' if the condition is true (the condition is that there has to be at least one Platform that is in the proper state to apply the code block to. So for several Update calls, the code flow went to CheckCollision() but there were no Platforms colliding (probably) so there was zero items to run ...


0

Here is a quick and easy way to implement a 3rd person camera within the code base of your project. Normally, I'd recommend placing these changes in the Update method instead of the Draw method but that would require a bit of refactoring of your code base that is beyond the scope of this question. Change this section: Matrix[] transforms = new ...


0

I would do both. I would make separate arms, legs, body, and head classes and keep track of them all within a player class. This way, in your Game1 class and other classes, the player is treated as ine object, but within the class, the body parts are treated separately. Hope this helps!



Top 50 recent answers are included