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
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
551 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
677 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
520 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
360 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 ...
-1
votes
3answers
423 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
613 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
440 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
359 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
6k 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
434 views

Starting Game Development in C# [closed]

Whats the best way to start game development in C#?
0
votes
4answers
402 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 ...
6
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
417 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
1k 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
689 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 ...
0
votes
1answer
1k views

Drawing a 2D Coordinate Map

I'd like to draw a 2Dimensional coordinate system using C#. Unfortunately, in terms of a graphics rendering engine, XNA is out of the question since I'm running Linux. Thus, is this possible without ...
0
votes
1answer
132 views

Declaring controls in multi form/usercontroll game

In my game I have 2+ forms and 4+ usercontrols. Where should I declare, lets say a textbox that I use in form2, but I need to modify it in form1. Should I make them public in their own ...
1
vote
1answer
347 views

Wise approach to becoming good at C# XNA

Would finishing an entire course about C# at HomeAndLearn.co.uk and then jumping into XNA be a wise path to take? Ultimate goal is to create a multiplayer 2D game.
5
votes
3answers
2k views

2D Platformer Collision/Physics Problems

I'm making a 2D platformer similar to Terraria, although I'm having some problems with some collision detection code. I'm using the code from the AppHub Platformer sample, but tweaked so it fits with ...
5
votes
3answers
352 views

How can I store information about what cells are connected to others in a 2D array?

I have a 10x11 array in my game. What is the best structure and way to store the connections between the elements of the array? Some info about the connections: they are simple (2 elements are ...
10
votes
1answer
429 views

Enum Vs. Integer for Skill Values

I'm implementing a basic skill and attribute system, though I'm having second thoughts about how I should go about it. For example, I could use a Dictionary/HashMap which uses SkillType enums to ...
3
votes
2answers
557 views

Problem with bounding box in model space and intersection with ray

I have a bounding box in model space and I want to intersect it with a ray. I have tried to transform the ray like this. Rotating and scaling works well, but transition does not. Here is my code: ...
11
votes
4answers
2k views

Are there any frameworks that allow me to write games in C# on Linux? [closed]

I'm looking for something like an alternative to XNA - I don't care whether it's a 2D or 3D engine. It's not because I dislike Windows or am anti-Microsoft; it's because I like running Linux, code in ...
3
votes
2answers
2k views

How can I draw multiple lines connected via “nodes” with SlimDX?

I currently read out XML data with the following scheme: Position x,y,z I try to add one new Vertex for each position node and add it to a Vertex array. Then I try to render this list of vertices so ...
5
votes
1answer
713 views

Perlin noise - copying the algorithm on the CPU?

I have successfully made a Perlin noise algorithm on the GPU. It works as expected, and generates great results. Now, as part of the physics calculations in my game, I need to replicate the exact same ...
1
vote
1answer
179 views

An ellipse outside two points?

I am trying to generate an ellipse outside two points (two-dimensional vectors). Is there a formular for that, or a cool way of doing that in C# XNA? What I am trying to do is have a particle circle ...
1
vote
3answers
844 views

Optimizing perlin noise generation

I have a perlin noise generator as shown below. public class ImprovedNoise { private const int GradientSizeTable = 256; private readonly Random _random; private readonly double[] ...
22
votes
4answers
2k views

Momentum and order of update problems in my physics engine

This question is a "follow-up" question from my previous one, regarding collision detection and resolution, which you can find here. If you don't want to read the previous question, here's a ...
3
votes
1answer
373 views

Component System - Editor Data Management [closed]

I'm trying to construct an editor in C# that exposes game components to IronPython, so it may create the game object definitions to be used within the editor: C# Exposes the components to the python ...
0
votes
2answers
496 views

C# XNA Framework Paddle Collision Problems

I am trying to make a pong game that uses a burger as a ball and a plate as its paddle. I have everything right except that the burger goes right through the plate. Can anyone help me? using System; ...
16
votes
4answers
1k views

Game engine: a decent way, architecture-wise, to implement scripting support?

I am developing a simple game engine (in C#, if it matters), and I can't think of a decent enough way to implement scripting in terms of architecture. It's a simple turn-based strategy with custom, ...
1
vote
1answer
2k views

2D Physics Engine for Platform Games - Riding on a Platform

I have a number of questions relating to using a 2D physics engine in a platform game, but one main one that I'm grappling with at the moment. I managed to somewhat integrate the Physics2D.Net engine ...
10
votes
3answers
2k views

What are some great and useful resources for an Isometric game built on the XNA Framework? [closed]

I'm currently working on an isometric game using the Microsoft XNA Framework. I'm looking of resources that would be of use for making this a successful project, such as isometric engines, physics ...
11
votes
3answers
691 views

I want to get rid of my make-everything-static-and-global design pattern, but how?

I'm making a little dungeon crawler in space, and I'd like to hear some advice on how to make the backend of the engine nicer. Basically, currently everything is based on a crapload of managers: ...
0
votes
2answers
257 views

Some questions about lists

I've been looking for articles or tutorials on this and I can't seem to find any, so I thought I'd ask here. I've created a bullet class in my game that is added and removed through a list. If I'm ...
-4
votes
1answer
2k views

C# vs Java for Cross-Platform Game Dev [closed]

What would be better for PC (Windows, Linux, Mac) games? I know Java is more mature/older and has a giant user base, but I see C# (Mono) slowly rising and showing that it has a growing user base as ...
2
votes
2answers
540 views

How can I fix my combo system?

I'm working on my combo system and I keep getting this weird problem. It's a pretty basic setup: when the player hits the attack button it changes the character's current action to "attack", if the ...
9
votes
4answers
4k views

2D Spatial partitioning alternatives to spatial hashes and quadtrees

I've been trying to implement a spatial partitioning algorithm in my game, but both spatial hashes and quadtrees aren't what I'm looking for. My level size is not supposed to have a limit (only Int32 ...
17
votes
3answers
1k views

Recognizing a hexagonal clickbox

I'm working on a game that is going to involve gasp hexagons. At present, I have a hexagon image that I am using (all sides are the same length...it fits into a 50px by 50px image). I am somewhat ...
-2
votes
1answer
267 views

Problem while loading an image for a texture

I have built a slideshow in slimDX and is scrolling a text at the bottom of the images. But I am running through a problem that when my new image is loaded in by the help of Texture.FromFile() ...
17
votes
1answer
8k views

Orienting a model to face a target

I have two objects (target and player), both have Position (Vector3) and Rotation (Quaternion). I want the target to rotate and be facing right at the player. The target, when it shoots something ...