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
0
votes
1answer
127 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, ...
0
votes
2answers
261 views

Why is my collision code blocking the player's movement in XNA?

I have the following code to check for collisions in my game, but this code doesn't work it as should. For example: I go from up to down and if collision is detect I can't turn right; if I go from ...
0
votes
0answers
10 views

Monogame/XNA - How do you resize a Texture2D and then scale it?

Problem: It seems like the Draw() call allows us to use either Destination Rectangle for resizing (5of8) or Scale (6of8/7of8) but not both. Purpose: I would like to resize a button from 567x634 to ...
0
votes
1answer
339 views

XNA/Winforms - Nothing being drawn after calling SetRenderTarget(null)

I'm creating a basic scene/level editor using XNA/Winforms using the base classes from http://xbox.create.msdn.com/en-US/education/catalog/sample/winforms_series_1 Everything works fine and gets drawn ...
1
vote
2answers
293 views

Rotating sprite 180 deg

I should say first, that I have the rotation down. Its just that I want my square to rotate exactly 180 degrees. Currently, it will rotate but it will rotate but by less each jump. So after several ...
0
votes
2answers
85 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 ...
2
votes
4answers
5k views

Fastest way to get all adjacent tiles?

What is the fastest way to get all adjacent tiles in a two-dimensional array of tiles, converted into a single-dimensional array? If you don't know the answer, then the fastest way to do it in a two-...
0
votes
0answers
24 views

How do I change a specific set of spawned buttons from gray to green?

I'm a self-taught programmer. I have a button class runs like this: ...
2
votes
1answer
63 views

MonoGame game running slowly

Through development I've been running my 2D game (Monogame 3.6) on my windows laptop, which has some crummy integrated graphics card and an i5. Now I try my game on my gaming PC, which has a GTX 970 ...
2
votes
1answer
147 views

Should I store ads in the background or recreate them every time I need them?

I am developing an XNA game for Windows Phone 7 and 8. The game is level-based. After finishing each level a screen comes up with a bit of stats summary. I wish to embed an ad in this screen, on which ...
1
vote
2answers
3k views

What is the status of Monogame now that XNA has been discontinued? [closed]

XNA has officially been discontinued, with support no longer being offered by Microsoft. Does this mean that Monogame has died also? I see that the site still says it is based upon XNA 4. What is the ...
0
votes
2answers
94 views

How would you go about placing objects between chunks in a 2D game?

I have a 2D infinitely generated world which is split up into 9 chunks at a time. Three chunks are loaded and three are unloaded whenever a player moves into a new chunk (if the player moves up a ...
0
votes
1answer
39 views

How to check if a custom Control is focused?

So I am building custom UI for my MonoGame project. I've gotten pretty far already, having created Controls such as: Button Panel TextBox Form ComboBox CheckBox etc. All of these controls obviously ...
1
vote
1answer
98 views

How to add a animation to myPlayer

I'm currently making a shoot em up in monogame. I want to add just one animation to my object. No commands or transitions between animations for different actions: just an object swapping between ...
67
votes
7answers
6k views

What are typical pitfalls when writing games with a managed Language like C#? [closed]

What pitfalls did you encounter when writing games for the PC with a managed Language like C# and how did you solve them?
0
votes
1answer
118 views

How can I do a Metroid like transition between two tilemaps with Monogame Extended?

I want to do a transition like those in the Metroid games. Here is an example of what i mean: https://www.youtube.com/watch?v=RKJ3MAi0ZI0. You enter the door, the screen fades to black and the camera ...
0
votes
1answer
82 views

Draw a texture2D at specific coordinates on another Texture2D

I have a ShipTexture and a Sail Texture. I need to draw the sail texture at a specific location on the shipTexture (call it the sailMountPoint) regardless of the location vector associated with the ...
0
votes
1answer
82 views

XNA 4.0 How to combine triangles vertices 3D

Preview for the problem: I'm making a similar game to Minecraft (a game that it's world is made by cubes), but the fps of the game is getting low only by rendering a little amount of cubes in the ...
3
votes
1answer
1k views

XNA Webcam video

How can I embed a video in a XNA application? I'm developing a card game with XNA C# and I need to send webcam video between four machines. Could anyone give me some tips about that?
7
votes
3answers
838 views

XNA Content Pipeline With Map Creation Utility

I've been looking into how to use the XNA Content pipeline appropriately for a game I am working on. I have however been having a hard time wrapping my head around it and am not sure on the best way ...
6
votes
2answers
8k views

How to get mouse position relative to the map?

I'm creating a game in XNA similar to Minecraft - Minecraft 2D It looks like this Here's how it works: All blocks are generated once with fixed x,y coordinates and just re-drawn. ...
0
votes
2answers
245 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: ...
30
votes
5answers
6k views

Simulating pressure in a grid based liquid simulation

I have a 2D grid based water system in my XNA game, we have a method using cellular automata to simulate water falling and spreading. Example of water flowing down a slope: Each tile can contain a ...
83
votes
6answers
34k views

What is the future of XNA in Windows 8 or how will managed games be developed in Windows 8? [closed]

I know this is a potential dupe of this question, but the last answer there was 18 months ago and a lot has happened since. There seems to be some uncertainty about XNA in Windows 8. Specifically, ...
2
votes
1answer
1k views

Drawing Shape in DebugView

As the title says, I need to draw a shape/polygon in Farseer using debugview. I have this piece of code which converts a Texture to polygon: ...
2
votes
1answer
733 views

Odd offset bug in Farseer/XNA/C#

So I'm using Farseer to create an immovable object: ...
0
votes
1answer
701 views

Messed-up triangles when using VertexPositionColorTexture with BasicEffect

Image of the problem: I used Microsoft's BasicEffect tutorial here and the code sample here and got everything to work fine. Next, I changed everything to use vertexPositionNormalTexture, added a few ...
1
vote
1answer
669 views

Problems with 3D rotation when creating a 3D skeleton

I am writing a simple BVH parser in C# using the XNA framework. At the moment I have managed to parse in all the data and my goal is to find out the global coordinates of all the joints in the ...
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 ...
0
votes
2answers
471 views

Calculate ticks for animation delay

Hi guys I am trying to calculate the correct elapsedTime for each frame in my animation. Example I have a sprite called stance that has 20 frames I want to give each frame a tick delay property that ...
3
votes
1answer
939 views

3d Wall sliding collision

I'm working on collision for walls in my game and the way I currently have it I get stuck walking into a wall. I'm trying to make my character slide on the walls but still collide. My character moves ...
5
votes
2answers
417 views

Collision detection problem in XNA4/Monogame

I have been trying to get 3D collision detection working for a while and I think (hope) you people can help me. For my project I have created a 'sprite3d' kinda class which is called ...
3
votes
2answers
3k views

How do I import my first sprites?

Continuing from this question (new question - now unrelated) So I have a thorough background in programming already (algorithms, math, logic, graphing problems, etc.) however I've never attempted to ...
5
votes
1answer
3k views

What is the difference between a Viewport and a Scissor Rectangle?

In XNA, what is the difference between a Viewport and a Scissor Rectangle, and when should I use each one? It looks like viewport clipping is applied to the geometry before the rasterization state, ...
1
vote
1answer
313 views

Volume raycaster problems HLSL

I can't seem to get my volume raycaster to work properly. I've been poking around changing things for days trying to get it to display my volume correctly but I seem only to get distorted mutations of ...
-1
votes
1answer
292 views

XNA 2D vehicle wall collisions

I am attempting to implement collisions for my truck game, where the truck can drive around the world and hit walls surrounding the level and various randomly placed walls within the level. I am able ...
0
votes
2answers
814 views

How to draw the elements that are in a Texture2D list in XNA

I have a Texture2D list called blockTexture that has 2 elements in it. I use the following line to draw the first element. ...
7
votes
1answer
641 views

Understanding how texCUBE works and writing cubemaps properly into a cube rendertarget

My goal is to create accurate reflections, sampled from a dynamic cubemap, for specific 3d objects (mostly lights) in XNA 4.0. To sample the cubemap I compute the 3d reflection vector in a classic ...
12
votes
6answers
5k views

Ball Physics : Smoothing the final bounces as the ball comes to rest

I've come against another issue in my little bouncing ball game. My ball is bouncing around fine except for the last moments when it is about to come to rest. The movement of the ball is smooth for ...
6
votes
1answer
230 views

Lidgren not starting server properly

I have a server set up for my game with Lidgren, and it works well when I have it set up on one machine, but if I try to run the server on another machine, I am unable to connect from other machines. ...
0
votes
2answers
822 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 ...
3
votes
1answer
226 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
2answers
394 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 ...
1
vote
2answers
106 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 ...
5
votes
1answer
145 views

transfer 3d model processing from Xna to Android?

I developed an XNA scenario in a desktop application and I need to make the same scenario in an Android app so I need to process data on the desktop computer and just display it in Android app using ...
7
votes
1answer
2k views

Character bouncing off ground due to gravity

Implementing gravity in the game, the character keeps bouncing up and down slightly when he hits the ground, upon debugging the character is essentially bouncing on and off the ground. Not quite sure ...
6
votes
2answers
821 views

A big light with shadows

To have better texture2D quality in my 2D game, I had to recreate every textures with 300% of their original size. But the lights have to bright 3 times more. For lights, I'm using this : Catalin's ...
1
vote
1answer
115 views

Monogame - Collision not working and invisible walls

I have recently been experimenting with Monogame and XNA (moving from Gamemaker) and decided to work on a simple collision system. Problem is shown in the GIF. Main Collision Each entity (Quick name ...
0
votes
1answer
645 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 ...