xna

Threading in XNA

I have a game in XNA which needs to do network calls. In the update method I determine what needs to be sent and then add it to a list of stuff to send. Then I run the network call. This slows down the application alot obviously. So I first tried creating a new thread like this in the update to make it do it on a seperate thread: Thread...

Should I use XNA to create an elevator simulator?

I want to create an elevator simulator, just for fun! Will it be beneficial to do so in XNA, instead of a Form application or WPF/ Silverlight? I want to create a simple animation to show the elevator(s) in action. I prefer to use a .net language. ...

Cropping audio with XNA

I'm new to XNA and am trying to allow the user to edit an audio file they've loaded in. In XNA, is it possible to select a time frame (e.g. 0:00 - 0:10) and 'crop' that part as a separate entity? I guess, essentially, it's simply copying that data to a new file. Can this be done using the XNA Audio library and, if so, what methods should...

Problems with some textures in XNA

Hi I have made a model using Sketchup, and have tested rendering it using Blender and it looks great. However loading it in XNA has two problems. 1. One of the textures becomes see-thru not entierly transparent but items below on the inside of the model is visible (this is not the case in blender). 2. I have a rounded part on the model...

How can I detect a collision between a moving object and an immobile one?

Hello, First of all, my question isn't really specific to C# or XNA, but my code examples will use these. Also, sorry for the title, I didn't know how to express my question properly. I am currently trying to make a Pong clone and I've run into a problem with collision-detection. Each object basicly has a specific Velocity(which is a...

XNA - Using Dynamic Vertex Buffer and only four(4) vertices.

Hiya! Just a quick question on drawing quads. I'm currently using: GraphicsDevice.DrawPrimitives(PrimitiveType primitiveType, int startVertex, int primitiveCount); This draws my quads perfectly fine but the only way I can make it work is to use six (6) vertices for my quads (drawing them as two triangles). I'm...

Game engine design with dynamic properties

I am currently developing a C# .net XNA game engine. I had a question about the design of the engine. First of all I would like to have my engine be able to incorporate my own scripting language. To do so I was thinking I would have to be able to access to all the properties of all the objects in the game, or just the ones I would like...

C# delegate performance in xna game

I am currently developing a C# .net xna game engine. I have been trying to figure out a way to have an update manager / scheduler / event system. I currently am using delegates to provide a way to create dynamic scheduled tasks and events. I have recently read that delegates can be slow. The delegates in my game are being invoked every...

The right tool for the job (3d Modeling)

Hey there I am looking at xna development studio, and i like what i'v seen so far. What tool would you recogmend for creating 3d models that i can import. I would like the answer to be based on the following: Most Important - Ease of use Learning curve Features Compatibility with other 3d engines cost Thanx guys ...

How do I use random numbers in C#?

I'm working on Pong in C# w/ XNA. I want to use a random number (within a range) to determine things such as whether or not the ball rebounds straight, or at an angle, and how fast the ball moves when it hits a paddle. I want to know how to implement it. ...

Can XNA DrawableGameComponents be drawn before SpriteBatch draw calls so that sprites are drawn on top of DrawableGameComponents?

I would like some 2D sprites to occlude some 3D DrawableGameComponents. For a simplified example, a pause menu (implemented as a 2D sprite) should be drawn on top of a paused space ship (implemented as 3D game component). The XNA framework automatically calls Draw methods of classes from Microsoft.Xna.Framework.Game and Microsoft.Xna.Fr...

Position 3d objects in xna

I'm pretty new to xna development and want to position the Cubes from the Primitives3D sample by passing a position vector to the constructor .. unfortunatly it does not work .. instead it is just spinning arround.. Thats how i modified the code of the cubeprimitive class: public class CubePrimitive : GeometricPrimitive { public ...

XNA Fighting Game Style Animation Looping Problem

I've been working on this for quite some time looking for solutions in various places. I've used Nick Gravelyn's style of storing animations into a text file and am simply incrementing an index to change frames. The trouble I'm having is looping an animation once and only once, but for some reason the way that I know should work isn't wo...

Why is matrix multiplication in .NET so slow?

I don't quite understand what makes matrix multiplication in C#/.NET (and even Java) so slow. Take a look at this benchmark (source): Trying to find an updated benchmark. C#'s integer and double performance is damn close to C++ compiled with MSVC++. 87% as fast for double and 99% as fast for 32-bit integer. Pretty damn good, I'd say....

How do I display Numbers and Text in C# with XNA?

I am working on a pong clone, and i want to display the player scores onscreen. I don't know how to display it. ...

Simple 2D rocket dynamics

I am currently experimenting with some physics toys in XNA using the Farseer Physics library, however my question isn't specific to XNA or Farseer - but to any 2D physics library. I would like to add "rocket"-like movement (I say rocket-like in the sense that it doesn't have to be a rocket - it could be a plane or a boat on the water or...

Walking to Idle animation transition trouble.

I'm having trouble transitioning my walking to idle animations. Maybe there's a better way to go about this? The problem: I can check for NO key presses on the keyboard, but it causes the walking animation to display only the first frame and not the full animation. The question: How can I change this so that when the user is done wal...

Wildcard for content in an XNA content project?

I have an XNA 3.1 content project (.contentproj) with the following: <ItemGroup> <Compile Include="tiles\B000N800.BMP"> <Name>B000N800</Name> <Importer>TextureImporter</Importer> <Processor>TextureProcessor</Processor> </Compile> <Compile Include="tiles\B000N801.BMP"> <Name>B000N801</Name> <Importer>TextureImporter</Importer> ...

Color Replacement in XNA C#

I load my textures using Texture2D.FromFile() then draw them using spriteBatch.Draw() But here's the point: I want to change some colors of the image to another ones. So my questions: How to change single color of the image to another single color (eg. blue to red). In fact, what I really want to do is changing group of colors t...

What's the difference between a Windows Game Library and a Class Library?

What's the difference between a Windows Game Library and a Class Library? Is it just that one starts off by including the XNA Framework? Also, where are the differences between the Windows / Xbox360 / Zune Game Libraries? They all seem to start off with the same References (Microsoft.Xna.Framework, Microsoft.Xna.Framework.Game). ...