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)

1
vote
1answer
132 views

Collision detected on only the latest added tile

I'm making a 2D platformer and I'm using tiles as the ground. I have a Tile class and I'm loading the tiles with the help of a list in the main game class: public static List<Tile> tiles = new ...
0
votes
1answer
163 views

Drawing on XNA screen

I need to use Microsoft.Ink library on XNA. Previously I used ink library on winforms application and drawing on the form screen is very easy and it looks pretty good. However, when I do the same ...
0
votes
1answer
65 views

Primitives does not show on screen [closed]

I'm trying to render terrain, everything compiles fine, but I can't see anything on screen. ( I'm moving camera around in case it was on the other side) Can't figure out whats wrong. public class ...
1
vote
1answer
161 views

XNA: weird collision behaviour

I'm reading the book "Learining XNA 4.0", and I'm in the object oriented disgn part. I'm having a weird problem with the collision of 2 rectangles. I have a list of automateSprite and a Player class ...
1
vote
2answers
437 views

How do I measure time in XNA?

Is there any simple way to calculate time that is spent in each method that's called from the Update and Draw methods? I want to do this to find bottlenecks in my engine. Is that a good way?
3
votes
3answers
855 views

AI algorithm for avoiding bullets in a shoot-em-up game

I am working on a shoot-up-game in XNA, it is going to be my final project in school. I was thinking of utilizing the minimax algorithm for AI agents for making tactics. However, I realized that the ...
2
votes
1answer
387 views

Can someone explain this Pulsate code to me

// Pulsate the size of the selected menu entry. double time = gametime.TotalGameTime.TotalSeconds; float pulsate = (float)Math.Sin(time * 6) + 1; scale = new Scale(1 + pulsate * 0.05f,1 + pulsate * ...
2
votes
1answer
2k views

How to get file paths in XNA 4.0?

Is it possible to use OpenFileDialog in XNA 4.0 to get the file path? If not, what is the alternative? I'm using XNA 4.0 to create a graphic display (not a game) and I have a file that contains ...
3
votes
1answer
523 views

XNA: Good way to queue up animations

I'm writing an AnimatedSprite class that has an Animation object (which itself contains a sprite sheet). The AnimatedSprite plays certain animations during key input. My problem is that how do I ...
3
votes
2answers
2k views

XNA: Draw Bounding Box around Sprite

I'm just starting with XNA and I wanted to draw Debug Lines around my Texture/Sprite to help me. Is there an easy way to do it with SpriteBatch? I haven't used the GraphicsDevice yet to draw.... ...
1
vote
2answers
2k views

XNA: How to Flip/Mirror a position over a custom vector?

I want to flip Horizontally my Sprite/Texture however the SpriteEffects.FlipHorizontally isn't cutting it for me as it just flips the texture in place. I want to flip the texture over a specified ...
2
votes
0answers
171 views

Problems loading Hilva tutorials [closed]

I'm a newcomer to XNA, and I'm evaluating some libraries. The Hilva Graphics Engine looks interesting, and I'm trying to run their tutorials. However, all of them give me errors. For example, if I ...
1
vote
0answers
210 views

Batching Homogeneous Render Objects in XNA, 2D Component-Entity Engine?

I've been working on my component-entity engine for about 3 months now, and have managed to get nearly every constituent system working with little effort or compromise. My system has the following ...
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
379 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
1k 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 ...
3
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
2k 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
279 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
439 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: ...
2
votes
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
387 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
469 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
2k 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
330 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
923 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
985 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
788 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
390 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
558 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
930 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
6k 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
970 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
773 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
338 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
3k 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
331 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
586 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
627 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
685 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 ...
3
votes
2answers
4k 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
335 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 ...