C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.

learn more… | top users | synonyms

0
votes
1answer
271 views

Xna performance [closed]

I'm thinking about starting to write a game and my primary concern is performance. I was thinking about writing it in xna (client), and then also writing the server in c#. Will this be fast enough for ...
2
votes
5answers
436 views

Particle System in XNA - cannot draw particle

I'm trying to implement a simple particle system in my XNA project. I'm going by RB Whitaker's tutorial, and it seems simple enough. I'm trying to draw particles within my menu screen. Below I've ...
7
votes
2answers
6k views

How to determine collision direction between two rectangles?

I am trying to figure out how to determine the direction a collision occurs between two rectangles. One rectangle does not move. The other rectangle has a velocity in any direction. When a collision ...
4
votes
1answer
1k views

Platformer Starter Kit - Collision Issues

I'm having trouble with my game that is based off the XNA Platformer starter kit. My game uses smaller tiles (16x16) then the original (32x40) which I'm thinking may be having an effect on collision ...
2
votes
3answers
766 views

Collision Detection Problems

So I'm making a 2D tile based game but I can't quite get the collisions working properly. I've taken the code from the Platformer Sample and implemented it into my game as seen below. One problem I'm ...
3
votes
1answer
1k views

Loading class instance from XML with Texture2D

I'm having trouble with XML and XNA. I want to be able to load weapon settings through XML to make my weapons easier to make and to have less code in the actual project file. So I started out making a ...
4
votes
4answers
2k views

A* algorithm very slow

I have an programming a RTS game (I use XNA with C#). The pathfinding is working fine, except that when it has a lot of node to search in, there is a lag period of one or two seconds, it happens ...
3
votes
1answer
3k views

Best way to use Raknet from C#? [closed]

I am trying to learn Raknet with C# and I found it extremely confusing. The Raknet tutorial seems to work well in C++. I have already made the chat server from the tutorial. I am looking to do ...
2
votes
2answers
414 views

Building a shape out of two rectangles

I would like to build a body with Farseer out of two rectangles so it looks like this: I am a real beginner, so please describe it carefully. Thanks in advance!
1
vote
3answers
2k views

Efficiently checking input and firing events

I'm writing an InputHandler class in XNA, and there are several different keys considered valid input (all of type Microsoft.XNA.Framework.Input.Keys). For each key, I have three events: internal ...
2
votes
2answers
1k views

Loading levels from .txt or .XML for XNA

I'm attemptin to add multiple levels to my pong game. I'd like to simply exchange a few elements with each level, nothing crazy. Just the background texture, the color of the AI paddle (the one on the ...
0
votes
1answer
588 views

Why do I get an exception when playing multiple sound instances?

Right now, I'm adding a rudimentary sound engine to my game. So far, I am able to load in a WAV file and play it once, then free up the memory when I close the game. However, the game crashes with a ...
0
votes
1answer
464 views

How can I run a .jar file with XNA?

Could someone help me to develop a method to run any .jar file (with parameters) from in C# with XNA?
0
votes
2answers
1k views

Delaying a Foreach loop half a second

I have created a game that has a ghost that mimics the movement of the player after 10 seconds. The movements are stored in a list and i use a foreach loop to go through the commands. The ghost mimics ...
5
votes
1answer
331 views

Disposing of ContentManager increases memory usage

I'm trying to wrap my head around how memory management works in XNA 4.0 I've created a screen management test and when I close a screen, the ContentManager created by that screen is unloaded. I have ...
7
votes
1answer
275 views

XNA 4 game for both profiles

I am writing game in XNA 4 and this version have two profiles hi-def and reach. My problem is that I need to have my game code for each of these profiles and is very uncomfortable to have two projects ...
0
votes
1answer
835 views

Building a shape out of an Texture with Farseer

I have already looked at the Documentation on there Website, but the code provieded to create a shape out of an Texture is outdated for the newest version. The body is very simple so maybe i can do it ...
0
votes
2answers
148 views

List has no value after adding values in

I am creating a a ghost sprite that will mimic the main sprite after 10 seconds of the game. I am storing the users movements in a List<string> and i am using a foreach loop to run the ...
1
vote
1answer
481 views

How important is c# for game programming? [duplicate]

Possible Duplicate: Does C# have a future in games development? Presently I'm learning c++ and in starting stage of opengl . My ultimate goal is to be game programmer. I want to stick with ...
2
votes
2answers
790 views

Help Decide between C#/XNA client or Java

The game runs on a client/server architecture currently setup for TCP, and the client code was built in AS3 to be web based. What we're running into is 3 problems for the client. AS3 has no ...
3
votes
1answer
390 views

Retrieving model position after applying modeltransforms in XNA

For this method that the goingBeyond XNA tutorial provides, it would be really convenient if I could retrieve the new position of the model after I apply all the transforms to the mesh. I have edited ...
1
vote
2answers
1k views

How do I implement fog of war in a tile-based game?

I have created a 2D Tile Based game. The game has a single path that the sprite can move on. I want to create to make the entire screen black except for where the sprite is. The sprite has commands ...
1
vote
3answers
695 views

Implementing a switch statement based on user input

I'm trying to delay the time it takes for the main menu screen to pop up after a user has won / lost a match. As it stands, the game immediately displays a message stating "you won / lost" and waits ...
2
votes
1answer
869 views

Drawing text from update method in XNA

I am having a problem drawing the "Game Over!" text once the user is on the last tile. This is what I have: The Update and drawText methods are in a class named turtle: public void Update(float ...
1
vote
2answers
780 views

Simple collision detection for pong

I'm making a simple pong game, and things are great so far, but I have an odd bug which causes my ball (well, it's a box really) to get stuck on occasion when detecting collision against the ceiling ...
1
vote
3answers
1k views

Text based game in XNA

I want to create a text based game, where the player will type up,down, left or right and the sprite will move in that direction. I created the game and at the moment the player moves with the ...
0
votes
1answer
114 views

How to shoot a triangle out of an asteroid which floats all of the way up to the screen?

I currently have an asteroid texture loaded as my "test player" for the game I'm writing. What I'm trying to figure out how to do is get a triangle to shoot from the center of the asteroid, and keep ...
2
votes
2answers
396 views

Tile map collision is not working properly

I am having problems setting collision between my sprite and the tiles. I have only done the code for colision for moving upwards but some places on the map it moves up and some places it doesn't. ...
4
votes
2answers
379 views

How do I properly use String literals for loading content?

I've been using verbatim string literals for some time now, and never quite thought about using a regular string literal until I started to come across them in Microsoft provided XNA samples. With ...
0
votes
1answer
436 views

Multiplayer Game Data Serialization Problems

I want to create a simple game that can be played with one to two player. I plan on using TCP sockets, Farseer Physics, XNA, a BinaryFormater and a Memorystream. as far as i know i can't do the ...
1
vote
2answers
372 views

How to iterate through a list of enemies and display results?

I'm making an turnbased RPG and I wanted to add a traditional multiple enemy system where a user could attack different enemies when it's there turn. I started by making a list of everybody who is ...
0
votes
1answer
299 views

Platforms collide-able on one side only

I have frequently tried to make some sort of a platformer, but when I actually code it, I run into a bit of a snag. How would I be able to make platforms in the air stop objects if they hit the sides ...
4
votes
1answer
335 views

Paddle will not *continue* to move, pong game, XNA

I'm making a pong game, and my paddles no longer continue to move after holding down the left thumbstick or dpad down. It simply moves once with each press. I think it is because I'm not checking for ...
6
votes
1answer
288 views

How to make a registration for my game?

Me and my (new) company want to sell a very simple game, but we want it so that only the person that buys it can play it. I want to know if it's possible to make a "registration" window pop up when ...
4
votes
2answers
739 views

Detecting collision on a grid with a fast-moving object

I am working in a 2D collision system where I need to detect a collision of a rectangle on a grid, but since the rectangle may be fast enough to jump more than one of the grid squares (sometimes ...
0
votes
2answers
1k views

Rotate object Up/Down/Left/Right in any orientation

I'm rendering model at the origin with a fixed camera looking at it positioned on the z axis. I want to be able to rotate the model up/down and left/right. Currently I have 2 variables, ...
1
vote
1answer
390 views

Basic post-processing shader problem

I'm trying to create a basic post-processing shader, like I did many times before but somehow today it's just not working, I guess it's something basic that I missed. Anyway my setup: I have 3 ...
1
vote
2answers
1k views

How do I determine which side of the player has collided with an object?

I have some static bodies (platforms) and a dynamic body (the player) in my world. The collision between them works great, but I would like to know which side of the player (rectangle) collides with ...
2
votes
4answers
4k views

How to save a game state?

So I am currently working on a simple game project that most people start of with: "breakout". part of my goal is to make a gamesave of the current gamestate the simplest way possible. For example, ...
2
votes
1answer
360 views

Client Server UDP Jumping

I don't really think this is an issue with the fact that UDP can drop packets (I'm using Lidgren and using ReliableInOrder), but basically, in my game, the client send the input keys (if forward is ...
3
votes
5answers
957 views

GameplayScreen does not contain a definition for GraphicsDevice

Long story short: I'm trying to intergrate my game with Microsoft's Game State Management. In doing so I've run into some errors, and the latest one is in the title. I'm not able to display my HUD for ...
0
votes
2answers
160 views

GameStateManagement and inputs not being recognized

EDIT: I've removed a bit of code from the input class to make this more readable, and updated my StartScreen class, which is now at the bottom. I have the same issues though, but they are explained in ...
4
votes
1answer
781 views

XNA: Networking gone totally out of sync

I'm creating a multiplayer interface for a game in 2D some of my friends made, and I'm stuck with a huge latency or sync problem. I started by adapting my game to the msdn xna network tutorial and ...
0
votes
1answer
674 views

Initializing entities vs having a constructor parameter

I'm working on a turn-based tile-based puzzle game, and to create new entities, I use this code: Field.CreateEntity(10, 5, Factory.Player()); This creates a new Player at [10; 5]. I'm using a ...
0
votes
1answer
490 views

Creating movement path displays in a top-down 2d RTS

My game is a top-down 2d RTS coded in C# using SFML's libraries. I want that during unit selection, a unit will display it's movement path on the map. Currently, after the path is computed as a list ...
0
votes
1answer
198 views

XNA:Rectangles Movement Behavior

im trying to create simple pong game, and learning some XNA. im creating for each paddle 3 rectangles, who represnt the collision when the ball hit them, so i can dicide where to throw the ball back. ...
3
votes
0answers
228 views

How can I stop my Jitter physics meshes being offset? [closed]

I'm developing a C# game engine and have hit a snag trying to add physics. I'm using XNA for graphics and Jitter for physics. I am trying to split the XNA model into it's meshes, then create a ...
1
vote
1answer
1k views

Having troubles with LibNoise.XNA and generating tileable maps

Following up on my previous post, I found a wonderful port of LibNoise for XNA. I've been working with it for about 8 hours straight and I'm tearing my hair out - I just can not get maps to tile, I ...
1
vote
1answer
265 views

OpenAL seems to ignore sound attentuation/orientation for long sounds

I don't know how else to describe it in the title, sorry. My sound engine currently works perfectly with listener positioning and sound positioning to create the attentuation and panning effects. At ...
-2
votes
2answers
401 views

XNA: int as Vector2 so i can move sprite

I am really new XNA programming, and i am having a big problem. I have a Vector2, spritePosistion, that controls what position the sprite is at, now i want to move it by 1, every time that a player ...