XNA is a game framework by Microsoft that allows deployment for Xbox Live Indie Games as well as Windows Phone 7.

learn more… | top users | synonyms

0
votes
1answer
186 views

What is the value of gameTime.ElapsedGameTime.TotalSeconds?

I was wondering what is exactly the value of gameTime.ElapsedGameTime.TotalSeconds in a second? Please explain it to me completely and as great as you can.
1
vote
3answers
314 views

In a semi-infinite procedural (chunk based) map, how do you handle objects larger than a single chunk?

I'll use an example to try and be more specific. Assume this is for a 2D top-down game. Chunks in this are made up of 32x32 tiles. If procedural buildings were to be generated based on some kind of ...
2
votes
2answers
211 views

Is the GraphicsDevice.Clear call in XNA necessary in 3D?

It's a touch embarrassing to ask I think, but I've just never paid it any attention before and used it as I've seen in tutorials or the like in the past I believe. Is there a need to use ...
2
votes
2answers
295 views

How can I measure the velocity of a drag gesture?

I want to measure the velocity of a drag(FreeDrag, VerticalDrag, HorizontalDrag) gesture on my Windows Phone. For example, if the measured velocity of a drag is 40 km/h, the player will shoot a bullet ...
0
votes
1answer
157 views

How to rotate model, around its own center?

I have a 3d Model that it wasn't made from the origin of the 3d program, lets say that it was built at (100, 100, 100), I know how to rotate a model, but around the model origin point, (0, 0, 0), now ...
0
votes
1answer
321 views

Was my horizontal drag performed from left to right or from right to left?

I want to determine if a horizontal drag was performed from left to right or from right to left. In addition, I want to do the same with the vertical drag. How can I do that? How can I check if the ...
0
votes
0answers
133 views

Encapsulating variable elements into one drawable object - XNA/MVVM

Ok so I'm building a game and there is a class for an Object which gets the Values of a specific card from a XML Table and stores them in varibles. Note: I will have many "Card"'s instantiated at any ...
3
votes
1answer
144 views

Cant get a Farseer Physics body’s rotation to follow the mouse

Here is what’s in my HandleKeyboard() method that is called from the Game1 Update method. MouseState mState = Mouse.GetState(); // the Vector2 that will hold the angle from the player ...
1
vote
0answers
189 views

Xna GraphicsDevice.IsFullScreen causes strange resolution stretching artifacts

Sorry for the non-descriptive title. So I've been trying to implement fullscreen mode into my xna-game, and I've hit a couple of roadblocks. My basic code setup for this functionality is the ...
2
votes
1answer
207 views

What can I safely do with the MonoGame GraphicsDevice on multiple threads?

I'm working on a UI system that does it's processing on a separate thread. However, the results of this processing must end up on the GPU eventually. A simplified overview of the system boils down to ...
0
votes
1answer
73 views

Implementing a Random Picker by Supplying an Outcome Table (Similar to a Drop Table)

Whilst trying to vary the draw color of some randomly positioned sprites, I really wanted to be able to just supple a table with 2 columns (colour and chance of picking) to some helper function that ...
1
vote
2answers
101 views

Where does the Game class come from in the DrawableGameComponent constructor?

I'm making a project to Windows Phone using Silverlight + XNA, but I don't know how I can use the DrawableGameComponent because the constructor requires a Game class, it looks like this: Planet.cs ...
0
votes
0answers
49 views

Spritefonts gets very messed up when scaling up

I'm recoding a retro video game, but because the original resolution is very low, I scale everything up. I render to a renderTarget and render the renderTarget to the target resolution. I'm using my ...
-1
votes
0answers
51 views

Draw object to screen without being affected by rotation / zooming [duplicate]

I have a 2D game, with a camera that follows the main player. In the game the camera may also rotate the view around the player / zoom in or out on the player. Let's say I want to add a mini-map to ...
0
votes
2answers
202 views

Keep Mini map static after rotating / zooming with camera

Hi I am making a 2D game, where the Camera is able to rotate / zoom in or out on the camera focus (the player usually). However my game also contains a mini-map, and so far whenever I have to rotate ...
0
votes
0answers
12 views

How can I move an object with the Windows Phone accelerometer? [duplicate]

I want to move an object with the Windows Phone accelerometer. If the Windows Phone device is getting tilt to the right, the object should move 50 pixel to the right. The same with the other three ...
1
vote
1answer
211 views

How can I control an object with tilt gestures?

I want an object (for example a ball) to move right when I tilt my Windows Phone device to the right. The same with the directions left, up and down. If the Windows Phone device isn't getting tilt in ...
0
votes
0answers
103 views

Bounding box not right rotation XNA blender object (.fbx)

I am importing .fbx models (a simple cuboid), the model itself displays fine (and is repeated to make a wall) however the bounding box seems to be on the wrong rotation. Below is a screen shoot: ...
1
vote
1answer
65 views

How can I measure the velocity of a Farseer body?

I want to know how fast my body(a circle) is moving. How can I do that? How can I measure the velocity of a body? In addition, I want to limit the velocity of a body. For example, I want that a body ...
3
votes
1answer
373 views

Spritebatch Vertex shader world matrix change after each draw

I have a spritebatch where I draw some textures transformed in 3d space. The easy way was just Begin with the transformation matrix, draw, and end it right after. But that is silly, so I'm trying ...
0
votes
1answer
165 views

Why is XmlSerializer adding junk to the end of my file?

I'm making a game and I am serializing the save game data. The data is simply a few lists of bools, ints and floats. But about 50% of the time I get an error when the data tries to save or load that ...
0
votes
1answer
78 views

XNA Float values don't work as parameter

With the Microsoft XNA Framework I can change the color of a tinted texture by changing it's integer values like so: Int x = 255; if(true) { x--; tint = new Color(x, 255, 255); } Draw(texture, ...
2
votes
1answer
141 views

How can I apply an effect to a sound to simulate hearing it underwater?

I'm using XNA 4.0 and trying to reproduce an "underwater effect" for every sound played. How can I apply an effect to a sound, and what effect should I use to make it sound like as if the player is ...
0
votes
1answer
108 views

Ship Controls modeling Real life Physics

I am working on a 2D ship that will fly around in space (for now, no friction or gravity). The controls are similar to the game Asteroids. My problem is that I am having trouble connecting some ...
0
votes
1answer
81 views

How can I move an object diagonally on Windows Phone?

I want to pull a sprite from point A(vector2) to point B(vector2) in my Windows Phone XNA game. GestureType.HorizontalDrag moves it horizontally and GestureType.VerticalDrag moves it vertically, how ...
1
vote
1answer
89 views

Masking away part of image with mesh

I need to remove a section of an image using a 2D mesh. Since the image is destructible (artillery game style), it would be helpful to shrink the image in memory afterward. The portion in the blue ...
1
vote
0answers
102 views

SpriteFont not found in Nuclex Framework

I am using MonoGame to port my XNA Windows Phone app to iPhone. All is well except that my fonts look distorted/smudged on the iPhone. Turns out this is due to the way that MonoGame builds the ...
0
votes
1answer
110 views

AABB SAT code detects collision wrongly [closed]

I've been having trouble getting my SAT code working using AABBs, and I've been trying to find a solution but, I'm scratching my head. For some reason, it detects collisions very wrongly, as shown by ...
1
vote
1answer
241 views

Lighting Covering Up Sky ( XNA / C# )

I have a 2D tile-based lighting system which is drawn onto a Render Target. I am also drawing a background which involves mountains, sun/moon, and clouds. There is also the unlit game; blocks, ...
1
vote
2answers
443 views

Get current window position with Monogame

I'm looking for some help figuring out the current position of the Monogame windowed form. My ultimate goal is to figure out when the user is clicking inside of the game window and where they're ...
0
votes
1answer
125 views

Separate game clocks/intervals in XNA

I am making a real time strategy game in XNA. I have separated the Client (rendering, input, sound) code from the Sim (game logic). I want to have features like replaying and fast forwarding. Also, I ...
0
votes
1answer
128 views

up vector for quaternion

First, I know there's a question exactly like mine, and some ohter really close, but my implementation of the solutions didn't work at all. Ok, now to the question. I created some forms of camera ...
0
votes
2answers
144 views

Creating a collision shape for a complex model

I'm currently creating the collision system for my 3D XNA game. To check collisions with models (especially complex ones) like trees or other plants, I thought about rendering a low poly version of ...
0
votes
1answer
108 views

How to call game Update from another form

I have three projects in one solution: a form with some tool (see it as a level-editor), in which there is PictureBox where I want to redirect drawing of the game. My game, with some methods and ...
2
votes
2answers
1k views

How to work with delta time?

I've just started using MonoGame (which pretty much seems to be an open implementation of XNA) and I'm trying to figure out on how to work with framerate independant calculations. Usually what I found ...
1
vote
1answer
221 views

XNA Monogame GameState Management not deserilaizing

I am having some trouble serializing/deserializing in a little game I am doing to teach myself monogame. Basically, I am using the gamestatemnanagement resources common to monogame (screen manager ...
0
votes
0answers
58 views

Simultanious RenderTarget use in XNA

I am currently grappling with the idea of lighting a 2D scene as a 3D one and i need to clear up a couple of things. I have so far figured out that i am going to use a differed lighting system where ...
0
votes
2answers
192 views

How do I detect and remove completed rows of blocks in Tetris?

I am making Tetris for a learning experience in XNA, and I'm having trouble deleted completed rows. I am having an issue with deleting rows, for some reason when I go to delete a row, I end up ...
0
votes
1answer
247 views

(XNA) 3D Model Rotation Angles

I'm currently in the process of making a 3d "semi" top down game, the camera comes in at a very high angle near 90 to show off the 3d models. I have a main character which can move in 4 axis (up, ...
0
votes
1answer
143 views

Write my own level editor, questions [closed]

I just finished to code the most important parts of my game engine (not a tile-map one), such as lights, shadows, objects update/draw, input, ecc. Now I'm making a level editor to simplify the ...
0
votes
2answers
304 views

Add a “fake” Loading Screen

I'm working on a 2D game for WPF8 using XNA 4.0. Everything goes great, but it's too fast. I was just wondering, what could I do between the end of the game and the score screen, and before the game ...
2
votes
1answer
193 views

XNA mesh.Draw() takes the longest CPU time

We have a problem. Our game steadily slows down as we increase the number of models we draw. When the number reaches 100 - FPS is dead. Our humble tests showed that the reason is not GPU. This is what ...
0
votes
0answers
21 views

XNA problem: models processed with different content projects reference the same effect file

I want to add multiple content projects to my XNA Game solution in order to compile them with multiple cores in parallel. The compilation time is a problem for us already and in the future things will ...
0
votes
2answers
53 views

Percentages for different platform generation [duplicate]

I have a level manager, which creates levels and levels create platforms. Levels can contain a variety of platforms. I dont really understand how I can say: I want a 10% of one platform being ...
0
votes
1answer
112 views

Effectively drawing dynamic primitives

Okay, so this is where I am now. My game largely consists of textures drawn through spritebatch. Now I have to draw a dynamic number of triangles. I cannot say in advance where or how many I have to ...
1
vote
2answers
222 views

XNA : Character walking on tiles and getting stuck

I develop games for my own pleasure and also to share experiences with my kids learning coding. Lately I have been working on a classic retro platform game using XNA and Farseer. One issue I am ...
1
vote
1answer
515 views

MonoGame - when/how to save data

I am making a simple 2d game for WP in monogame/xna and am at a point where I want to save data. I have created a method to serialize the data (index, counter and percentage counter) to an isolated ...
2
votes
2answers
91 views

Finding a specific point in a graphic model in code

I'm not really sure what I'm asking, so sorry for the bad title. I'm still new to game programming and especially the "game specific parts" like models and graphics. Let's say I have a model of a ...
0
votes
0answers
55 views

Simulating Windows Phone Trial mode is not working

I want to simulate a Windows Phone Trial mode. I created a little game in XNA and uploaded it as a beta on my Windows Phone Dev Center account. After that, I installed the game from my Dev Center ...
0
votes
2answers
85 views

How can I create the correct player object based on a type in a network message?

I am using lidgren as a networking library for a small XNA game. I am using a client/server architecture for the game. Currently, I have the client and server connecting but I would like to be able to ...