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
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 ...
-2
votes
1answer
262 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() ...
11
votes
3answers
686 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: ...
-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
528 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 ...
46
votes
7answers
5k views

2D Platformer AABB collision problems

I have a problem with AABB collision resolution. I resolve AABB intersection by resolving the X axis first, then the Y axis. This is done to prevent this bug: http://i.stack.imgur.com/NLg4j.png ...
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 ...
0
votes
2answers
896 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 ...
-8
votes
1answer
1k views

Alternative to C# and XNA? [closed]

I'm interested in Game Development, I know OOP programming and so, but I never used a Stable Language. My favourite language is Java, but people say that is not a good Game Language, since it can be ...
3
votes
1answer
446 views

Problems making my basketball bounce around horizontally

This is probably a very easy question, but I can't seem to understand why it's not working. I want the basketball to bounce horizontally when it touches the borders on the right and left, but when it ...
4
votes
1answer
1k views

Turning a sprite such that it rotates in the direction that's most efficient

I have a sprite that moves from waypoint to waypoint. It turns to face its velocity vector, but not instantly (there's a rotation speed). The problem I'm having is, from one direction to another, the ...
4
votes
2answers
567 views

Deferred lighting and projective texturing?

Is posible to use this technique with deferred lighting?
9
votes
1answer
375 views

How can I incorporate physics into a procedurally generated world from a geometry shader?

Essentially I want to remove the need for generating coherent noise from the CPU to the GPU. From there, I also want to generate the terrain for a three dimensional world using this noise as densities ...
35
votes
8answers
4k views

How are deterministic games possible in the face of floating-point non-determinism?

To make a game like an RTS networked, I've seen a number of answers here suggest to make the game completely deterministic; then you only have to transfer the users' actions to each other, and lag ...
5
votes
5answers
7k views

Moving from XNA to Android

I've been using XNA to learn game programming for some time, and I'm interested in moving to Android. Having said that; the learning curve to get started seems to have ramped up exponentially. I ...
-3
votes
1answer
669 views

Where & How to start?

I want to start a new development of a Online 3D Card Game. I have alot of expirience in C# .NET and Sockets and everything. I started to play with XNA Game Studio, but i found it a mass. No Visual ...
1
vote
1answer
239 views

Accessing archived assets - what are the options in C#?

We are looking to add an archiving system to our game, where the assets (textures, scripts, sounds, etc.) will be located and directly accessed from memory. The main requirements are: Files must not ...
6
votes
2answers
3k views

How do I access variables in the Game1 class from another class in XNA?

I'm trying to write a SpriteManager class in XNA, but I need access to the Game variables. For example, the Game.Content property would be very helpful in loading textures, and ...
2
votes
2answers
2k views

How do I get access to the SpriteBatch service in my Sprite class using XNA?

I have the following Sprite class (leaving out everything that doesn't pertain to my question): public class Sprite { public Texture2D Texture { get; set; } public Vector2 Position { get; ...
6
votes
3answers
779 views

XNA Content Pipeline With Map Creation Utility

I've been looking into how to use the XNA Content pipeline appropriately for a game I am working on. I have however been having a hard time wrapping my head around it and am not sure on the best way ...
3
votes
1answer
336 views

Problem drawing text in a for loop

for (int i = -5; i < 5; i++) { Rectangle screenRectangle = new Rectangle(0, 0, screenWidth, screenHeight); spriteBatch.Draw(foregroundTexture, screenRectangle, Color.White); Rectangle ...
4
votes
1answer
343 views

XNA 4.0 keeping fonts/sprites without the use of a content project

Note: The actual title of my question does not really reflect my problem but is actually one of the possible solutions to my problem. I couldn't find a proper way to express my question so feel free ...
4
votes
1answer
708 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 ...
5
votes
1answer
535 views

How can I pass an external instance to the constructor of an object that's being created using the default XNA XML content loader?

I'm trying to understand how to use the XNA XML content importer to instantiate non-trivial objects that are more than a collection of basic properties (e.g., a class that inherits from ...
1
vote
1answer
224 views

Timer not going off

I've got a timer in my game which is supposed to set off a Boolean back to false after a certain amount of time has passed it just doesn't seem to work despite me trying to debug the issue, although ...
3
votes
2answers
970 views

C# Network Game Programming

I already know how to write games in C#, and I've learned the concepts behind network game programming, and created a working multiplayer game that works over LAN. As an example, somebody runs the ...
4
votes
1answer
418 views

Suggestions for implementing a dynamic 2D level

I am working on a game that needs a level that is completely generated. Currently my approach is to draw textures for the levels pixel by pixel during the game (in XNA with SpriteBatch). This is too ...
7
votes
1answer
853 views

Scrolling a WriteableBitmap

I need to simulate my background scrolling but I want to avoid moving my actual image control. Instead, I'd like to use a WriteableBitmap and use a blitting method. What would be the way to simulate ...
1
vote
1answer
4k views

Where to find free platformer sprites for commercial use? [duplicate]

Possible Duplicate: Where can I find free sprites and images? I need some good 2d platformer sprites for a game i am making in C#. Can anyone suggest a good site or link? The sprites need ...
13
votes
3answers
1k views

XNA and C# vs the 360's in order processor

Having read this rant, I feel that they're probably right (seeing as the Xenon and the CELL BE are both highly sensitive to branchy and cache ignorant code), but I've heard that people are making ...
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 ...
7
votes
1answer
1k views

XNA - just a few more characters accepted in a SpriteFont

I have a SpriteFont in XNA, which has the standard 126 characters that are usable. However i would like to use the "ಠ" symbol in the game. So is there anyway of adding just a few more symbols that ...
8
votes
3answers
1k views

How to find 2D grid cells swept by a moving circle?

I'm making a game based on a 2D grid, with some cells passable and some not. Dynamic objects can move continuously, independent of the grid, but need to collide with impassable cells. I wrote an ...
4
votes
2answers
457 views

Accept keyboard input when game is not in focus?

I want to be able to control the game via keyboard while the game does not have focus... How can I do this in XNA? EDIT: I bought a tablet. I want to write a separate app to overly the screen with ...
9
votes
3answers
2k views

Creating Entity as an aggregation

I recently asked about how to separate entities from their behaviour and the main answer linked to this article: http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/ The ultimate concept ...
10
votes
3answers
801 views

Drawing particles as a smooth blob

I'm new to game/graphics development and I'm playing around with particles (in 2D). I want to draw particles close to each other as a blob, just as liquid/water. I do not want to draw big circles ...
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
384 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
573 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 ...
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 ...
1
vote
1answer
358 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 ...
3
votes
1answer
434 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
385 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 ...
4
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 ...
2
votes
1answer
320 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 ...
10
votes
5answers
803 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 ...
15
votes
10answers
5k views

Does C# have a future in games development?

I recently learned that the MMO Minecraft is powered by Java from a recent interview on CVG.co.uk on a possible collaboration between two former and now competing colleagues. In the interview he ...
3
votes
1answer
904 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 ...
14
votes
9answers
5k views

Dynamic pathing algorithm for tower defense game

I'm making a Tower Defense and I need a good pathing algorithm for it. I have thought about Dijkstra but I need one that can be dynamic; it must be able to update itself when one edge is removed or ...