Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

XNA is a game framework by Microsoft that allows deployment for Windows, Windows Phone & Xbox 360.

0
votes
0answers
38 views

2D Lighting Shader Multiple Lights

For a 2D platformer, I have a 2D lighting shader with two passes, the first one draws a shadow from the closest light to the sprite and the rest of the lights will reduce the visibility of the shadow ...
0
votes
0answers
12 views

Prediction and BEPU physics

i am doing a multi player game with bepu physics hosted on server. Client use client prediction to move player. Client will send a message( contains: pressed time T, sequence number N ) to server ...
0
votes
1answer
48 views

Monogame Networking [closed]

I played around with XNA in high school, and Monogame in college. I was able to make pong, first level of mario, and 1942 from the GameMaker tutorial series - all in monogame. My question is what ...
1
vote
2answers
64 views

How should I be loading a player's content and its bullets content later in the game

I'm trying out Monogame because my course has a simple game programming class in it which is just going over basics. The final project will be using Monogame so I've been getting ahead and making my ...
0
votes
1answer
25 views

Using multiple textures in Monogame HLSL Effect shader?

My Monogame HLSL shaders only successfully sample one texture (besides the screen). Any additional textures I try to sample end up with the same texture data as the screen. I've found people with ...
0
votes
0answers
10 views

XNA Controls Rotation in Addition to Camera/Model

I'm relatively new to 3D programming and I'm trying to make a game where the player can control a character around a maze. My current problem isn't really getting the mouse to be centre and reading ...
1
vote
1answer
41 views

MonoGame / XNA Texture2D.SetData results in black texture

I use the following method to draw a box onto the screen: ...
0
votes
0answers
15 views

Issue with Monogame Skybox [duplicate]

I'm new to 3D graphics and I was following one of the RBWhitaker's tutorials on setting up a skybox for a 3D XNA game. I think it was slightly outdated. The original code was something like: ...
0
votes
0answers
30 views

Monogame Skybox Advice

so I'm pretty new to 3D graphics and I was following one of the RBWhitaker's tutorials on setting up a skybox for a 3D XNA game. I think it was slightly outdated. In my .fx file for the skybox I did ...
1
vote
0answers
28 views

Monogame Per Pixel Collision scale texture

I have a problem: I am learning the Per Pixel Collision, because I am very new to Monogame. Everything works thine, but my texture (image) is too big, so I scaled it down to 0.5f. Now it doesn't work ...
0
votes
2answers
96 views

C# Fastest way to iterate over certain tiles overlapping multiple chunks?

What's the fastest way of iterating over certain tiles overlapping multiple chunks in C#. Ideally without having to iterate over everything, just a specific set of coordinates? (green cubes example ...
2
votes
0answers
43 views

Viewport not matching Window size when fullscreen

I am using: GraphicsDevice.Viewport.Bounds to determine the size of the canvas / stage for my window. This works well if I am in Windowed mode, but if I launched ...
0
votes
2answers
59 views

TouchPanel.GetState() Returns wrong touch locations XNA

I am trying to make my Desktop game playable on IOS. I have a Button.cs class, which has this code in it: ...
1
vote
1answer
116 views

Issue importing TileMaps/TileSets in Monogame.Extended 1.0

I've just started coding my first ever videogame using Monogame/Xna. I've reached a point where I would like to start editing maps and importing them into my game using the program Tiled. After ...
0
votes
0answers
36 views

Conversion from lat-long to Cartesian coordinates 's result is different with real location

I'm trying to put building from real lat-long in my Monogame app (4 buildings in my school, please check the image with the blue circles) But after some convert method, it went terribly wrong (please ...
1
vote
1answer
71 views

Destroying a ship removes both the ship and the bullets it has fired

So I'm making a game where you fire bullets at enemy ships which are flying past you. The enemy ships are also firing at a straight line in front of them. The bullets are made into a list of another ...
0
votes
2answers
81 views

Tile slopes and jittery movement

I'm trying to handle slopes in a tiles based world. I'm using basic linear interpolation to find the Y coordinate of the character based on his X position. But i have a problem, when the character ...
0
votes
0answers
11 views

Check Collision with rounded off objects [duplicate]

Alright, I am writing my first game on C#. Let's imagine I have got two classes: HeroEntity (has an X of type float, a Y of type ...
0
votes
1answer
25 views

Camera not in sync with player

I am currently working on a game in XNA and MonoGame. This game is supposed to be a port of KidsCanCode's tutorial series of creating tile-based games in Python. Here is a link to one of the videos in ...
0
votes
0answers
35 views

I want my mouse position to change when I move my player

So I set my camera following my player but I have a problem. When my player moves, the vector changes obviously but not my mouse position. I have to calculate the mouse angles of where I shoot my ...
0
votes
1answer
59 views

How to get tile rotation from TiledSharp and convert it to XNA/MonoGame

I am currently working on a game using XNA and Tiled. I use Tiled to create my maps and load them using TiledSharp. Some of my maps have tiles that are rotated by using one or more of the left rotate, ...
1
vote
1answer
39 views

Efficient way to avoid shadow “streaks” beyond bounds of shadow map

BACKGROUND INFO: Using MonoGame. To maximize shadow resolution, I've got a shadow map that covers only the area closest to the camera. (I am aware of Cascading shadow maps, but for now, I am ...
0
votes
1answer
178 views

System.Windows.Form.Control.FromHandle returns null for current window

I was following the book "XNA 4.0 Game Development By Example" and in the eighth chapter, the author adds windows form to an XNA game. I was following the book for a MonoGame project, but I get null ...
0
votes
0answers
105 views

Why do I see blurring lines when moving a camera, and how can I fix it?

I am using Monogame and I'm rendering the terrain as tiles. I am bringing in the tiles from Tiled. When I move my camera up, I get these lines that seem to be blurring the tiles together. Please ...
1
vote
1answer
101 views

Keeping 2D camera within game bounds

I have a simple camera class which works for following my character around, and has an adjustable zoom. However, I cannot figure out how to keep the camera within the bounds of the world. As far as ...
0
votes
2answers
289 views

Monogame Drawing Text

I'm really new at XNA. I've been following some tutorials at gameprogrammingadventures.org but when it comes to conversations I don't really like how the author does it so I've been trying to ...
1
vote
1answer
270 views

How do I prevent tile tearing effects when using pixel art in XNA/MonoGame while keeping the low velocity of the player?

Most of my Texture2D are pixel art, meaning they're rather small, so my player/character's position has to change using decimal points to keep a realistic movement that matches its walking animation. ...
0
votes
2answers
156 views

How to render many tiles fast if zoomed out? (Monogame/xna)

I'm currently trying to optimize my tile engine. I used monogame with the spritebatch first, but that doesn’t works well. I have read many articles how I could optimize my rendering code. I moved ...
0
votes
0answers
37 views

Monogame - how to have draw layer while on SpriteSortMode.Texture

I have a problem in which in my game I have to use SpriteSortMode.Texture because I have a lot of objects with few textures, so I cannot afford to use SpriteSortMode.BackToFront. The thing is this ...
0
votes
2answers
58 views

Xna/Monogame How to get an object to decelerate

So I've written a statement for releasing the ball based on a certain speed and for it to move in the direction of the mouse, like so: ...
0
votes
1answer
38 views

XNA triangle grid not drawn using DrawIndexedPrimitives

I have just recently started working with Monogame (XNA). Now I had code that was drawing a grid using DrawUserIndexedPrimitives. However I read that it reloads the vertices in the GPU each draw, and ...
0
votes
1answer
129 views

Trying to get an object to move in the mouse direction XNA C#

Right, so in my Player class where I call the object I got an if statement which gets the coordinates for the mouse ...
1
vote
1answer
70 views

Questions about “minecraft” game optimisation [duplicate]

I'm currently trying to do a basic "minecraft style" game. I know how difficult it is to create a game like this, that's why I juste want to do the base of a game like this. I did a class which ...
0
votes
0answers
35 views

AI how to choose target for sumo like game

I am building a game that is the same as an old game I used to play called Sumo in fusion frenzy for Xbox. The object of the game is to knock enemy spheres off the edge and stay in the middle of a ...
0
votes
1answer
45 views

Update sprite position when speed changes if frame rate is low

I have a sprite moving horizontally from left to right. For each iteration I want to start decreasing the speed. This works ok, and the sprite will stop at some point, however depending on the frame ...
0
votes
1answer
69 views

C# XNA How to work out minimum distance to decelerate and stop at a point

I am building a game in C# using XNA. I am currently trying to get a character to always travel to the middle of the map which is located a point (0,0,0). I want the character to accelerate to the ...
2
votes
1answer
225 views

Tilemap Collision w/ different height levels and directions

I've been programming a final fantasy 6 clone in C# using Monogame and Monogame Extended, and have met on a few interesting challenges regarding tilemap collision. The game seems to have different ...
0
votes
0answers
41 views

Why pixel images so much blurred in xna? [duplicate]

I'm making a pixel game in XNA and there are some kind of problem. I made a pixel image in aseprite(or ps) but these images made with 1 pixel and when i enlarge this image in XNA it is very blurry. ...
0
votes
0answers
38 views

Using a custom made message queue to manipulate sound effects

I am currently creating a small game with Monogame and have created a custom message queue to handle all intercommunication. I am looking for some insight into a problem I have in visualizing how to ...
0
votes
1answer
103 views

C# XNA Making a TextBox Appear to input the X and Y coordinates

Okay I'm trying to find a way to not have to hard code in my values for the x and y coordinates. so far I have hard coded these in when you press certain numbers on num-pad it'll move the camera to ...
0
votes
0answers
128 views

How can i apply occlusion culling in XNA / Monogame

I try to make a mini voxel game since a while. And now i try to improove performance the best i can. After use the frustum and Octree, i want to use the [Occlusion Culling]. But unfortunatly i can't ...
0
votes
1answer
140 views

Changing the color data of an instance of a shared texture? MonoGame

I want to load multiple instances of a texture on the screen and be able to change the color of each one individually by clicking on it. I've tried many different ways and currently I'm creating two ...
3
votes
1answer
123 views

Why are .xnb files used rather than source files?

XNA and Monogame are built using a content pipeline, which takes source files (images, sound effects, 3D models, etc.) and converts them to proprietary .xnb files. What's the benefit of doing this as ...
0
votes
1answer
188 views

Is there a way to force a resolution on Android when using Monogame?

I think I looked everywhere but I couldn't find a way. My phone has a native resolution of 1920x1080 and I would like to run my game at 1280x720. I tried by changing PreferredBackBufferWidth and ...
0
votes
1answer
111 views

Monogame problem with flat shading low poly terrain

I have been dabbling in 3d rendering recently and I am having a problem with the shading on the mesh I am using. The code I am using to calculate the normals for all the triangles is as follows. <...
1
vote
0answers
59 views

XNA / Monogame Camera flickering on collision

I have my camera follow my player and it works perfectly, I had some issues with collision and managed to get it working, but now my camera follows my player when it gets pushed back so the camera ...
0
votes
2answers
67 views

Collision stickyness problem on multiple inputs

I've been trying for a couple of days to solve an issue I'm having with top-down 2D collisions, whenever I collide with tiles that have adjacent collidable tiles my player sticks to the wall, If I ...
0
votes
1answer
104 views

Performance issues when loading maps in XNA / Monogame

I'm new to Monogame and I'm having some perfomance issues, I'm loading a matrix of 9 maps (3x3) each with 50x50 tiles of 32x32 pixels each. I store that in a list of maps from 0 to 8 and call them by ...
0
votes
1answer
186 views

How can I store and read dialogue?

How can I store dialogue so that it could be read for a kinetic (linear) Visual Novel type of game in XNA/MonoGame? I'm currently using a .txt file, but I noticed that I can't read from a specific ...
0
votes
1answer
65 views

2D Game : How do I draw my entities (player, etc.) by their Y position?

I am using C# with MonoGame 3.6 A picture of what I mean: http://i.imgur.com/S3i5iB0.png You see, the little black box is drawn over the red box, because it is drawn before the red box gets drawn. ...