XNA Game Studio 4.0 is a programming environment that allows you to use Visual Studio to create games for Windows Phone, the Xbox 360 console, and Windows-based computers.

learn more… | top users | synonyms (1)

3
votes
2answers
2k views

How can I make my program load music from files?

I'm working with a XNA game and I want my program to load music files from libary/music so I can play that music in the game. It would be great if the mediaplayer class could play a playlist of all ...
1
vote
0answers
349 views

XNA games freeze when loading too much content [closed]

We are experiencing freezes in our XNA games. The last played sound loops and the computer completely freezes. It does not even respond to ctrl-alt-del. It mostly happens when running fullscreen, but ...
1
vote
1answer
976 views

How to get the path of a file after publishing my game

I made a "game" for a college project that reads data from .txt file at startup and draws some models according to the data in that file. This is the code I use using (StreamReader sr = new ...
0
votes
1answer
3k views

How do I make an area in the screen clickable with XNA?

I am programming a penalty shoout game, my question is how make an area in the screen clickable with XNA? I know that for seeing the mouse I have to use: this.IsMouseVisible = true; But I want this ...
2
votes
2answers
2k views

Dealing with 2D pixel shaders and SpriteBatches in XNA 4.0 component-object game engine?

I've got a bit of experience with shaders in general, having implemented a couple, very simple, 3D fragment and vertex shaders in OpenGL/WebGL in the past. Currently, I'm working on a 2D game engine ...
1
vote
2answers
1k views

2D Particle Explosion

I'm developing a 2D action game, and in said game I've given my primary character an ability he can use to throw a fireball. I'm trying to design an effect so that when said fireball collides (be it ...
2
votes
1answer
271 views

Free physics library?

What are some good recommendations? I have a vertex buffer and indices and I want to be able to detect collision between it and a bounding box or another object.
1
vote
1answer
434 views

Making XNA Play Nice With 3DS Max, Boundiing Spheres

I'm using 3DS Max 2010 with the KW x-porter plugin, which outputs a .X file (just downloaded the very latest version). Been getting some odd results: ...
1
vote
2answers
2k views

How does flocking algorithm work?

I read and understand the basic of flocking algorithm. Basically, we need to have 3 behaviors: 1. Cohesion 2. Separation 3. Alignment From my understanding, it's like a state machine. Every time we ...
-4
votes
1answer
368 views

Best Tutorials for Learning XNA (VB 2010) [duplicate]

Possible Duplicate: XNA development tutorials I'm looking for some good tutorials for XNA 4.0 (with VS 2010) using VB. I've been looking on google and can't find much that's useful. So does ...
2
votes
1answer
436 views

Loading files during run time

I made a content pipeline extension (using this tutorial) in XNA 4.0 game. I altered some aspects, so it serves my need better, but the basic idea still applies. Now I want to go a step further and ...
2
votes
2answers
1k views

XNA 2D line-of-sight check

I'm working on a top-down shooter in XNA, and I need to implement line-of-sight checking. I've come up with a solution that seems to work, but I get the nagging feeling that it won't be efficient ...
0
votes
1answer
291 views

Error X3650 when compiling shader in XNA

I'm attempting to convert the XBDEV.NET Mosaic Shader for use in my XNA project and having trouble. The compiler errors out because of the half globals. At first I tried replacing the globals and ...
4
votes
3answers
777 views

When does depth testing happen?

I'm working with 2D sprites - and I want to do 3D style depth testing with them. When writing a pixel shader for them, I get access to the semantic DEPTH0. Would writing to this value help? It seems ...
3
votes
2answers
2k views

Using XNA's XML content pipeline to read arrays of objects with different subtypes

Using XNA's XML content importer, is it possible to read in an array of objects with different subtypes? For instance, assume these are my class definitions: public abstract class MyBaseClass { ...
3
votes
4answers
946 views

RenderTarget2D behavior in XNA

I've been dabbling with XNA for a couple of days now. This chunk of code doesn't work as I expect. The goal is to render sprites individually and composite them on another rendertarget. P = ...
0
votes
1answer
752 views

Draw order in XNA

It is possible to set draw order of a DrawableGameComponent by setting DrawOrder property. But is it possible to set draw order of "main" Game class? I have 2 DrawableGameComponents, and Draw method ...
2
votes
1answer
375 views

XNA extending an existing Content type

We are doing a game in XNA that reacts to music. We need to do some offline processing of the music data and therefore we need a custom type containing the Song and some additional data: // Project ...
2
votes
1answer
2k views

How do I draw thick lines in XNA 4.0?

I can draw some curves using this: GraphicsDevice.DrawUserPrimitives<VertexPositionColor> (PrimitiveType.LineStrip, Points, 0, count); Now I try to set the PointSize to make the ...
3
votes
2answers
491 views

Cutting out smaller rectangles from a larger rectangle

The world is initially a rectangle. The player can move on the world border and then "cut" the world via orthogonal paths (not oblique). When the player reaches the border again I have a list of path ...
3
votes
2answers
844 views

2D wave-like sprite movement XNA

I'm trying to create a particle that will 'circle' my character. When the particle is created, it's given a random position in relation to my character, and a box to provide boundaries for how far ...
1
vote
5answers
5k views

How to pause and resume a game in XNA using the same key?

I'm attempting to implement a really simple game state system, this is my first game - trying to make a Tetris clone. I'd consider myself a novice programmer at best. I've been testing it out by ...
7
votes
1answer
934 views

Problem with Update(GameTime) Methods and Pause implementation

I have the pause function implemented and it works correctly in that it dims the player screen and stops updating the gameplay. The problem is that GameTime continues to increase while it is paused, ...
4
votes
2answers
3k views

Drawing a texture line between two vectors in XNA WP7

I want to create a simple graph maker in WP7. The goal is to draw a texture line between two vectors what the user defines with touch. I already made the rotation, and it is working, but not ...
7
votes
1answer
3k views

Sidescroller variable terrain heightmap for walking/collision

I've been fooling around with moving on sloped tiles in XNA and it is semi-working but not completely satisfactory. I also have been thinking that having sets of predetermined slopes might not give me ...
1
vote
0answers
723 views

Picking 3D object with Mouse when using Camera Zooming in XNA 4.0

I've tried to figure out how to do picking with the mouse, and things work great when zoomed in all the way with the camera (Third Person Camera). And it works perfectly when using First Person ...
0
votes
1answer
330 views

How to make a model impressive [closed]

I am importing a model from 3DS Max 2011 which has been rendered by 3rd party renderer Vray. I believe that fbx does not support Vray information. So, my questions are: . What others ways are there ...
2
votes
1answer
2k views

XNA 2D - How can I draw a sprite over another?

I'm working on a simple 2D game that is similar to the classic Invader arcade. What I want to know is: How can I draw a new sprite over the player sprite upon colliding with an enemy/a bullet? Better ...
2
votes
1answer
295 views

2D Object 'Targeting' / 'Selecting'

I'm currently working with C# with the XNA framework. I'm trying to create a list of objects that are individually target-able after they are created and set in a list and displayed on a tile map. ...
2
votes
2answers
2k views

XNA 2D - How to switch to a new sprite upon collision and delete itself

Let's say I have a 2D spaceship that shoots at moving rocks. If a bullet intersects one of the rocks' bounding boxes, that rock will animate according to a new spritesheet and remove itself. My ...
1
vote
1answer
559 views

Collision detection not working

I realized I put this in the wrong forum, so here it is: I made a collision detection in the Update() section, and this is the code: if (player.playerRect.Intersects(turtleRect)) { ...
3
votes
4answers
609 views

Some advice for settling on a map format for a tile game?

I am using XNA 4.0 and am currently working on a simple tile game to pass the time. Basically, I'm using the tried and true method of having numbers refer to tile types, where in 0 would be an empty ...
3
votes
1answer
1k views

How to resize an image loaded using ContentManager in XNA

I am new to XNA programming and I loaded the background image using ContentManager as a Texture2D object. The background image which I have is of size 480*320. I have kept the minimum game window ...
12
votes
3answers
2k views

Why are there lines in between my tiles?

I'm making a top down XNA game. The maps are created by tiles. A problem I recently noticed is a 'grid' of lines between the tiles. It only shows up sometimes and only depending on the camera ...
2
votes
2answers
639 views

How to store “chunks” of tiles or How to make my implementation work

I asked a previous question about the loading and unload of chunk data and people noted that my way of storing chunks is weird and I was wondering how I would go about doing it properly. @Byte56 ...
2
votes
2answers
3k views

Loading and unloading “chunks” of tiles in a 2d tile engine with 2d camera

I am making a 2d tile based game in C# and XNA 4.0. I am having trouble loading and unloading "chunks" of tiles(blocks). The whole world is randomly generated and is infinate on both axis. How would I ...
0
votes
1answer
327 views

flicker when drawing 4 models for the first time

i have some models that i only draw at a certain moment in the game (after some seconds since the game has started). The problem is that in that first second when i start to draw the models, i see a ...
1
vote
1answer
2k views

How do I reset a game level

I have managed to implement a screen state system which I use to access the game. When the the character has collided with an enemy tile the game ends by going to a seperate game over screen. After ...
1
vote
1answer
318 views

How can I get a set of raw samples from an audio file in XNA 4.0?

In particular, I'd like to know how to get a set of audio samples that are compatible with the XNA's Sound API classes, such as the DynamicSoundEffectInstance class. I've used the ...
0
votes
2answers
966 views

XNA Framework HiDef profile does not support alpha blending

I am getting the following error, even though the code runs through the Draw could twice and then it errors: XNA Framework HiDef profile does not support alpha blending or ColorWriteChannels ...
1
vote
2answers
366 views

expand section of a texture 2D (zoom)

I have a texture2d loaded and wish at a certain moment to make a sort of zoom on the texture2d. As you can see in the image i would like to expand my red square to the resolution of the black ...
3
votes
1answer
3k views

Why isn't my sprite being drawn in the correct position in XNA?

Sorry if this has been asked before, but I can't seem to find it here. I'm trying to make an asteroids clone in XNA. I took the Game State Management project and am making new classes for things like ...
0
votes
0answers
78 views

Any way to optimize testing each bullet for each enemy in shoot em' ups? [duplicate]

Possible Duplicate: Is there a way to increase the collision check efficiency of a system of n objects? Lately I have been making a shoot em' up, and for collision detection I would use ...
1
vote
1answer
3k views

How does Terrain following work on height map?

I'm writing a 3D world game which consists of a terrain map (generated by brownian motion algorithm) and a simple avatar. My goal is to make the avatar move smoothly between points of different ...
1
vote
2answers
1k views

Reference a single 2d Rectangle in an array

What I am attempting to do probably has a very simple answer but I can't make heads or tails of it no matter how hard I try. Provided I'm a newb. What I am trying to do is after I create a grid of ...
2
votes
1answer
773 views

2D Point Light XNA , Why my point light radius is Oval?

I friend of mine , taught me how to make a simple 2d point light with shader, so i follow his steps and finally done it ! but something happend , the light shape is like an oval and not like a ...
0
votes
1answer
499 views

XNA Sprites Not Drawing Correctly

I have a problem through out my current code where certain Texture2D's are not drawing correctly over each other. For example, at the start I have sprite font being drawn over a background image and ...
0
votes
2answers
754 views

XNA Subtract blending function doesn't work

I wanted to subtract a white image with black circle background from a picture to get a lighting circle here is the white image So I wrote this code spriteBatch.Begin(SpriteSortMode.Deferred, new ...
1
vote
1answer
2k views

SpriteBatch Draw Using Floats with the Destination Rectangle

So I created a nice little isometric tile engine and I have it so that when you scroll with the mouse it changes a variable called scale. Scale is a float and gets passed through the ...
12
votes
1answer
2k views

How can I create gradiented Fog of War?

I'm creating a top down 2D RTS game for educational purposes. Currently, I'm really just copying Starcraft's design/ideas. I've decided I should probably implement Fog Of War too. My expectations: ...