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

21
votes
2answers
1k views

Making entire scene fade to grayscale

When the player loses all of their lives, I want the entire game screen to go grayscale, but not stop updating immediately. I'd also prefer it fade to grayscale instead of suddenly lose all color. ...
2
votes
1answer
324 views

delay camera xna

I read this tutorial http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2/Camera_delay.php but i didnot unsterstand it. Is there another way to delay the camera position movement without this ...
0
votes
2answers
456 views

Collisions not working as intended

I'm making a game, it's a terraria-like game, with 20x20 blocks, and you can place and remove those blocks. Now, I am trying to write collisions, but it isn't working as I want, the collision ...
1
vote
2answers
3k views

Breakout collision using 2D Rectangles?

Here is my code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; namespace BreakOut { class Field { public static ...
2
votes
1answer
847 views

XNA 4.0 and Lidgren Library, How do I create a server/client hybrid?

My use of terminology may be off a little bit. I have been playing around with the Lidgren XNA sample for how the library works, and it is simple to implement it looks like. I am curious on the logic ...
0
votes
4answers
3k views

XNA spritebatch drawing to the centre of screen

I have bit of a silly problem. Is is possible to use SpriteBatch.Draw() method to draw to the centre of screen using coords from the beginning of window (So resolution 800x600 would use 400;300) ...
6
votes
1answer
322 views

Should I call the garbage collector during loading screen?

SO, I read a bit on Garbage Collection lately, out of curiosity, and there is something that is repeated quite often: garbage collection can lead to sudden slow down of the program, depending of the ...
10
votes
2answers
1k views

Handling scripted and “native” components in a component-based entity system

I'm currently trying to implement a component-based entity system, where an entity is basically just an ID and some helper methods tying a bunch of components together to form a game object. Some ...
4
votes
1answer
687 views

Character jittering with this tile based collision code

I have been trying to get my collision code working for hours now but with every resource I have tried my character still jitters. First I tried using the platformer sample but my character still ...
2
votes
1answer
274 views

2D Object 'Targeting' / 'Selecting'

I'm currently working with C# with the XNA framework. I'm trying to create a list of objects that are individually target-able after they are created and set in a list and displayed on a tile map. ...
3
votes
1answer
2k views

Orbiting a specific point - Orbiting Camera

How would I create a camera that with the mouse, it allows you to orbit around a specifc position, with the camera always facing that point? I would also like it to be able to always be at a constant ...
1
vote
3answers
603 views

Loading and using GLEED2D levels into WP7 Game

I've been trying to use this modified version of GLEED2D that includes WP7 support, The progress so far, is I've been able to load the level XML file to the project and read it successfully thanks to ...
3
votes
0answers
176 views

Getting error messages from my server [closed]

I'm working on client-server-client game. Client is sending their status (position) 30 times a second. I'm using Lidgren.Network namespace for networking (server, client). I've got two questions: 1. ...
-1
votes
3answers
3k views

3D Procedural Planet Generation [closed]

I was looking for some inspration for my Voxel based game I am writting and came across this: http://www.youtube.com/watch?v=rL8zDgTlXso. I would like to know how to go about (or preferably source ...
2
votes
1answer
1k views

Loading textures with SharpDX in Metro

I have converted my C# game from OpenTK (OpenGL) to SharpDX (DirectX) and have it up and running from Visual Studio 2010. I also have it up and running from Visual Studio 11 in Metro, in the Windows 8 ...
1
vote
2answers
744 views

What basic windows form games should I build as a newbie in game development? [closed]

I am a complete newbie in game development. I want to know about some basic games that I can start building with simple algorithms and basic knowledge. I have already made few basic games like ...
0
votes
1answer
232 views

Primitive Animation

I am creating a minecraft-like clone and was wondering what is the best way to go about animating a model, for example implementing the following feature: when the player presses the arrow keys, move ...
1
vote
1answer
523 views

Collision detection not working

I realized I put this in the wrong forum, so here it is: I made a collision detection in the Update() section, and this is the code: if (player.playerRect.Intersects(turtleRect)) { ...
3
votes
4answers
593 views

Some advice for settling on a map format for a tile game?

I am using XNA 4.0 and am currently working on a simple tile game to pass the time. Basically, I'm using the tried and true method of having numbers refer to tile types, where in 0 would be an empty ...
2
votes
2answers
584 views

How to store “chunks” of tiles or How to make my implementation work

I asked a previous question about the loading and unload of chunk data and people noted that my way of storing chunks is weird and I was wondering how I would go about doing it properly. @Byte56 ...
2
votes
2answers
3k views

Loading and unloading “chunks” of tiles in a 2d tile engine with 2d camera

I am making a 2d tile based game in C# and XNA 4.0. I am having trouble loading and unloading "chunks" of tiles(blocks). The whole world is randomly generated and is infinate on both axis. How would I ...
1
vote
3answers
2k views

3D XNA Tracking Camera

I'm trying to implement a camera that tracks a 3D model in my game. I've taken a look at this MSDN article on creating a 3rd person camera, as well as experimenting on my own; but I don't get the ...
2
votes
2answers
2k views

C# Console Snake Game, sort of fps problem

I have about 200 lines of code, really simple oop. When I load the console game (snake), I don't see it running smooth, like fps problems in in games, but I don't understand why, because my files are ...
1
vote
2answers
944 views

Transformation order when dealing with Meshes

I have created a player model out of primitive types. To do this I have created a Model class and Component (mesh) class. Each model consists of one or more components my problems start when you have ...
2
votes
1answer
355 views

Implementing IVertexType Interface

In XNA, I have created a new VertexType, called it VertexPositionTextureLight which inherts the IVertexType Interface, but apparently I need to implement the member of VertexDeclartion which I cleary ...
5
votes
1answer
310 views

Is it possible to reuse the same window in multiple games?

In particular, I'm thinking about C# and XNA, and obviously on Windows. Let's say I have the main game which is a normal XNA game, but at some point I would like to momentarily switch to a mini-game ...
5
votes
6answers
2k views

Making classes available to others

I'm currently working on a 2D game engine in XNA, and I am very interested in architecture, and how best to let my game objects communicate. I know a lot of people use a Singleton design but I ...
2
votes
1answer
492 views

Xna GS 4 Animation Sample bone transforms not copying correctly

I have a person model that is animated and a suitcase model that is not. The person can pick up the suitcase and it should move to the location of the hand bone of the person model. Unfortunately the ...
5
votes
4answers
4k views

How to clip cut-off text in a textbox?

I'm writing a textbox class for my XNA game and I'm using SpriteFont to draw the text. It's only a single line textbox so when the text width exceeds the size of the rectangle box, it currently just ...
3
votes
1answer
3k views

Why isn't my sprite being drawn in the correct position in XNA?

Sorry if this has been asked before, but I can't seem to find it here. I'm trying to make an asteroids clone in XNA. I took the Game State Management project and am making new classes for things like ...
18
votes
2answers
3k views

Can I legally sell an XNA game made with Visual C# Express Edition?

I've dowloaded Visual C# Express Edition and when it starts up it says "for evaluation purposes only." What does this mean? Does this mean I have to buy the full version to legally sell my game I ...
1
vote
4answers
455 views

Bad to learn XNA without an amazing foundation on C#? [closed]

I've been going though Head First C#, and enjoying it's style of teaching. But I'm into this as a hobby for now, and I'm itching to learn more about games, so I've been diving into Learning XNA 4.0 as ...
2
votes
3answers
995 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. ...
-1
votes
1answer
1k views

3D Procedural Planet Generation - Resource [closed]

I don't know if the question fits on this site (if it doesn't I'll gladly accept any invitation to move it elsewhere), anyhow, I have found this Really great resource on 3D Procedural Planet ...
0
votes
1answer
477 views

XNA Sprites Not Drawing Correctly

I have a problem through out my current code where certain Texture2D's are not drawing correctly over each other. For example, at the start I have sprite font being drawn over a background image and ...
6
votes
1answer
569 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 ...
3
votes
3answers
2k views

How to access SpriteBatch, Input, and ContentManager from all game screens?

I'm trying to make a Game State Manager and I'm using the Microsoft Game State Management Sample as guidance. However, I want a more simplistic design (no transitions, reflection, or support for ...
4
votes
2answers
2k views

Performance/architectural implications of calling SpriteBatch.Begin/End in many different places?

I notice some code samples only call SpriteBatch.Begin and SpriteBatch.End in the game's main draw method and then draw everything within that method through direct SpriteBatch.Draw calls or indirect ...
1
vote
1answer
559 views

Xna rotate around world axis?

I want to make it so that either the pitch yaw or roll rotates around the world axis and not the local axis, but I'm not sure how, I've got. Vector2 mouse_change = new Vector2(mouse_previous.X - ...
1
vote
1answer
4k views

Looking at the mouse position in a top down Unity game?

I'm trying to make a simple top down game where the player looks at wherever the mouse is pointed. The player is only going to rotate on the Y axis. Here's what I have so far but I can't seem to get ...
3
votes
5answers
1k views

C#/XNA multiplayer TCG game inside a browser possibe?

I wish to try and create a TCG using C#/XNA that would run inside a web browser. Some of the main game's features would be: At least 2.5D to imitate the card flipping/shuffling and etc. effects ...
3
votes
1answer
337 views

Should the camera's rotation value be clamped?

I noticed that when writing a camera for my 2D game that the camera rotational value of -6 and 6 is equivalent to 0. That is, -6 = -12 = -18 = -24 = 6 = 12 = 18 = 24. I was wondering if it was ...
2
votes
1answer
703 views

Building different game objects (EG Spells, Items,) for an rpg game

I believe the best way to manage item data would be to use xml? For spells would the best option be to create a class (EG Fireball) and define all of the parameters inside of that class? Like ...
1
vote
1answer
2k views

SpriteBatch Draw Using Floats with the Destination Rectangle

So I created a nice little isometric tile engine and I have it so that when you scroll with the mouse it changes a variable called scale. Scale is a float and gets passed through the ...
2
votes
1answer
879 views

Inaccurate 3D model collision using XNA

I am creating a classic game in 3D that deals with asteriods and you have to shoot them and avoid being hit from them. I can generate the asteroids just fine and the ship can shoot bullets just fine. ...
1
vote
2answers
390 views

XNA 4.0 problem Initializing Instanced Classes in for loop

Okay so this is kind of weird, I have some code that creates particle.cs instances public void AddParticle() { for (int i = 0; i < Density; i++) { particle = new ...
1
vote
0answers
228 views

Unusual Farseer Behaviour? [closed]

My basic implementation of a Farseer world has been behaving very strangely. It seems as though there is a very low maximum velocity, and collisions result in the small spheres involved clipping ...
10
votes
3answers
586 views

Good way to play a sound when something happens? How does this sound?

So I was thinking about how monolithic my classes get a lot of the time. For example, in the Character class's Jump method, one may have a reference to a sound effect object and play that. By itself ...
2
votes
0answers
573 views

Developing user interface [closed]

i am beginner in graphic development and have no experience with it, i only developed always with standard win controls. Now i want to create interface in c# for my sports management simulation game, ...
51
votes
1answer
10k views

Using component based entity system practically

Yesterday, I've read a presentation from GDC Canada about Attribute / Behaviour entity system and I think it's pretty great. However, I'm not sure how to use it practially, not just in theory. First ...