Questions tagged [xna-4.0]

Version 4.0 (Final) of Microsoft's XNA Framework. If you use this tag, please also include the main tag XNA.

is the final version of Microsoft's XNA Framework.

XNA is a cross-platform framework originally from Microsoft that facilitates game development with .NET. Supports: Windows, Xbox 360, Windows Phone (natively), Silverlight (via SilverSprite or ExEn), iPhone/iPad, Android, Mac OS X, Linux and other (via MonoGame).

This was the definitive version that came out at 2010-09-16. Despite that it's no longer developed, It's still used for plenty of projects as of 2017.

If you use this tag, please also include the main tag .

1200 questions
4
votes
2 answers

xna 3d bullet bath and draw method gone wrong

I'm designing a 3D game, in which I have a camera behind a spaceship to move around. I have added some asteroids in the game as well, and I want to add bullets. I used quaternions to control the path of the spaceship and the camera behind it.…
Martinos
  • 167
  • 1
  • 2
  • 9
4
votes
1 answer

XNA property Game.IsActive is not working

I have recently noticed that sometimes the XNA property Game.IsActive does not always correctly reflect the state of the game window. More specifically, Game.IsActive = true even if the game window is clearly not active (e.g. the top window bar is…
ares_games
  • 1,019
  • 2
  • 15
  • 32
4
votes
2 answers

Manual control over when to redraw the screen

I'm trying to make a turn-based roguelike engine thing for XNA. I'm basically porting the game over from a previous work I did using an SDL-based roguelike library called libtcod. How can I modify the basic XNA template thing to make the game not…
Adam Rezich
  • 3,122
  • 6
  • 31
  • 39
4
votes
1 answer

How does the playback duration of sound files change when changing pitch in XNA/Monogame?

Using the SoundEffects class in XNA (or alternative implementations of XNA like MonoGame or FNA), a sound effect has a certain playback duration equal to the length of the sound file which is stored in: SoundEffect.Duration However, when the pitch…
ares_games
  • 1,019
  • 2
  • 15
  • 32
4
votes
2 answers

XNA - Mouse.Left Button gets executed more than once

I am a noob at programming but before we start please answer me why does update execute more than once an explain it like i am a dummy. Anyways so i am trying to make this code run only once because as of now it executes it more than once. …
Wasiim Ouro-sama
  • 131
  • 3
  • 16
4
votes
1 answer

Unable to find pdb file

I am new to C# and was working on a small game using the XNA framework when these errors started to show up. Using Google I was able to load the symbols for projects other than XNA framework extensions. However, this didn't fix the problem. The…
4
votes
2 answers

Redraw unchanging background on every Draw?

This might be a very simple question, but I searched and found no other way to do it. It doesn't make sense to redraw the background on every Draw. Is there a way to draw some things and leave them on the screen? I've tried to comment-out…
ispiro
  • 26,556
  • 38
  • 136
  • 291
4
votes
1 answer

Where to call SetRenderTarget?

I'd like to change my RenderTargets between SpriteBatch.Begin and SpriteBatch.End. I already know this…
s0ubap
  • 267
  • 3
  • 8
4
votes
2 answers

Sorting meshes in XNA

I have problem with trees in XNA. When I have tree, I need to use alpha blending to make non-leaf parts transparent, but some parts of model are not correctly displayed and thus alpha blending fails. I want to know if there is possibility to read…
Thun
  • 55
  • 4
4
votes
1 answer

How do I create a multidimensional array of objects in c#

I am trying to make a script that dynamically generates world chunks by making a height map then filling out the terrain blocks from there. My problem is creating a 2 dimensional array of objects. public class Chunk { public Block[,] blocks; …
FreakinaBox
  • 421
  • 1
  • 4
  • 15
4
votes
2 answers

Tinting a terrain model in a radius around a given point in XNA 4.0

I'm writing a game in Visual Studio 2010, using the XNA 4.0 framework. I have a 3D terrain model generated from a height map. What I'm trying to accomplish is to tint this model in a given radius around a certain point, the end goal being to display…
Dangerbunny
  • 81
  • 1
  • 3
  • 10
4
votes
1 answer

XNA Perlin Noise Planet

I want to make an procedural planet with XNA. I'm able to create an heightmap with Perlin Noise and load it in run-time, but how do I create additional seamless chunks and create a spherical planet? Thanks in advance, Giulio.
Giulio Zausa
  • 233
  • 4
  • 16
4
votes
1 answer

How to add XNA Content Pipeline to Silverlight 5 in Visual Studio Web 2010 Express?

The Silverlight 5 XNA samples, I presume are built in Visual Studio Professional editions as when when opening them in Visual Web Express 2010 it cannot open the Content Projects. NB: I have reported the issue here, so watch out for a resolution…
markmnl
  • 11,116
  • 8
  • 73
  • 109
3
votes
3 answers

Convert fraction to float in C#

Can anyone please help. I'm following a tutorial found here as I have a situation where I have to get the equation of a line in point slope form i.e. y−y1=m(x−x1). I get up to step 3 of the tutorial no problem, but then I got stuck. In order to go…
heyred
  • 2,031
  • 8
  • 44
  • 89
3
votes
4 answers

XNA Game Application without installer

A friend and I plan on developing an XNA game. I'm in charge of the programming aspect and it made me wonder - what is the easiest way for me to share application updates with him during development? Will he be forced to reinstall the application…
Acidic
  • 6,154
  • 12
  • 46
  • 80