Run the event once during the update () XNA / C #

this is the best way I can think of doing this. Could you give me so hints as to whether this is the correct way or if there is a more efficient way of doing it. My situation is: Each time the frame is Update()'ed (Like in XNA) I want to check if som

System.Drawing missing assembly or reference

I want to use the Bitmap class under an XNA project declared on System.Drawing but it says that I'm missing an assembly or reference. I added System.Drawing to my references and changed my target framework after seeing this post. I opened 3 or 4 new

Texture2d.SaveAsPng () Memory Leak

I have found strange issue with method Texture2d.SaveAsPng() Every call 1.5mb disapear. I use this method to save texture to isolated storage public static void SaveTextureToISF(string fileName, Texture2D texture) { using (IsolatedStorageFile file =

The microphone does not exist in the current context

In reference to this article on MSDN. The assembly, microsoft.xna.framework.dll, has been added to the references and I'm using the namespace Microsoft.Xna.Framework.Audio, however I receive an immediate error on the first step, shown below: Micropho

OpenTK initializer exception type and monogamous

I just installed MonoGame and OpenTK 1.0 and in Visual Studio 2012 I made a new project of type 'Windows OpenGL Game`...but when I run the project I get the following error: The type initializer for 'OpenTK.Graphics.GraphicsMode' threw an exception.

Windows phone xna drag

I'm making a game and I have a problem: I want to control the hero in my game through swipes. For example: Swipe to the left : Hero goes to the left Swipe up : Hero jumps My question is how to check what side a user swipes. Thank youin this i have ch

Access project file files from a WP application

I'm new to Windows Phone development and I'm trying to do a simple training app. I want my app to load some audio files that I've put into a folder inside the project. Here's a short snippet: private void LoadSound(String SoundFilePath, out SoundEffe

XNA for WP7 and multitouch update each frame

I'm having trouble with touch/multitouch input. I want to draw a small rectangle, 100x100 in dimensions, wherever the user presses (mission accomplished) but I also want them to move as the user moves his fingers (that's not happening atm). I'm also

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 mes

How to move the camera behind a model with the same angle?

I meet are having difficulty in moving my camera behind an object in a 3D world. I would create two view mode. 1: for fps (first person). 2nd: external view behind the character (second person). I searched the net some example but it does not work in

XNA: How to measure how long a key is held down?

I'm trying to make a jumping mechanism in my game which will work something like this: // velocity.Y is the velocity of the sprite I want to jump if (keystate.IsKeyDown(Keys.W)) { velocity.Y = 3 - (time elapsed since start of jump); } I thought this

Saving variable data on the disk

Is it possible to save a variable from C# to disk so that you are able to use it later in another instance of your project? For example, I have a struct with 3 fields like in the following example : struct MyStruct { byte[] ByteData; int MyInt; doubl

XNA game built into the website

I just finished a game in XNA, and I was wondering if it could be played in the web browser (using silverlight, for example.) I am using webs.com to make my website, so I don't know if it gives me the full capabilities (I have the free version.) All

Farseer ConvertUnits?

In FarseerPhysics engine / XNA, what is ConvertUnits.ToDisplayUnits(); ?Farseer (or rather, Box2D, which it is derived from) is tuned to work best with objects that range from 0.1 to 10 units in weight, and 0.1 and 10 units in size (width or height).

Repetition of the world 2d

How to make a 2d world with fixed size, which would repeat itself when reached any side of the map? When you reach a side of a map you see the opposite side of the map which merged togeather with this one. The idea is that if you didn't have a minima

How to draw a dynamic grid with XNA

I'm trying to draw grid using the XNA framework, this grid should have a fixed dimension, during the execution of XNA, but should be given to the user the opportunity to customize it before launch the game page (I'm building my app with the silverlig

Fluid multiplayer movement

I'm attempting to create smooth movement from the other players in my game, and although it's smooth, it gets rather behind when one walks for more than 5-10 seconds or so. I know the issue: It's because that player's speed is X pixels per step and i

Keyboard duplication entry hanging (c # / xna)

I'm using a Keyboard hook in my XNA project (anyone who uses XNA knows how useless the built in keyboard class is for "text box" style typed input. It works just fine for use in XNA projects, until forms are introduced. If I try to implement any

How to place sprites at specific x, y coordinates in xna 4.0

Okay im working on making a tic tac toe game for one of my game development courses using XNA 4.0 I need to place sprites or some other objects so the game can check if the mouse is being clicked in the correct spots. I am going to use transparent sp

Silently sending an e-mail from a Windows Phone 7 device?

Is it possible to silently send an email from a Windows Phone 7 device? The reason I ask is because I would like to have a system from which an app will send information to a server which the server will log. I figure if I use emails it would be a lo

how to instantiate a class in C #?

I am making a game for the Windows Phone using XNA framework C#. The main player in the game has to shoot. I have a bullet class, but how do you instantiate that bullet everytime the user clicks on the screen? The bullet class basically draws itself

How to access the XNA 3.1 templates in Visual Studio 2010?

I have installed XNA Game Studio 3.1, but I can't see the Game Template in Visual Studio 2010 on Windows server 2008. There is no driver for graphics and XNA 4.0 won't install, could it be related? How do I solve my problem?XNA Game Studio 3.1 works

XNA unit tests: should I mock my GraphicsDevice

I'm fooling around with the XNA framework. To help me around I made a helper class that looks like this: ActorHolder + SpriteBatch (SpriteBatch) + ContentManager (ContentManager) - drawables (IList<IDrawable>) - updatables (IList<IUpdatable>)