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

2
votes
3answers
1k views

Detect click on Triangle and Circle buttons

How can I detect clicks on a texture (which will be a button in my game) which has the form of a triangle or circle. I only know the rectangle solution which uses the position, width, and height; ...
8
votes
2answers
411 views

Platform jumping problems with AABB collisions

See the diagram first: When my AABB physics engine resolves an intersection, it does so by finding the axis where the penetration is smaller, then "push out" the entity on that axis. Considering ...
1
vote
3answers
600 views

How do you transition to playing in XNA?

I have two classes in my game, a Main Menu and the main playing screen. How can I swap through classes? E.g I click on "New Game" in the menu class and it changes it too the Game class. A transition ...
0
votes
2answers
1k views

Thread problem updating Windows Forms control in XNA C#

I'm development a network card game, and for now i've two players connected but there is a problem with one of them, this one can't do anything on the game. Looks that screen was blocked. I'm think ...
1
vote
2answers
1k views

Pixel Shader Giving Black output

I am coding in C# using Windows Forms and the SlimDX API to show the effect of a pixel shader. When I am setting the pixel shader, I am getting a black output screen but if I am not using the pixel ...
1
vote
1answer
362 views

XNA ignoring the Z-coordinate?

XNA seems to be ignoring my Z coordinate. There is no form of Z-culling at all it seems. How come? I am doing an orthographic projection, and clearing the depth stencil buffer for every draw-call. My ...
6
votes
3answers
3k views

XNA - Static classes from game libraries executing after content pipeline extensions, how to avoid the problem?

Alright, formulated this way I'm sure it sounds obscure, but I'll do my best to describe my problem. First, let me explain what's wrong with my real source code. I'm making a platformer, and here ...
5
votes
2answers
4k views

Are there .NET bindings for Autodesk's FBX SDK?

I'm writing a tool in C# that needs to open FBX files (and the XNA content pipeline isn't a suitable solution). I note that Autodesk only provides it's FBX SDK as a C++ class library. Before I write ...
2
votes
1answer
428 views

Does SoundEffect.CreateInstance load from file everytime?

This is something which has been bugging me. If I create a SoundEffectInstance via SoundEffect.CreateInstance() I'm meant to dispose of it when I'm finished with it. SoundEffect.CreateInstance() does ...
8
votes
2answers
1k views

Scale my pixel art files when designing them or when rendering?

If I create pixel art files that need to be scaled up on the screen later, so that a single pixel becomes a box of 4 pixels. Should I create my pixel art with 2x2 pixels or should I create it with 1x1 ...
2
votes
3answers
1k views

Creating addons for any game?

I want to be able to create addons for any game, the example I will use is League of Legends. With addons I mean, for example when my level integer changes I want to play a sound in the background. ...
5
votes
5answers
2k views

Getting Started With Web-based Games…Can I Reasonably Target Flash And Silverlight And HTML5?

I come from a .NET background and I've done a few simple things in Silverlight. I'd love to adopt that and make my site and games Silverlight only; but I hear it has a fairly low install base. I ...
3
votes
1answer
481 views

Count number of Vertices in VertexBuffer in XNA 3.1

Where in XNA 4.0 one can go: myVertexBuffer.VertexCount; What is the best way to count the number of vertices in 3.1 for a dynamic buffer (i.e. where I do not know the number of elements that ...
2
votes
1answer
337 views

XNA Framework and looking around relative to the world instead of camera?

So I've been toying around with creating a game in the XNA framework. A great place to start is simply being able to move and walk around. I kinda have looking around... I start off with the camera ...
28
votes
6answers
9k views

A way to store potentially infinite 2D map data?

I have a 2D platformer that currently can handle chunks with 100 by 100 tiles, with the chunk coordinates are stored as longs, so this is the only limit of maps (maxlong*maxlong). All entity positions ...
11
votes
2answers
12k views

How do I generate projectiles toward the mouse pointer? [duplicate]

I'm making a top-down space shooter where the player controls a ship and can aim and shoot using the mouse cursor. How can I fire bullets from the ship at the angle from the ship to the mouse cursor? ...
3
votes
1answer
1k views

Drawing a depth map properly

I want to render a depth map by importing it from a file, then creating an array of vertices and indices, and then displaying it using a basic shader (just apply the view and projection matrices on it ...
7
votes
1answer
2k views

XNA Quadtree with LOD

I'm looking to create a fairly large environment, and as such would like to implement a quadtree and use LOD on it. I've looked through numerous examples and I get the basic idea of a quadtree. Start ...
2
votes
2answers
201 views

Collisions between players at spawnpoints

I am working on a FPS/MMORPG and ran into a problem at spawnpoints, when I enabled collision detection between players. Neither player would be able to move if both spawned at the same time, because ...
6
votes
2answers
3k views

How do I draw anti-aliased holes in a bitmap

I have an artillery game (hobby-learning project) and when the projectile hits it leaves a hole in the ground. I want this hole to have antialiased edges. I'm using System.Drawing for this. I've tried ...
10
votes
5answers
911 views

Nested input in an event-driven system

I am using an event-based input handling system with events and delegates. An example: InputHander.AddEvent(Keys.LeftArrow, player.MoveLeft); //Very simplified code However, I started wondering ...
3
votes
4answers
671 views

Vary speed of enemy smoothly

Hey. I'm trying to create an enemy that travels at a speed s on screen but I'm having trouble with trying to make the speed vary in a smooth motion. Basically, I can get the enemy to move at a ...
4
votes
1answer
954 views

Implementing Wall Jumping

I've read this wall jumping question but I'm having trouble implementing it. I've gotten as far as implementing a timer that controls when wall jumping is possible. Right now, if I go up against a ...
-1
votes
2answers
546 views

How to do gradient transitions using slimdx?

I am making an image slide show using slimdx and c#. Till now I have done transitions using the matrix transformation but now I am trying to make transitions using some gray scale background image. ...
7
votes
5answers
4k views

Best pathfinding algorithm for a tower-defense game? [duplicate]

What do you suggest would be the best algorithm for a tower-defense game? It's a 2D based tile game, where there is walls and towers blocking the way, between spawnpoints and their destination points. ...
5
votes
6answers
2k views

Making classes available to others

I'm currently working on a 2D game engine in XNA, and I am very interested in architecture, and how best to let my game objects communicate. I know a lot of people use a Singleton design but I ...
0
votes
2answers
665 views

How do i get my tilemap to move at the same speed as my character

I have a little problem in my solution, i'm trying to make a pretty big map for the players to walk around in. I decided to use a tile-engine, but when I move my character it moves faster than my ...
6
votes
2answers
3k views

Rendering multiple textures on a terrain in XNA / C#

I am working on a terrain in XNA/C#. My intention is to be able to render multiple textures on the ground across the terrain. However, all tutorials like this are only capable of doing it with about ...
9
votes
2answers
4k views

Online multiplayer game basics [closed]

I'm currently working on a c# online multiplayer game in real-time. The aim is to have client/server based connection using the UDP protocol. So far I've used UDP for players' movements and TCP for ...
4
votes
2answers
771 views

Engine with Terrain and Indoor Areas (BSP-like)

I'm not really a graphics programmer, but I used to toy around with Truevision3D 6.5 a few years ago. It wasn't too bad, but TV3D was just going nowhere so my foray into 3d game dev ended there. I ...
1
vote
1answer
896 views

moving 2D camera

I've got a camera that places the character about a 1/4 way into the screen. The problem I'm having is that when the character moves left the character stays in place now placing the character 3/4 the ...
3
votes
1answer
405 views

Skin Editing/Overlaying bullet holes

You see, especially in FPS games, when a bullet hits a wall or a character, etc. You end up with the bullet hole. Is this usually done with the actual skin temporarily changing, or just an overlay of ...
0
votes
2answers
248 views

How do I determine which card is underneath the currently-dragged card in a card game?

I'm developing a card game. My custom control works great, but I need help to solve this: When I move a card (my custom control) over another card I need to know which card is underneath. Once I know ...
22
votes
6answers
7k views

What designs are there for a component based entity system that are user friendly but still flexible?

I've been interested in the component based entity system for a while, and read countless articles on it (The Insomiac games, the pretty standard Evolve Your Hierarchy, the T-Machine, Chronoclast ... ...
6
votes
1answer
2k views

XNA Aquatic Distortion Effect

I'm currently developing a 2D, top-down Windows Phone 7 game involving the surface of a pond. I'm trying to make the surface feel like actual water (as opposed to just a blue background with sprites ...
6
votes
1answer
3k views

Developing a card game framework

What sort of design patterns and ideas might one use to build a somewhat general purpose card game framework? This stems from I made an attempt to build a clone of the popular Steve Jackson game ...
2
votes
2answers
259 views

rendering a spritebatch to a temporary buffer and then offset that to the main screen

I've been trying to figure out how to do this but I have a bunch of screens, each with their own Draw method. However, I'd like to render all sprites offset by the screen position without altering ...
5
votes
1answer
427 views

How to balance a ball on a rotating plane?

I'm doing some research and I really don't want a physics engine when a simple mechanism will do. I have a ball that will be balanced on a plane. The ball will always be "stuck" to the plane and ...
5
votes
1answer
3k views

Mouse location is off due to camera

I'm building a top down shooter but I have a little issue with my camera and mouse. When I add the camera that I use to my game (see here) my mouse pointer seems to be in the wrong location. When I ...
3
votes
1answer
381 views

What type should you use for keeping game score

Lets say you have a high scoring game like geometry wars, why type would you use for the score and how should you handle overflow?
5
votes
2answers
952 views

What are the most suitable 3D sound engines out there for a FPS?

We are looking for a good 3D sound engine for a game written in C#. We know of irrKlang, which looks great but isn't free for commercial uses, nor is it open source. XNA has an alright one, but it ...
12
votes
4answers
2k views

RTS Game AI Thread

I have a project to make a real-time strategy game from scratch. I am still at the early planning stage, but I have been programming a little to see the mechanics. I know how to program. I also have ...
4
votes
2answers
548 views

What platform should I use for a master server?

We are making a small FPS, and want people to be able to play it online and fetch a list of all servers from a master server. We only have experience in C#, and we have already written a master server ...
2
votes
2answers
142 views

Loop writing value error

I'm currently re working an editor got from a tutorial, but I'm having a problem. I'm making a call to an associative class for the form, which is supposed to get the original tile value and the set ...
7
votes
5answers
2k views

Why do objects interpenetrate in this simple collision solver?

The code below is from a Microsoft XNA sample here. This is quite a simple rigid body simulation that ignores many physical effects (such as angular momentum), but it does try to push objects ...
1
vote
0answers
194 views

Using extension methods through the TryInvokeMember override of a DynamicObject [closed]

I feel like I need to give a little background information on why I'm doing what I'm doing, because I want to open it to suggestions and criticism, and give hope to Blender-using XNA programmers that ...
3
votes
2answers
345 views

Experienced coder/designer moving into game development - what's involved?

I am interested in moving into game development once my current project is done, as it's nearly at a point where it will pay my bills and allow me to hire someone else to take the driver's seat, ...
7
votes
1answer
2k views

Rotate object to face player

This is probably a simple vector question, but I'm not sure how to do it. I have an object at vector position (ox,oy). Potentially every update, the user walks around the screen, and will be at ...
5
votes
1answer
241 views

Splitting an object into two

I'm using Farseer physics engine. I have a simple rectangle body and would like it to split into two pieces given a starting coordinate (where the bullet enters the object) and ending coordinate ...
4
votes
1answer
801 views

In an artillery game how do I mask out the part of the terrain that was hit

Let's say I want to make a really simple artillery game, something like Gorillas. I don't have any experience in games, just some basic understanding of OpenGL. I want to do this for fun and to learn ...