Questions tagged [xna]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
549 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
437 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
2answers
112 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
93 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
499 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
94 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
1answer
54 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
170 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
419 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
1answer
156 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
362 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
230 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
2answers
372 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
177 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
83 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
86 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
151 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
310 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
92 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
116 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 ...
2
votes
1answer
63 views

Model disappears when viewing from up vector

I'm sure there is a simple explanation for this behavior that makes mathematical good sense, but I need a way to look at my model along the up vector. I have tested it with the three unit vectors to ...
0
votes
1answer
290 views

2D Platformer Collision Detection Issues - XNA

I am developing a basic 2D platformer game to learn the basics of making a game engine and XNA. I have a CollisionHandler class that deals with AABB collisions between the player and the tiles of the ...
3
votes
0answers
115 views

Monogame resizing GraphicsDeviceControl in WindowsForms?

I'm currently working on a custom Map editor using Windows Forms. I have a class inheriting from GraphicsDeviceControl (called MapDisplay) that I'm using so that I may use spritebatch to draw the ...
1
vote
1answer
416 views

Is there any way to make xTile work with MonoGame?

I am currently in the process of planning and developing a game. I use MonoGame as my framework, and I also planned to use xTile with tIDE (https://tide.codeplex.com/) to manage my tiles, but it >only&...
2
votes
2answers
55 views

How to iterate through members of lists of members of lists within members of previous lists?

I'm sorry for the clumsy title, and for what will be the continuation of further clumsiness in my question - I'm not even sure how to properly ask this, so please allow me to illustrate: I'm writing ...
0
votes
1answer
248 views

Sprite masking with multiple, non-equally dimensioned textures in XNA

I know this question's been asked many times before, but I can't seem to get sprite masking to work in XNA/Monogame no matter if I try the stencil method, or the shader method. Considering I'm having ...
0
votes
1answer
70 views

How do I make bullets in a list intersect with bullets from another list, when both lists are not in the same class?

I have the initial "Game1" class, with a "Ship" class initiated inside, and within the "Ship" class there's a List, where the "Bullet" class is used. How can I make a bullet in a list from one of the ...
0
votes
1answer
263 views

How do I offset a TouchPanel input in Monogame

I am creating my first 2D game in monogame. I have used RenderTarget2D to maintain a 4:3 aspect ratio. If it is played in a window of any other ratio it will offset the RenderTarget2D position to ...
1
vote
1answer
81 views

2D stop on collision

So, this is the code I have right now: ...
0
votes
1answer
162 views

How to convert Texture2DContent to Texture2D in custom ContentTypeReader

I'm trying to implement a custom ContentPipeline extension that writes a Surface object with a Texture2D member. My input file is an xml with fields for all of my Surfaces and their members. In the ...
2
votes
1answer
235 views

Keyboard input not working for me in derived class

My code is unable to accept keyboard inputs in a specific class. I know that I have used inheritance for that class, but I'm pretty sure that it is not the main reason why it doesn't work. Can you ...
0
votes
1answer
88 views

How can I get the position of a fixture in Farseer Physics 3.5?

I created a body(rectangle). After that, I attached a circle shape to the body. I need the position(world coodinates) of the circle shape because I want to draw a circle sprite(Texture2D) on that ...
3
votes
0answers
214 views

How to serialize an XNA Rectangle

I'm serializing a data structure to XML using the IntermediateSerializer class. This data structure has an XNA Rectangle in it. ...
1
vote
1answer
96 views

GraphicsAdapter.Adapters on openGL won`t return secondary monitor

I have been searching for this everywhere and never found the answer. I am developing a feature to allow the user to select which monitor to run the game. I have two monitors, primary and secondary. ...
1
vote
0answers
34 views

Models overlapping in XNA 3.0

I have to use XNA 3.0 for a class at school, and every solution to this problem I've found only works in XNA 4. I am rendering several 3D models, and the one that's drawn last is always on top. How do ...
5
votes
1answer
5k views

How to change screen resolution in XNA?

I'm making a 2D game in XNA/Monogame and I'm using Stardew Valley as a visual template (it's got the SNES style I'm going for). I'm having trouble mimicking the feature to change screen resolution ...
1
vote
1answer
426 views

Why do XNA/Monogame models create new BasicEffect instances?

My question is fairly straightforward, I think. Using Monogame, when I load a model using contentManager.Load<Model>("Model"), the model's mesh has a ...
0
votes
1answer
254 views

Sprite rotating to look towards mouse

I am trying to figure out how to calculate the angle to rotate a sprite in z axis to look towards the mouse. I declared one index -and vertexbuffer and set following vertices in it: ...
1
vote
1answer
295 views

Monogame/XNA Hardware Instancing problem

Here's a youtube video of my problem. https://youtu.be/1zB4q9_sNQI Look at how the hideous cube kinda slides into the terrain and rotates weirdly with the world and from above its vanished into the ...
0
votes
1answer
130 views

Send large amount of vertices to graphics card

I am programming at the moment a minecraft clone. The advantage of this clone is that the whole world is handled as a model. That means: The whole world is represented by 2d flat tiles and is ...
0
votes
1answer
274 views

TileMap collision detection

I'm currently working on a project in XNA and I'm trying to implement collision detection but can't wrap my head around how exactly i'm going to do it. I'm using the Tiled application to create my ...
1
vote
1answer
697 views

How do you create an over world styled like Pokémon Black and White, with both 2D and 3D elements?

The over world of Pokémon white uses 3D models for objects like houses, and 2D sprites for characters like the player. What would I have to do to create an over world styled like this? Here is an ...
1
vote
1answer
221 views

How does XNA/MonoGame project 3d to 2d?

I am trying to figure out how XNA is actually projecting a 3d world space coordinate to screen space. I decompiled the MonoGame framework and copied the CreateLookAt und CreatePerspectiveFieldOfView ...
0
votes
1answer
81 views

Why is my sprite leaving copies as it moves in Monogame?

I am pretty new to Monogame, and I'm trying to draw a character sprite and move it using keyboard. Instead of moving to different positions, it leaves a track of copies along the way. I have 2 game ...
0
votes
1answer
40 views

ArgumentNullException from SpriteBatch.Draw trying to get a Texture2D from a jagged array

first time on here. So I'm trying to make a tile based game in Monogame using some 2D arrays and spriteBatch.draw absolutely refuses to retrieve a Texture2D from an array, or something else is wrong ...
8
votes
2answers
2k views

Drawing huge amount of tiles in Monogame (XNA) efficiently

I'm asking this question because I haven't found a definitive answer to it. Let me first of all state a few things about the game and what I have already done. The game is a going to be a RTS set in ...
0
votes
1answer
51 views

Sprites With Vastly Disparate Scales

So, I'm developing a 2D game where I'm dealing with sprites with vastly different scales. I'm attempting to represent the scales accurately, where I have a 10-m wingspan fighter and a 1400-m carrier ...
1
vote
1answer
1k views

Position vs Destination Rectangle

I'm new to programming, and I finally delved into XNA/MonoGame for wanting to practice coding game logic. I'd like to know what the difference is between a Position (Vector2) and a Destination ...
1
vote
0answers
680 views

Monogame Orthographic Isometric camera

Some time ago decided to make an "2,5d" isometric strategy game. I decided ill go with a 3d engine with a locked orthographic camera for the benefit of easier collision detection, easier depth sorting ...
1
vote
0answers
83 views

Pixel-perfect collision appear to have random behaviour

So I was sitting with my programming teacher with this issue for about two hours and we couldn't figure out anything specific that could possibly be the issue. Therefore I'm taking some measures and I'...