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

1
vote
1answer
1k views

Line segment / circle intersection - X value seems wrong?

Major Edit I'm making a Breakout clone, and having difficulty with collision detection between a circle and line segment. Apologies, my earlier question was a result of frustration and no sleep :) ...
8
votes
1answer
6k views

Get position of point on circumference of circle, given an angle?

I would like to know how to get a specific point on the circumference of a circle, given an angle. The diameter of the circle is 1, and the center point of the circle is { X: 0.5, Y: 0.5 }.
3
votes
1answer
2k views

2D circle / rectangle collision detection issue - brief overlap

I'm currently trying to build a Breakout clone as a first step into game development. I'm using the following collision detection code (adapted from ...
2
votes
1answer
435 views

tiled map - changing textures? (XNA HLSL)

I have successfully created a tiled map of various textures. Right now, i had a Vector4 in my own custom Vertex declaration deciding what texture each of the tiles should be. This is working ...
4
votes
1answer
2k views

How do I create a CPU read/write buffer in SlimDX (what are the legal combinations of Usage and CPUAccess flags)?

Currently, I create a vertex buffer in SlimDX like so: SlimDX.Direct3D11.BufferDescription Description = new SlimDX.Direct3D11.BufferDescription(); Description.BindFlags = ...
1
vote
1answer
678 views

Rendering fancy particles?

I'm making a tower-defense game for Windows (not phone) in XNA. I've seen this video of another tower-defense game for Windows Phone that uses particle effects, which I really like. They change ...
9
votes
1answer
3k views

Wave ripple effect?

I've been working on a tower-defense game for some time now, and so far I am really satisfied with the results. However, there's one thing I'd like to add. I've seen a video of GeoDefense for Windows ...
0
votes
2answers
198 views

In XNA, is there an issue with copying/pasting the using statements to each .cs file?

When I'm working on a project in XNA I copy the using statements from file to file. However, on tutorials I've seen for various games, they show files that only have specific using statements used. Do ...
4
votes
1answer
635 views

C# 2D Game Design/Architecture Question

I am developing a 2D game for windows phone using C# and XNA. I have a list of screens managed by an engine. each screen has a list of components like 'camera', 'skyBackground', 'landBackground', ...
2
votes
2answers
816 views

How to get started in Card Games

My end goal is to play a card game with my friends from other locations over the internet. I am going to start with a card game like blackjack and want people to be able to play in real time or close ...
1
vote
1answer
937 views

How to make a platformer character go DOWN a 315 degree slope?

Alright, so I got this code I'm trying to write, but the player won't go down the slope, it goes down and up perfectly on the 45 degree slope, but the 315 degree one is a mess. it goes "up" the ...
3
votes
3answers
1k views

is it possible to use c# GUI toolbox in an XNA app?

I need both reach GUI features of c# toolboxes and fast rendering features of XNA, is there any way to merge these two into one app? or is there any other way? for example some equivalent to c# ...
6
votes
9answers
2k views

Is it essential that I learn Try/Catch and Finally statements for Game Programming, or is it something I can come back to? [closed]

Doesn't seem like something that would be an essential part of GAME Programming.
2
votes
1answer
490 views

C# different resolutions compatible application

Can you give me a quick tour for an application which has to work in different resolutions. It's a game, with lot's of graphics and images and effects. We are using C#. The game is simple 2D, looking ...
1
vote
3answers
804 views

create an event for every enum value (game action handeling)

I'm currently working on creating an input-action system for my game. I simply wanted an easy way to map an ingame action to a certain key. I've managed to do so with the following method: Create a ...
3
votes
2answers
2k views

Raycasting in Unity3D?

I have a game object on screen represented by a cube (but say it was a quad or something else all the same). How do I raycast to check intersections? Keeping in mind I may not be raycasting fora ...
3
votes
2answers
2k views

What is the “DirectX for Managed Code Update”?

I came upon this site while looking for information about working with DX in managed code and saw that MS released something containing a 'DirectX for Managed Code Update'. This sounds promising but ...
4
votes
3answers
1k views

Rendering tiles on 3/4 perspective

Using a 3/4th perspective, I'm trying to create a way to render cliffs where nothing is overlapped, and it creates an accurate representation of the elevation. This is a rough mockup of how it might ...
3
votes
2answers
939 views

XNA C#: How can I prevent blurring when drawing from a RenderTarget2D?

I'm making a game and I want the end graphics to look chunky and pixellated, so I'm drawing from the spritebatch onto a RenderTarget2D which is 1/4th the size of the actual backbuffer, and then ...
1
vote
1answer
113 views

Issue With Image Rendereing

I'm pretty New to the XNA Side of things, I have built in PhotoShop a Set of frame by Frame images side by side to go through an animation class to display them frame by frame. With this my images ...
3
votes
1answer
1k views

How do I implement SkyBox in xna 4.0 Reach Profile (for Windows Phone 7)?

I'm trying to Implement SkyBox in my phone game. Most of the samples in the web are for HiDef profile, and they are using custom effects (that not supported on Windows Phone). I've tried to follow ...
6
votes
4answers
2k views

How do I add Different Screens to my C#/XNA Game?

I'm working on a Pong clone in XNA. Gameplay-wise, I have it where I want it to be. I want to add a title screen and some other screens to it like a menu, as well as a screen for the Winning/Losing ...
3
votes
2answers
1k views

XNA game randomly drops to 40fps

I have a fairly straight forward 2D game written in XNA. I'm finding that it arbitrarily drops from 60fps to 40fps. I've tested this drop extensively and have concluded it's not related to graphics ...
6
votes
1answer
565 views

Linking nodes algoritm for Visual Design

I'm developing an editor for my game, and now it's time to make a visual scripting system to let designer modify behaviours. This video shows what i have done and the problem to resolve the link ...
5
votes
4answers
616 views

Debugging tips? [closed]

I'm new to games programming and I'm working on a C#/XNA project. Something I'm spending a lot of time on is debugging. Obviously as games run in a loop finding the exact iteration that a bad ...
3
votes
3answers
4k views

Getting the angle between two objects?

I have a set of boxes which create a sort of path, they don't intersect very smoothy and to help that process I'm trying ot find a way to get an angle between them that can make it easier to generate ...
0
votes
1answer
179 views

Is it possible (from the vertex shader) to always draw at specific pixels?

I am wondering if I can (if possible) make a vertex shader that will always make the pixel shader draw everything in 1 pixel, at position 0,0. I know this sounds crazy, but it's needed in the ...
3
votes
2answers
523 views

Crafting recipes: storage and quering

Consider following situation. In a game you can perform crafting: i.e. create new items from existing ones (like in Minecraft). I have following game entities (simplified): item: atomic part; ...
4
votes
1answer
668 views

C# Top down movement limitation

I'm using C# and Visual Studios 2010 with XNA 4.0+lua, and my teacher has asked us to make a 2D RPG game similar to zelda(top down). I was aiming to use just one image for each map region, instead of ...
0
votes
2answers
492 views

DirectX 10 - determining if hardware device is available

I am writing an offline renderer using SlimDX and Direct3D 10 that will need to be run on machines without graphics cards (servers). On these machines, I'll be using the WARP software renderer. Is it ...
12
votes
2answers
3k views

Inheritance vs Composition

I make my money in C# Generally in that language I like to decouple everything to the high heavens using interfaces. This has served me well in enterprise code but in writing games in C# I find myself ...
4
votes
1answer
352 views

How do I check if a key is down in XNA when I'm only given a string that has the key's name?

I'm trying to get access to the keyboard state in XNA from an embedded JavaScript runtime. I'd like to do something similar to the following, but I can't seem to figure out how to get from "Left" to ...
-2
votes
2answers
406 views

Move camera on X and Z only

How would you implement movement on a camera in order to always move it on X and Z coordinates, and if the camera has pitch yaw or roll it still moves only in those coordinates and doesn't fly up?
0
votes
1answer
549 views

Heuristic Calculation for pathfinder

I've been modifying a pathfinding example from XNA Pathfinding example as described in my previous question Link to question here I had an issue where the character moved kept moving back and forth ...
5
votes
2answers
4k views

Direct2d off-screen rendering and hardware acceleration

I'm trying to use direct2d to render images off-screen using WindowsAPICodePack. This is easily achieved using WicBitmapRenderTarget but sadly it's not hardware accelerated. So I'm trying this route: ...
1
vote
2answers
2k views

Create a body of an irregular 2D sprite in Farseer

I'm trying to create a body of a irregular 2D sprite Farseer 3.3.1. The regular shapes that BodyFactory provides are not that I want. Is there a way that one can create irregular objects? Could it be ...
2
votes
1answer
1k views

XNA: Texture2D.GetData runtime error

I am trying to get the colors of the top left pixel in an image, I use this code: using (FileStream stream = File.OpenRead(animationFile)) { animation = Texture2D.FromStream(graphicsDevice, ...
2
votes
2answers
433 views

Pathfinder not acting correctly

I've taken the A* Algorithm from this example XNA Pathfinder Example so that it will be able to plot a path for a moving goal. The issue I'm having is that it will go in the right general direction ...
3
votes
1answer
1k views

XNA Webcam video

How can I embed a video in a XNA application? I'm developing a card game with XNA C# and I need to send webcam video between four machines. Could anyone give me some tips about that?
8
votes
2answers
356 views

What would be the best way to find an open space in a level?

I'm working on a 2D game where you use paint to add tiles to a level and right now I'm working to add warp tiles. I have it set up so certain direction-oriented paints use two points (a start and end) ...
8
votes
3answers
5k views

How do I make objects move along a path?

I'm trying to get something like the below image. As you can see, there's a highway and inside of it, there'll be some objects moving (millisecond). I guess the street behavior is like a pipeline. ...
-1
votes
1answer
426 views

Starting Game Development in C# [closed]

Whats the best way to start game development in C#?
0
votes
4answers
396 views

Pickup another book or submerge into XNA [closed]

Completely read Head First C#. Should I read something else or get personal with XNA from here on? Got links? Edit: Hobby. Interested in 2D and 2.5D gamedev for personal fun, nothing serious. ...
9
votes
3answers
4k views

Efficient Method of Rendering Massive Terrain in XNA

I'm creating an XNA game that requires a huge space for players. Currently, the test heightmap I'm using is 4096x4096, and is saved as a 4-bit BMP. What I'm trying to do is take that huge heightmap ...
5
votes
3answers
2k views

XNA 4.0: 2D Camera Y and X are going in wrong direction

I asked this question on stackoverflow but assumed this might be a better area to ask it as well for a more informed answer. My problem is that I am trying to create a camera class and have it so ...
2
votes
1answer
358 views

C# Game Setting message Takes away first character

So If you set it to like abcdefg it will come out like bcdefg Here's changing the message Here's the result Here's the code //Set Welcome msg else if (Type == 6) { if ...
1
vote
1answer
959 views

XNA 2D Transform Matrix Scale at Zoom Question

This is the complete code I am currently using for my camera. It is incomplete and only partially understood by me (I am working off an example), but I have managed to hack some functionality with ...
5
votes
4answers
1k views

Database structure for a trading cards video game (TCG)

Just started and after pondering with registered users' table everything came to a halt. So far I've got: +----------------------+ | tblUsers | +----------------------+ | ...
-5
votes
3answers
5k views

XNA source code projects samples [closed]

I'm looking for good project samples of XNA who containing GameObject class, since I'm having problems with it and I'd like to get the idea of it. Can anyone post a link for downloading source code ...
1
vote
2answers
675 views

Why isn't my player movement code working properly?

I'm making a text-based RPG. One thing I've been trying to implement for a long time now is the ability for the player to move North, South, East, or West. I have my code placed in a MoveBehavior ...