xna-4.0

Unable to select Target framework for XNA 4.0 games

*爱你&永不变心* 提交于 2019-11-29 19:47:19
问题 I have an XNA 4.0 project that I would like to be compiled with the .Net 4.0 Full profile, but it is set to Client profile by default. The Target framework combobox in the Application tab is grayed out. I have uninstalled and reinstalled .Net 3.5, .Net 4.0 and Xna 4.0. What could be the problem? Our other development machines do not have this problem. 回答1: I found a workaround: In the .csproj file is an xml element called TargetFrameworkProfile which is set to Client . When I remove the word

Rotation of an object around a central vector2 point

北城余情 提交于 2019-11-29 07:04:40
I should preface this with I am not anywhere near a math person. The code I've found in another question seems to be working somewhat... except that it causes the object I place to rotate in a large circle mostly off screen. Here's the code: public void Update(GameTime gameTime) { Location = RotateAboutOrigin(Center, Origin, 0.01f); } public Vector2 RotateAboutOrigin(Vector2 point, Vector2 origin, float rotation) { var u = point - origin; //point relative to origin if (u == Vector2.Zero) return point; var a = (float)Math.Atan2(u.Y, u.X); //angle relative to origin a += rotation; //rotate //u

Manual control over when to redraw the screen

大憨熊 提交于 2019-11-29 05:05:54
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 redraw the screen every frame, but, instead, when I want? The correct method for doing this is to call GraphicsDevice.Present() whenever you want to draw the back buffer onto the screen. Now the difficulty here is that the Game class automatically calls Present for you (specifically in Game.EndDraw ), which is something you don't want it to do.

How to install the XNA Game Studio 4.0 in Windows 8?

◇◆丶佛笑我妖孽 提交于 2019-11-28 16:12:44
This question is related, but NOT a duplicate: How to install XNA game studio on Visual Studio 2012? I read the above mentioned post, and have got xna projects opening, but I now have a problem. Some of the references to the XNA framework aren't found: Microsoft.Xna.Framework.Avatar Microsoft.Xna.Framework.GamerServices Microsoft.Xna.Framework.Net Microsoft.Xna.Framework.Storage Microsoft.Xna.Framework.Video And all references to Microsoft.Xna.Framework.Content.Pipeline Without these, I can't compile or run any games that I've made. I can't find the dll that contains these, or where I should

XNA 4 Song.fromUri containing Spaces

老子叫甜甜 提交于 2019-11-28 14:15:30
Hey, When trying to load a Song (via Uri) ( Song.fromUri() ) from my HDD (file:///...), The Mediaplayer throws a Exception. After a bit of googling i found out, that this Problem is related to Spaces in the Uri, so i tried escaping it: Uri.escapeUriString() don't work, the Result is a new Uri Object, containing null. Same Thing on uri.escapeDataString() or different Solutions. Is there an easier way to load an external mp3 into XNA? The simplest method would be to use reflection to get access to this internal constructor: internal Song(string name, string filename, int duration); Here is some

Game Architecture

本小妞迷上赌 提交于 2019-11-28 03:52:07
I have a question about a XNA game I'm making, but it is also a generic question for future games. I'm making a Pong game and I don't know exactly what to update where, so I'll explain better what I mean. I have a class Game, Paddle and Ball and, for example, I want to verify the collisions between the ball with the screen limits or the paddles, but I come across 2 approaches to do this: Higher Level Approach - Make paddle and ball properties public and on the Game.Update check for collisions? Lower Level Approach - I supply every info I need (the screen limits and paddles info) to the ball

Rotation of an object around a central vector2 point

大城市里の小女人 提交于 2019-11-28 00:53:20
问题 I should preface this with I am not anywhere near a math person. The code I've found in another question seems to be working somewhat... except that it causes the object I place to rotate in a large circle mostly off screen. Here's the code: public void Update(GameTime gameTime) { Location = RotateAboutOrigin(Center, Origin, 0.01f); } public Vector2 RotateAboutOrigin(Vector2 point, Vector2 origin, float rotation) { var u = point - origin; //point relative to origin if (u == Vector2.Zero)

Manual control over when to redraw the screen

♀尐吖头ヾ 提交于 2019-11-27 22:39:18
问题 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 redraw the screen every frame, but, instead, when I want? 回答1: The correct method for doing this is to call GraphicsDevice.Present() whenever you want to draw the back buffer onto the screen. Now the difficulty here is that the Game class

How to install the XNA Game Studio 4.0 in Windows 8?

半城伤御伤魂 提交于 2019-11-27 19:52:59
问题 This question is related, but NOT a duplicate: How to install XNA game studio on Visual Studio 2012? I read the above mentioned post, and have got xna projects opening, but I now have a problem. Some of the references to the XNA framework aren't found: Microsoft.Xna.Framework.Avatar Microsoft.Xna.Framework.GamerServices Microsoft.Xna.Framework.Net Microsoft.Xna.Framework.Storage Microsoft.Xna.Framework.Video And all references to Microsoft.Xna.Framework.Content.Pipeline Without these, I can't

XNA 4 Song.fromUri containing Spaces

十年热恋 提交于 2019-11-27 19:33:49
问题 Hey, When trying to load a Song (via Uri) ( Song.fromUri() ) from my HDD (file:///...), The Mediaplayer throws a Exception. After a bit of googling i found out, that this Problem is related to Spaces in the Uri, so i tried escaping it: Uri.escapeUriString() don't work, the Result is a new Uri Object, containing null. Same Thing on uri.escapeDataString() or different Solutions. Is there an easier way to load an external mp3 into XNA? 回答1: The simplest method would be to use reflection to get