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

3
votes
3answers
2k views

How many BasicEffects do you have in a Game? What is the best way to render multiple objects/shapes at once?

I'm trying to understand 3D rendering and it seems that everytime you render a new object (A 3D Cube or something) you need to have a new BasicEffect for each Box you render unless you want the exact ...
1
vote
1answer
287 views

JigLibX collision detection only once

I try to implement collision detection in latest JiglibX using this example http://jiglibx.wikidot.com/catch-collisionevents . I choose creating callback. I try to detect collision only once. When ...
3
votes
4answers
3k views

How can I improve my isometric tile-picking algorithm?

I've spent the last few days researching isometric tile-picking algorithms (converting screen-coordinates to tile-coordinates), and have obviously found a lot of the math beyond my grasp. I have ...
1
vote
4answers
912 views

Using elapsed time for SlowMo in XNA

UPDATE 2: I've tried to pass in GameTime to my Update method, just as I did for the bats, but I'm not seeing any change to the ball's speed. I've also changed my moveSpeed to: *moveSpeed += (15f * ...
-3
votes
2answers
283 views

Simple game in Android [closed]

In C# is there something like XNA which gives update or draw or other classes and methods for operating on vectors and matrices that works for Android? I want to make a very simple 2D game for ...
0
votes
2answers
4k views

How do I draw a single Triangle with XNA and fill it with a Texture?

I'm trying to wrap my head around: http://msdn.microsoft.com/en-us/library/bb196409.aspx I'm trying to create a method in XNA that renders a single Triangle, then later make a method that takes a ...
2
votes
1answer
294 views

What kind of performance issues does multiple instances of the exact same object have on a game?

I'm fairly new to programming, and I've pretty much learned all the things I know on the go, while working on projects. The problem is that there some things that I just don't know where to begin ...
-4
votes
1answer
185 views

Amazing Jutsu (Technique)

Hy..I'm newbie here.. Please does anyone knows, how to create such a character(sprites) to have a different Style Technique and different kind of movement, so he/she can alternate many technique to ...
3
votes
1answer
2k views

What is a normalized Vector?

Can someone explain the following code? I need to learn what each part means so I can turn it into enemy movement in a space shoot-em-up Vec2d playerPos; Vec2d direction; // always normalized float ...
1
vote
1answer
642 views

Trouble with SAT style vector projection in C#/XNA

Simply put I'm having a hard time working out how to work with XNA's Vector2 types while maintaining spatial considerations. I'm working with separating axis theorem and trying to project vectors onto ...
4
votes
4answers
2k views

How to handle cutscenes in XNA?

I am making a 2D RPG in XNA, and I want to be able to have basic cutscenes, kinda like those in the handheld Pokemon games. What is the easiest way to do this? Sorry for the vagueness of my question, ...
3
votes
2answers
1k views

XNA Spritebatch sorting by texture vs depth

I am refining my 2D game engine, and I want to look in to sorting sprite batches by texture (because I'm quite often using the same textures repeatedly). However, I also want to retain a few 'layers' ...
0
votes
1answer
681 views

Moving Character in C# XNA Not working

I'm having trouble trying to get my character to move for a game I'm making in my sparetime for the Xbox. However, I can't seem to figure out what I'm doing wrong , and I'm not even sure if I'm doing ...
2
votes
3answers
895 views

Creating a new instance, C#

EDIT: I've added bits of my GameplayScreen class so that you can see how my ball and bats are initialized. This sounds like a very n00b question, but bear with me here: I'm trying to access the ...
3
votes
4answers
1k views

Higher Performance With Spritesheets Than With Rotating Using C# and XNA 4.0?

I would like to know what the performance difference is between using multiple sprites in one file (sprite sheets) to draw a game-character being able to face in 4 directions and using one sprite ...
0
votes
1answer
701 views

Vector reflect problem

I'm testing some vector reflection and I want to check what happens when a ball collides with a paddle. So if I have: Vector2 velocity = new Vector2(-5, 2); position_ball += velocity; if ...
2
votes
1answer
1k views

XNA Skinning Sample - exporting from Blender recognize only first animation clip

(and sorry for my English) I'm using animation components from XNA Skinning Sample. It works great but when I export a model from Blender, it does not recognize any other animation clips than the ...
1
vote
1answer
1k views

Interpolation between two 3D points?

I'm working with some splines which define a path a character follows (you can see a gameplay video here to get a better understanding of what's going on: http://www.youtube.com/watch?v=BndobjOiZ6g). ...
1
vote
2answers
504 views

Do I need to use the Kinect SDK to develop for Xbox?

I was wondering if I need to use the Kinect SDK from Microsoft to develop games for the Xbox 360. I know there are other libraries such as OpenNI and OpenGL, but can I develop games using Kinect for ...
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
437 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
416 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
839 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
696 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
871 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
437 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 ...