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

-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
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 ...
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 ...
1
vote
1answer
2k views

XNA - Use Mouse To Rotate & Arrow Keys To Scroll A Linearly Wrapped Texture:

Using XNA I'm working on my first, relatively simple, videogame for the PC. At the moment my game window is 1024 X 768 and I have a 'Starfield' linearly wrapped background texture 1280 X 1280 in ...
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 ...
-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 ...
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
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 ...
-4
votes
3answers
2k views

How to make map editor with XNA?

I have a problem with making map editor in XNA. I'm making a 2D tile based map editor. The problem is, I need every tile I put in map editor to be X: 0, or X: 32, or X:64 and so on, not 1.10, 2.99, ...
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 ...
6
votes
3answers
957 views

How should the actual game interface with the menu system

I'm using the Game State Management (GSM) concept in my prototype and I like it very much. One of the screen has a "Game" embeded in it, where all the "good stuff" happens. The menu launching the game ...
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 ...
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 ...
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 ...
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
2answers
973 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 ...
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 ...
4
votes
1answer
419 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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
2
votes
2answers
996 views

Calculating vertex normals on the GPU

I have some height-map sampled on a regular grid stored in an array. Now, I want to use the normals on the sampled vertices for some smoothing algorithm. The way I'm currently doing it is as follows: ...
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 ...
0
votes
2answers
897 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
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 ...
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
3k 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
386 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
901 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
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
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 ...
25
votes
6answers
6k 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 ...
10
votes
2answers
7k 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
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 ...
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
191 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
2k 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 ...