xna

Triangles Drawn in XNA

I am looking for a way to get the amount of triangles drawn per frame in XNA. ...

Missing option for "Content Importer" in XNA (trying to import video)

http://klucher.com/files/media/image/WindowsLiveWriter/VideoSupportinXNAGameStudio3.1_8E34/image_2.png I don't have the option "WMV Video File - XNA Framework". The video I'm importing is in WMV format and was encoded using Microsoft Expression Encoder 4 with the settings set to the predefined "VC-1 Xbox 360 HD 720p" so I don't think t...

Problem with shader/code

I have this basic 3d application and trying to write my own toon shader, but even if I remove the tooning part it still still just stays plain darkblue when I give a red color to it. shader code : struct VertexShaderInput { float4 Position : POSITION0; float3 Normal : NORMAL0; float4 Color : COLOR0; }; struct VertexShader...

XNA 4.0 runs at 50 instead of 60 fps.

I'm experimenting a bit with XNA 4.0, following tutorials and creating very basic stuff (like a triangle and some lines ;-)). While doing this, I noticed that all my applications never run at more than 50-51 fps (with Fraps). It's not that I'm running heavy programs on a slow computer or graphics card (Ati HD4870), it must have something...

How can I reorganize my code into classes in C#?

I'm working on a project in C# w/ XNA, and I want to reorganize it and divide parts of it into classes. At present, it's just one game.cs file, but I want to clean it up a bit. Unfortunately, I'm not too familiar with classes. Perhaps someone can help me figure out how to do this, or direct me to some tutorial of some sort? ...

Making parts of Texture2D transparent in XNA

I'm just starting game development and I thought a game like Tank wars or Worms would be nice. The hardest part I can think of so far is making the terrain destructible and I want to know how it's done before doing the easy parts. I thought that explosion could have a mask texture which could be scaled for different weapons. Then using...

When to load textures?

I'm currently working on a couple of windows phone projects (Although the question may also fit iphone/android) and it got me thinking, when is the best time to load textures from the content manager. At first, I was loading them all up, from my Game base class, and passing them along as required. Quickly getting sick of this, I have cr...

Player class with my C# XNA game

I would usually seek help on the XNA forums but they're down at the moment, so I've come here. I am making a new XNA game, and I want to have a player class. At the moment I have a main game class called Dots. This represents the main game. This is how my Player class is laid out at the moment: namespace Dots { class Player : Micro...

Trying to figure out the hierarchy of classes in my XNA game...

I am still kinda new to developing games in XNA and using classes with C#, but I want to start a semi-decent game project where I can learn without throwaway projects. I want to devide my game up into classes. For example a main game class, a player class (i want two players, and they battle against each other), a level class (for drawi...

Public variable not accessible in my classes

I am using the XNA framework to make one of my first games. In it's main game class (Breakout.cs), I put this: public int screenHeight; public int screenWidth; And in the Initialize method: this.screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height; this.screenWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMod...

2d Physics enegine for xna 4

Hi! What is the best 2d physics engine for xna 4.0 in your opinion ? Farseer don't work at all on my vs2010 :/ ...

Networking for Xna (C#) and C++?

Me and some friends were thinking about making an online game with XNA game studio. Our games mainly used Winsock for the networking portion, but our most recent project used RakNet where the server was in C++ and the Client used a small RakNet wrapper I wrote. As far as I know XNA can't really use DLLs, so I was wondering what a good ne...

Assigning a Texture2D to an existing Texture2D

Hello, I am currently messing with C# XNA 4.0, but I am having some problems assigning a Texture2D to an existing Texture2D. An example of the code shown below: protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); texDisc48 = Content.Load<Texture2D>("textures/disc_24"); ...

XNA Framework: ContentManager.Content.Load<Texture2d>("10by10tile") is a 'method' but is used as a 'type'

I'm sorry if this is insanely stupid, but I'm a total newbie when it comes to C# and especially the XNA Framework. I got the error message from above; why in the heck does it work for Platformer1's Player code but not for me?! using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Frame...

LAN Development in XNA

Hi, I'm looking at developing a LAN-Only game as part of my coursework at university, however only own 1 computer. Reading around the internet, it seems to be possible to develop such a game by utilising a vmware image and installing all the appropriate pre-reqs on that, then using NetworkSession.Create(NetworkSessionType.SystemLink...

Using Hamachi to develop XNA on one PC

Hi all, I'm currently trying to develop a network game for XNA (LAN only as no desire to release), however I only own 1 PC. I've been trying many different things but all seem to have failed. I'm running VMWare Player with a Win7 Prof image (with vs2008 + XNA 3.1 installed) from my main PC (Win 7, everything installed). I've installed...

XNA Game failing to deploy to WP7 Emulator

This use to work, I can't tell what I broke... but I suspect it is something to do with the WMAAppManifest / Guid... When I attempt to Deply/Debug to the WP7 Emulator from VS I get the following popup message: "The application could not be launched for debugging. Verify that the application is installed on the target device." What I ac...

C# Winform XNA Collision

I'm interested in knowing how I would go about detecting a primitive circle touching another primitive circle? So, if I had a circle with 5,10 and another one with 5,13 with each of them having a radius of 2. well the distance formula is the Pythagorean theorem. which is sqrt((x2-x1)^2 + (y2-y1)^2) = distance and if this distance is le...

Very simple menu in XNA

Hi guys, Me and some other guys are creating a game, and i would like to add a very simple menu with only Start and Exit Game. Now I already downloaded the Game state management sample, but thats a very long and complicated code. My question: someone knows a site or something where i can make such a simple menu or someone created such a...

powerup in race game

Hi all, I've got a problem: i need to add a powerup to a racegame, using collision detection. so i drawed the powerup, but the problem is: It has to be drawn after every 5 rounds and it needs to be placed ramdomly on the track. Someone with any good advice? Thanks. ...