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

6
votes
2answers
5k views

C# Perlin noise - generating “endless” terrain chunks?

I'm currently writing a little side scroller in C#, to both learn C# and have fun. Right now I have a simple random number generator generating the world but it isn't exactly all that great - so with ...
0
votes
1answer
2k views

C# multi-player socket server (need clarification/suggestions)

I've been working on an 2D-RPG for a while and I recently decided to make it into an MMO (not really massive, but multi-player). Anyways, I'm attempting to write a game server in C#. Yes, I know I ...
1
vote
1answer
502 views

Mouse click rectangle doesn't update to actual mouse position

I'm making a menu in XNA; and to solve clunky input via arrow keys, I thought I would use mouse input. I got everything to work perfectly, then I tried to click on something specific and nothing ...
0
votes
1answer
295 views

Is there an SDK to write console apps to simulate an Xbox 360 controller?

Is there any SDK I can use to write a console app that can connect to an Xbox 360 as a controller and simulate controller interaction?
6
votes
2answers
16k views

Resolution problems when porting a Unity game to Android

So, I'm porting a game to the Android for the first time in Unity3D. And I've run in to a few problems along the way. My current problem is the resolution doesn't seem to be right, it cuts off the ...
3
votes
1answer
315 views

How to stop a tap event from propagating in a XNA / Silverlight game

I have a game with Silverlight / XNA game where text and buttons are created in Silverlight while 3d is done in XNA. The Silverlight controls are drawn ontop of the 3D and I dont want a click on a ...
5
votes
3answers
705 views

Programming Languages Recommendations: A Space shooter game that allows two people to play [closed]

Do you remember an arcade game, that allowed two people to versus or play each other? It was a Galaga/Gradius type game. Me and a couple of other people I know want to make a game like this. We want ...
10
votes
4answers
1k views

How do I create user-friendly, unique game IDs?

How do I create unique game IDs which are also user friendly -- so that one user can easily give that game ID to someone else for joining the game. I am creating my game in Silverlight with C#.
1
vote
1answer
813 views

XNA game looks laggy below 100 fps?

My xna game is running at about 70-90fps and it looks laggy at this fps. I'm using fraps to record the fps and I have a 120hz monitor, over 120hz looks fine but I can't understand why it feels like ...
5
votes
3answers
1k views

Can I swap out Farseer physics fixtures at runtime?

I am working on a 2D side-scroller using Farseer Physics Engine v3.3.1. In order to create a realistic physical skeleton for the player, I am using a method similar to the one explained here (See ...
53
votes
7answers
5k views

What are the dangers of self-teaching game development? [closed]

I am about to embark upon a journey into game development. Following answers to my last question, I will be using C# and XNA. However, I don't personally know any other game developers and I don't ...
3
votes
3answers
918 views

Non-GPU Noise for 2D side-view terrain generation?

I really couldn't find a correct answer while scowering all the forums for Noise Generation. My goal is simple, I really want to have two distinct layers for my terrain, a white layer representing ...
2
votes
3answers
2k views

C# 2D Game Library?

I'm looking for a C# 2D game library based on something like OpenTK which wraps OpenGL for C# Basically something like Slick2D (2D game library for Java) which is based on LWJGL which is an OpenGL ...
5
votes
2answers
889 views

Detect Mip mapping level in the shader?

Is there a way to do this in pixel shader 2.0/3.0? I've got on or off transparency so when the mipmapping level is different the transparency can take up too much of the texture and make it ...
7
votes
2answers
1k views

Calculating a quaternion so a bone points in a specified direction

In an attempt to solve this question, I decided to figure out the absolute (world space) directions of each joint in the source pose (as normalized unit vectors), and then rotate the joints of the ...
2
votes
1answer
1k views

Getting started using C# and Physics (Resources, Tutorials, Samples, etc.) [closed]

As an application developer, I plan on now getting started in game development so I have come along to this site. I am a proficient C# developer so I guess it makes sense to start game development in ...
0
votes
1answer
1k views

XNA Calling Variables from separate Classes

I'm having some issues in XNA. I have a Player class and I would like to call a foreach function from a list which has been declared in the Game1 main class, which is below: public class Game1 : ...
0
votes
1answer
61 views

Primitives does not show on screen [closed]

I'm trying to render terrain, everything compiles fine, but I can't see anything on screen. ( I'm moving camera around in case it was on the other side) Can't figure out whats wrong. public class ...
2
votes
1answer
555 views

Odd offset bug in Farseer/XNA/C#

So I'm using Farseer to create an immovable object: [...] private Body body; public Immovable(World world, ContentManager c, String s, int posx, int posy, int w, int h, String user_data) { ...
5
votes
1answer
575 views

XNA Vertex buffer/Index buffer high memory usage?

I've got about 120mb of vertex and indices data, but when I set the data in the vertex and indices buffer it ramps up to about 300mb of memory used, this isn't really acceptable and I don't know why ...
0
votes
2answers
5k views

Check collision between instantiated objects?

I am using a script to instantiate multiple objects having rigidbody with different velocities at different positions. I want to destroy two or more objects when they collide, but I'm not getting ...
3
votes
2answers
392 views

Tessellating/Subdividing a quad

I am creating a quad that starts as a single quad, then divides itself multiple times (from 1 -> 4 -> 16 -> 64 -> 256 etc) but I have encounted an issue. When I get to 64 sub divisions only 16 quads ...
5
votes
1answer
846 views

Infinite 2D Terrain

I was wondering how to create infinite 2D platform terrain. I've read about perlin noise and I have an idea I'd like to illustrate below. However, I have no idea how to achieve this. Are there any ...
1
vote
1answer
146 views

XNA: weird collision behaviour

I'm reading the book "Learining XNA 4.0", and I'm in the object oriented disgn part. I'm having a weird problem with the collision of 2 rectangles. I have a list of automateSprite and a Player class ...
2
votes
1answer
297 views

Scripting: Loading all scripts at runtime vs loading scripts when needed

I'm using Boo as a scripting language in my C#/.NET game via the in memory compiler with it and I really love it, however I'm having trouble deciding when I should load my scripts. This is my first ...
1
vote
3answers
674 views

Pathfinding for units of variable size

I'm using a grid map for a top-down RTS, and using a* for pathfinding. Specifically, I've found one implementation which is heavily optimised, and I've been using it for a while, but now I've realised ...
1
vote
2answers
727 views

DirectX Flicker

I'm using DirectX 9 via SlimDX (C#). My screen flickers a lot during rendering. I dug a little deeper and see that the surface is being cleared early. Here's an example: ...
1
vote
2answers
515 views

Best practices, extending classes

I'm developing a game in XNA(C#) and I wonder what are the best practices for having different types of pads. For example I have 2 types of pads: Pad that just moves left (decreasing X coordinate) ...
1
vote
1answer
652 views

C# OpenTK - Getting world coordinates of points that are altered by matrices

I have written a skeletal animation system for a game i am working on. To draw lines that represent a skeleton, i use the GL matrix, and multiply it by each bone a long the body. For example before ...
1
vote
0answers
168 views

Farseer Physics EndContact events don't fire for all registered delegates

Here's my situation: I have several objects that contain a body and a fixture. They are set to sensor = true; atmosphere = BodyFactory.CreateCircle(world, atmosphereRadius / Level.METER_IN_PIXELS, ...
2
votes
1answer
222 views

How do I stop my game from Skipping Screens?

I used the code from this - http://www.xnadevelopment.com/tutorials/thestateofthings/thestateofthings.shtml (The second method using enumerations) I modified it to add a 3rd screen for gameplay and ...
0
votes
4answers
904 views

XNA transparent objects?

I've working on a voxel like game like Minecraft, but I'm not sure how I should handle alpha. I've got the world split into chunks and I render each chunk, I have things like leaves which have alpha ...
1
vote
1answer
1k views

Creating thrusters on a ship in Unity3D

So, I'm using the legacy particle "small flames". Basically what I want it to do is always emit below the ship, so when the ship turns and such it still looks like the thrusters are firing. I know ...
-2
votes
2answers
1k views

how to create a new game like pacman, snake, airplane fight game in C# with xna [closed]

I have a school project to create a game develop in c#.. I know all Basic of OOP and c#. I don't know where to start?.. Suggestion will appreciated Thank you
2
votes
3answers
827 views

How to I create a resource manager?

Currently I'm using XNA's ContentManager to load my content. For the unfamiliar the ContentManager deserializes classes from disk and keeps a reference for future requests. I'm currently facing a ...
0
votes
3answers
119 views

initialising units' properties & upgrades

I'm making a RTS in which units can get several cyber-upgrades (individual, not as a global tech-tree upgrade like in most RTS games) before they're created. Now, I'm trying to decide how to do this, ...
0
votes
2answers
2k views

How to Translate and Position at the same time?

Hi I'm having problem Translating and Positioning at the same time e.g take example of retro spacecraft shooting games in which your spaceship moved in x-axis automatically and you just needed to ...
1
vote
2answers
965 views

XNA 4.0 Point Vertex Rendering

I have a buffer of about 134 million particles and a very powerful computer to render them smoothly, but I am getting an error when trying to render them as primitive lines. It says that I cannot ...
1
vote
1answer
416 views

Public Static vs. Instanced Classes [closed]

I've seen a lot of rhetoric over the year about not using a Public Static class to store global variables or methods that are used across an application. I understand the philosophy about code ...
0
votes
1answer
2k views

How to make a top down shooter? [closed]

I want to know is with XNA 4.0 (and C#) How do I exactly make a top down shooter? I have been looking for ages, but have been unable to find out how. If someone could tell me how to get started with ...
2
votes
2answers
931 views

How to calculate the direction a ball must bounce

I have a tile engine I have made. I can detect collision between the ball(the player) and the tiles. When a collision is detected all the colliding tiles are stored inside a list. My question now is, ...
2
votes
2answers
2k views

Dealing with 2D pixel shaders and SpriteBatches in XNA 4.0 component-object game engine?

I've got a bit of experience with shaders in general, having implemented a couple, very simple, 3D fragment and vertex shaders in OpenGL/WebGL in the past. Currently, I'm working on a 2D game engine ...
6
votes
2answers
513 views

XNA ContentManager.Load causes string allocation

I was running the Visual Studio memory profiler on a project and noticed that an enormous amount of strings were being instantiated. It turns out that ContentManager.Load appears to create a new ...
0
votes
3answers
2k views

Designing an entity system for a tile-based puzzle game

I'm developing a tile-based game creation library in C# and along with it I'm creating a game to test all of its functions. This is a screenshot of the game: You've probably never heard of the ...
5
votes
3answers
561 views

Random monsters move in-sync instead of individually

I am making a game in which monsters spawn randomly and begin to move around randomly. I am fairly new at programming but not at game development. Through using a few tutorials I was able to make 1 ...
7
votes
1answer
4k views

Elapsed game time differs from total game time in XNA

I was trying three different ways of using ElapsedGameTime and TotalGameTime, because I want an exact match, so everything is updated/drawn accordingly. As I was experimenting, I learned that the ...
8
votes
1answer
1k views

How do I communicate with an IronPython component in a C#/XNA game?

My XNA game is component-oriented, and has various components for position, physics representation, rendering, etc, all of which extend a base Component class. The player and enemies also have ...
11
votes
4answers
4k views

How to deal with arbitrarily large images in 2D games?

Question When you have a 2D game that uses really large images (larger than your hardware can support), what do you do? Maybe there's some interesting solution to this problem that never occured to ...
0
votes
3answers
470 views

Model won't render in my XNA game

I am trying to create a simple 3D game but things aren't working out as they should. For instance, the mode will not display. I created a class that does the rendering so I think that is where the ...
9
votes
4answers
2k views

What technique should I use to facilitate communication between XNA GameComponents (or between components of any type in a game)?

I'm starting out on my first 'proper' game project, and I've inevitably hit a block trying to decide how game components in XNA should communicate. From previous (Java) GUI programming events, ...