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
2answers
931 views

How do I create my own GPU accelerated graphics API in C#?

I am creating 2D game engine in C# and I need some graphic API, so that user can draw sprites or convex vector shapes. I tried to use GDI+ for it. But I discovered that GDI+ is not GPU accelerated and ...
1
vote
2answers
441 views

Efficient way to render tilemap

I have set up a tilemap system, and am rendering it in a way that lets me pan through the map using a camera offset. However, I have discovered it is incredibly inefficient, but am unsure of how I ...
0
votes
1answer
124 views

ball reflection angles Xna c#

I'm trying to find a way to handle reflections for a breakout clone. I would upload an image to the post instead of the following paragraph, however i have not yet gained the privilege of that yet. ...
0
votes
1answer
76 views

Monogame Dragging 3D object edges

I am having trouble rendering 3D models with monogame. The problem only occurs when I export the object from blender with two materials on it. Example: Monogame sees those two different materials ...
1
vote
0answers
90 views

sprite jitter when max acceleration reached at camera

Camera seems making sprite jitter when max acceleration is reached : Thats my camera code : ...
-1
votes
1answer
175 views

XNA draw a rectangle 3D perpendicular to camera

I need some ideas how to implement the Draw method. Need to draw a rectangle (actually a million of them, all same texture) that is in 3D, starts at point ...
1
vote
3answers
208 views

Collision Detection works 2 sides

This might be really simple but it is giving me a lot grief and I wondered if you guys would be able to shed some light on it. Basically I have a tile map which draws tiles at 64 * 64 and that works ...
0
votes
1answer
113 views

tile map collision with player not working - 2D c# xna

Currently the tile map is drawing fine but I am not sure how to proceed with collisions between the player and some of the tiles. Would it be better to specify certain tiles that the player can't move ...
0
votes
2answers
176 views

Collision code is creating allocations on heap every frame

I've been profiling my app trying to reduce allocations and garbage collection during gameplay. The following code is SAT collision which i use for hill/ramp collisions, when the player is standing ...
2
votes
1answer
524 views

Rotating a sprite around its center

I also use Farseer Physics and Artemis ECS. Here is RenderingSystem Process method: ...
2
votes
2answers
90 views

Skip processing individual triangles or vertices of the mesh

In my game I have a billiard table, and a floor below the table. In typical situation the table covers 80% of the screen, so only small amount of the floor is visible. And I render the table first, so ...
3
votes
1answer
233 views

C# XNA colliders, physics, inclined plane/terrain/colliders

Currently I'm working on a project to learn game programming. But I'm not sure if I have the right approach on several things, and that's what I'm here for. What I'm trying to create is a small world ...
0
votes
0answers
136 views

monogame - how do I distribute a lib / package with content?

I wrote a UI lib for a monogame hobby project I'm working on, and I want to distribute the UI code / lib as open source for others to enjoy. My question is - what do I do with all the content that ...
0
votes
1answer
123 views

Error loading “SpriteFont1”. File not found

I have an issue while trying to load a font file with the extension ".xnb" and I am receiving following error: Error loading "SpriteFont1". File not found. For ...
0
votes
1answer
130 views

What are the practical limitations of using XNA?

Since development on XNA has long since stopped, it is unlikely that it will ever be updated to be in line with modern graphics technology, however aside from the obvious fact that it's Windows-only - ...
0
votes
1answer
611 views

Xna c# picking model with Ray mouse cursor select the wrong model

i made a small 3D game and i just try to apply a basic sample from here : http://rbwhitaker.wikidot.com/picking for picking model by the mouse cursor. For that i use the Ray object and check if some ...
0
votes
1answer
268 views

Generate a random number of enemies to appear on screen

I am currently trying to create 2d shmups. I am trying to: Generate a random number of enemies to appear on screen Whatever number is generated will then be added to my List (the list is used to ...
1
vote
2answers
183 views

Drawing & transforming matrices upwards

I'm drawing a hierarchy of 3D objects in C# XNA where each objects has a transform that holds position, rotation and scale. I get my expected results If I draw my objects from my root node in this ...
1
vote
1answer
334 views

DirectXTK C++ : How do you use the Spritebatch.Draw() function with overloaded for RECT?

I am trying to make use of the DirectXTK's SpriteBatch for the C++ version on github. Which is heavily based on the one for XNA. However I can't seem to get the darned thing to work properly. I have ...
0
votes
1answer
49 views

Change color of a texture in a specific matrix location

I have following bool matrix: bool[,] centerPiece = new bool[,] { { false, true, false }, { true, true, true }, { false, true, false } }; Using a method, I put a ...
0
votes
2answers
51 views

Setting up a draw class giving exceptions

I'm currently trying to set up a class to draw tiles for me in different shapes, but it's currently giving me a hard time, as it's giving me nullreferenceobject errors in my secondary class. My Game ...
0
votes
1answer
52 views

Placing sprites properly to form an object

I'm working with XNA in Visual Studio, and I'm trying to draw this sprite: https://i.imgur.com/Dy5nSuG.png Only using this sprite: https://i.imgur.com/6T8TeTQ.png My current attempt relies on a ...
3
votes
1answer
675 views

XNA / MonoGame - render transparent background using stencil buffer problem (3d)

I'm trying to render 3d texture quads with the following properties: With lighting (rule out "AlphaTestEffect"). Transparent background (no opacity levels, just binary opaque or transparent). No ...
0
votes
1answer
261 views

What is more performance friendly?

I'm wondering what is more performance friendly: 1) Rendering a texture (in a seperate RenderTarget2D) and reuse it. (That will use multiple spriteBatch.End() / <...
2
votes
1answer
249 views

Using a single square sprite to create tetris-like objects

I'm currently working on a project in XNA, Visual Studio, where it is crucial I can create the classic tetris figures solely based on one square sprite (So I can return to each individual square at a ...
0
votes
1answer
36 views

how are the vertex properties of meshpart decided based on model format in xna

Exactly how the question says , how does the vertex properties like vertex stride and the data stored in the mesh part decided based on the format of a model and how would i determine that and then ...
2
votes
1answer
923 views

Find the closest point on a ray

I've got a ray defined by P1 and P2, and then a target P3, and I want to find P4. How do I go about this? I've come to understand that I should use vector projection, but I can't get it to work. Any ...
0
votes
1answer
82 views

Roll a 6DOF camera to a plane direction

I've been working on a 6DOF camera that I want to be able to "align" to any walls orientation to make it feel like I'm standing on that wall. I'm thinking it's a simple matter of finding the right ...
0
votes
2answers
101 views

Correct velocity on collision between two rects

I have two moving objects. The objects consist of a velocity vector2, a Rectangle and a ...
1
vote
1answer
68 views

XNA player/tile collision not working perfectly

So I've built a map tile engine in XNA, and have been working on the player/tile collision. The method I'm using works well to some extent, but the player will often move through the walls and get ...
0
votes
1answer
100 views

XNA - 2D camera orbit around sprite

OK, I have a 2d sprite in a scene and I would like to know the theory behind the camera orbiting around it with an analog stick. I know the basic code to get the input from the gamepad, but I'm having ...
1
vote
2answers
170 views

How Should I Go About Updating My XNA Game?

So, I've created an XNA game, but I'm not selling it... it's just a private game to give away to my friends, more of a practice project. But say I find a bug, or think of a new feature... I don't ...
0
votes
1answer
74 views

only one tile being drawn xna c#

I have been looking at tile engines for the past few days and decided to have a go at my own one for educational purposes. I want to use different textures for the tiles of my map, for example 1 = ...
1
vote
2answers
944 views

How to use Monogame Content Pipeline with XML

I have an XML file that I'm trying to import into my MonoGame project using the content pipeline. I'm having trouble getting the MonoGame Pipeline tool to convert the XML file into a .xnb file before ...
1
vote
0answers
81 views

My Character objects are complex, how should I organize their structure?

I'm using Monogame to make a fighter. I have created an abstract Character class that has basic character functionality such as HP, meter, update boilerplate and such, and will be overridden as each ...
1
vote
1answer
576 views

Why does RenderTarget2D only output a black texture after a few seconds?

I encountered this strange problem where my UI drawing to RenderTarget2D works for a couple seconds and then suddenly goes black. This is the RenderTarget2D ...
0
votes
2answers
618 views

Jitter Physics not working correctly. Going through objects and getting pushed back when touching walls

I am trying to use the Jitter physics engine, however, I can't get it to work correctly. For example, when I touch the side of a cube, it pushes me far back in the opposite direction. While I am ...
1
vote
0answers
68 views

1.5d Engine need pointers [closed]

So I'm gonna start on a new project and were surfing around google images and found this image. Basically its almost pure 2D where there is no 3d object and everything is represented in 2d images as ...
0
votes
1answer
669 views

Planar mapping/projecting UV coordinates from normal

I've got set of vertices, and would like to calculate their UV coordinates by projecting them by a given normal. Similar to what "planar mapping" does in 3ds max. Another way of looking at it is ...
-1
votes
2answers
187 views

Collision Detection XNA Using Vector2

How would I convert this into C#? This is for a pong game and I am having a difficult time understanding. This is detecting the collision between a ball and a paddle. Can you comment please to help me ...
1
vote
1answer
482 views

Anti-Aliasing Issues in MonoGame

My anti-aliasing is not working in MonoGame. I'm not sure if I'm doing something wrong. See the image below (rotating the screen -- coordinates are all overlapping/adjacent, so should blend them): ...
0
votes
1answer
100 views

XNA - Isometric View not rendering mesh correctly

New to XNA (3D) -- familiar with OpenGL (but it has been a few years). I've been working on an engine that should be a 3D Isometric View, but I'm having issues with things rendering. I wouldn't be ...
3
votes
1answer
536 views

How to do multi-agent 2d pathfinding when agents can block each other?

I recently restarted on my long time game development project and had a few questions about how to improve my games AI. I am a little stuck on the best way to implement my Enemy path finding when ...
0
votes
1answer
163 views

Migrating from OpenGL to XNA (MonoGame)?

I just started working in MonoGame with 3D code. I've used OpenGL before in the past, and I've also built engines with 2D Sprites/SpriteBatch's in MonoGame. However, I'm getting extremely stumped ...
4
votes
2answers
2k views

Switch axes and handedness of a quaternion?

I have a quaternion, coming from a system with the following:(intertial sensor) ...
3
votes
1answer
464 views

Is it possible to have a diagonal movement animation in monogame/xna?

Is it possible to have a diagonal movement animation in monogame/xna? As far as I can tell it's not possible to recognise multiple keypresses (ie "A && W" or "S && D") as unique ...
1
vote
0answers
31 views

Defining collision rules in Farseer XNA

I'm trying to integrate Farseer into my XNA game. Since I'm using an EntityComponentSystem approach, I've added the Body inside a component and added it to the players' components. One thing I'm ...
1
vote
1answer
87 views

Converting an XNA game from WINDOWS to XBOX

I have an XNA game for WINDOWS which I want to work on XBOX also. I've designed the game so that when I want to connect it to an XBOX, all I have to do is supply a different input class, And I would ...
1
vote
1answer
851 views

How to unit test XNA Game object

I'm doing a hobby game project using Visual Studio 2015 and XNA, via the MonoGame implementation. I wanted to do some unit testing, as I recently discovered this feature in Visual Studio, and want to ...
0
votes
2answers
3k views

Tile Map Collision in 2D Platformer (C# Monogame)

I am trying my hand at making a small 2D platformer. Currently I am trying to implement collision on a tile map. I have been trying to experiment with different ideas but can not find a way for the ...