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

Questions tagged [xna]

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

1
vote
2answers
124 views

How to make a Blend-Effect like yomawari did?

I would like to know, how to make that effect, I have seen in the game named Yomawari. The little girl has a lamp and its cone revals the dark spirits around her. But only if they are in the light. I ...
0
votes
1answer
44 views

Texture Atlas and HLSL Shader for sprite tiling

I am trying to create a shader that allows to tile a specific region of a texture. This seem to be a common need however I can't seem to find any information about how to get this effect done. The ...
0
votes
1answer
21 views

HLSL Manual Alpha Blending

I'm trying to do alpha blending manually because I only want to apply alpha blending on certain pixels. Underlying is the texture I'm writing to. This is what I got so far, but it doesn't give the ...
0
votes
1answer
64 views

Most efficient way to remove a Rectangle ? Monogame/XNA

I have a project in which I'm trying to remove the "collision box" (Rectangle class) of one of my enemy. My game logic basically is: ...
0
votes
1answer
41 views

Element's texture is null - Monogame/XNA, C#

I have a ArgumentNullException everytime I try to call the Draw() method of my Projectile class in the Game1.Draw() method. In Game1.cs Initialize() method: ...
0
votes
0answers
53 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
17 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 ...
1
vote
2answers
72 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
33 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 ...
1
vote
1answer
57 views

MonoGame / XNA Texture2D.SetData results in black texture

I use the following method to draw a box onto the screen: ...
1
vote
0answers
30 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
110 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
49 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
89 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
209 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
72 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
82 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
76 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
40 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
228 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
107 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
126 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
367 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
293 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
189 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
50 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
63 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
42 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
163 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
72 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
37 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
46 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
70 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
254 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
42 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
1answer
110 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
1answer
170 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
135 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
219 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
116 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
61 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
72 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
110 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
211 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
67 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. ...
1
vote
1answer
110 views

How can I calculate respective 2D world/mouse position through different resolutions?

I have been at this game of trial-and-error for days now. I cannot find a consistent method to calculate the respective mouse position in my game world after the calculations are done to stretch the ...