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

3
votes
1answer
1k views

2D platformer corner collision

Repost from my question on stack overflow, didnt know this site existed. I have a 2d platformer and I need help with collision. To show you my current collision system, here is picture: Top picture ...
3
votes
1answer
785 views

Platformer collision detection problems

I'm having a few problems with collision detection in my game (written in C# with SDL.Net). Detecting the floor and roof is fine, as does detecting sides of tiles when not jumping/falling. My problem ...
14
votes
2answers
6k views

How can I implement lighting in a voxel engine?

I am creating the MC like terrain engine, and I have thought that lighting would make it look a whole lot nicer.The problem is that the blocks are not being lit properly when a block which emits light ...
0
votes
1answer
813 views

How do I install SDL.NET in Visual Studio 2010? (Or any other .NET library)

I'm trying to get SDL.NET to work in Visual Studio 2010, but am really not sure how to go about installing the library (or creating a custom project or something), and any basic instructions would be ...
2
votes
1answer
1k views

Can't change the textures of a .FBX or an .X exported from 3dsmax

I created a model (real simple) in 3DSMax 2010, exported it to FBX format and loaded it in an XNA 4.0 content project. I also tried with .X files using kW X-port and it has the same behavior. I can ...
4
votes
3answers
3k views

2D XNA Tile Based Lighting. Ideas and Methods [closed]

I am currently working on developing a 2D tile based game, similar to the game 'Terraria'. We have the base tile and chunk engine working and are now looking to implement lighting. Instead of the tile ...
3
votes
1answer
1k views

What happens when I implement IUpdateable or IDrawable in XNA?

I've been fooling around with XNA today, attempting to develop a pure-component model game engine. I've been working on a GraphicsSubsystem class, and realized that it will need both an Update method ...
2
votes
1answer
115 views

Problem displaying model

I downloaded the FBX of this free model: http://www.turbosquid.com/FullPreview/Index.cfm/ID/485548 Yet when i try and display it in my project foreach (ModelMesh mesh in player.Meshes) { ...
11
votes
4answers
4k views

How to deal with arbitrarily large images in 2D games?

Question When you have a 2D game that uses really large images (larger than your hardware can support), what do you do? Maybe there's some interesting solution to this problem that never occured to ...
7
votes
1answer
2k views

How to create a XNA texture from a GDI Image with source rectangle?

A Texture2D in XNA can only hold so much. Depending on which profile I use that limit is either 2048 or 4096 pixels wide. As far as I could tell from my research (someone correct me if I'm wrong) GDI ...
6
votes
3answers
3k views

Loading sound in XNA without the Content Pipeline

I'm working on a "Game Maker"-type of application for Windows where the user imports his own assets to be used in the game. I need to be able to load this content at runtime on the engine side. ...
2
votes
2answers
895 views

Why does my sprite jitter when it arrives at its destination?

I have just started looking into XNA for WP7 - and I am definitely the sort of person who likes to find answers to my questions without begging for help! I searched here to find an answer but I found ...
12
votes
6answers
5k views

How can I implement hexagonal tilemap picking in XNA?

I have a hexagon tiled map in which i need to check when a hexagon is clicked. The hexagons aren't actually touching, rather they have a slight gap in between each of them. Does anyone know how I ...
0
votes
1answer
1k views

XNA model texture from file

Is there any way to have the texture of a model loaded from a Png ? I have a simple prism to test it on, but i just want to be able to edit an image and have the model's texture change. Thanks!
0
votes
1answer
425 views

Dual Stick Shooter in XNA (trig)

Honestly I have never taken a trigonometry class, but I am trying to create a dual stick shooter in XNA, can someone please look at my code and look to see if there are things that can be fixed, The ...
5
votes
2answers
4k views

Quad Tree with a lot of Moving Objects

I have a Quad Tree implementation that is very useful for what I am trying to do. My problem is that when my viewport has a lot of objects, the Update for the Quad Tree takes a very long time. It ...
1
vote
2answers
1k views

2d engine/library for android in C#

I'm looking for a good 2d engine or library (that supports physics) for Android. I have a restriction - language should be C#. It's not a requirement to use Mono Droid, but it seems that it is an ...
2
votes
3answers
2k views

Building an XNA Game Engine: Loading Sprites outside of LoadContent()

I'd like to build an engine in XNA, primarily for a 2D RPG. At first, I began abstracting out some classes and built a Sprite class which wrapped a Vector2 and a Texture2D, and tried loading in ...
16
votes
3answers
2k views

A simple map, four biomes, and how to distribute them

Here's the basic idea: I've got a Rogue-ish, perhaps Dwarf Fortress-ish game, with a randomly generated overworld and several dungeon entrances scattered around it. I already have the dungeons ...
5
votes
1answer
694 views

A pattern for a contextual InputState in a Game State Management architecture

Context of the question : When developing a game using Game State Management I came across a problematic when it came to handling user input : I want my game to retrieve user input a single way, but ...
3
votes
2answers
693 views

SpriteSheet Animation with XNA

Hi i'm working on my First 2D Game with XNA and I have a little problem. To give a running effect to my Sprite, I scroll through a SpriteSheet with this code(running right): if (AnimationDelay == 6) ...
3
votes
2answers
1k views

Jumping Vs. Gravity

Hi i'm working on my first XNA 2D game and I have a little problem. If I jump, my sprite jumps but does not fall down. And I also have another problem, the user can hold spacebar to jump as high as he ...
0
votes
1answer
1k views

Make a basic running sprite effect

I'm building my very first game with XNA and i'm trying to get my sprite to run. Everything is working fine for the first sprite. E.g : if I go right(D) my sprite is looking right , if I go left(A) my ...
1
vote
4answers
686 views

How can a single script attached to multiple enemies provide separate behavior for each enemy?

I am making a TD game and now stucked at multiple enemies using same script. All is well with scripts attached with one enemy only. Problem is in running multiple enemies. Here is the overview. I ...
4
votes
2answers
2k views

Recommended method for XML level loading in XNA

I want to use Blender as my level designer tool for an XNA game. Using an existing plugin, I can export my levels to DotScene format which is basically an xml file like this one: <scene ...
4
votes
1answer
469 views

3D models overlapping each other

I have a problem at the moment when I draw some models to teach me more about 3D game programming. The models at the moment overlaps each other from some angles witch makes sense since the game at the ...
1
vote
1answer
439 views

Deserialize inherited classes into the same list in XNA

I am writing a Gui for a game (for what else ...). Therefor I wrote a class GuiElement which has some serializeable fields. From this class I deflect a Class "Button" which has one serializeable field ...
0
votes
1answer
357 views

Display crosshair that is diplaying where the ship is aiming at

I am creating a 3D asteroids game. I got the bullets, asteroids, and ship all done. They work perfectly. Now I want a crosshair to display where the ship is pointing at. The crosshair will be a 2D ...
2
votes
1answer
469 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 ...
2
votes
1answer
845 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. ...
0
votes
1answer
419 views

Rotate player to face direction it's moving in 3D space

I'm making a 3D game in XNA4.0. How do I rotate a model to face the direction that the user is pressing. I assume I need to set its look at to the direction being pressed, but can't figure out how to ...
2
votes
0answers
822 views

Best Frameworks/libraries/engines for 2D multiplayer C# Webbased RPG [closed]

Title is a mouthful but important because I'm looking to meet a specific criteria and it's complex enough that I need a lot of help in finding what I'm looking for. I really want people's suggestions ...
0
votes
3answers
447 views

Model won't render in my XNA game

I am trying to create a simple 3D game but things aren't working out as they should. For instance, the mode will not display. I created a class that does the rendering so I think that is where the ...
2
votes
1answer
683 views

Collision with half of a semi-circle

I am trying to port a game I made using Flash/AS3, to the Windows Phone using C#/XNA 4.0. You can see it here: http://goo.gl/gzFiE In the flash version I used a pixel-perfect collision between ...
9
votes
1answer
631 views

Organising levels / rooms in a MUD-style text based world

I'm thinking of writing a small text-based adventure game, but I'm not particularly sure how I should design the world from a technical standpoint. My first thought is to do it in XML, designed ...
1
vote
2answers
3k views

XNA: draw a sprite in 3d, is that possible?

since now I always used sprited to draw in 2D: spriteBatch.Draw(myTexture, rectangle, color); (I suppose the texture is binded internally to 2 triangles and then scaled.) Now, I'm porting my game ...
5
votes
2answers
676 views

Where can I find a good tutorial to replicate Game Maker's surfaces and blend modes in XNA?

I know Game Maker's surfaces exist in XNA (It's more the othe way around, XNA's surfaces exist in Game Maker), same thing for blend modes, since (I think) they both use DirectX. This is the question: ...
4
votes
1answer
513 views

3d Model Scaling With Camera

I have a very simple 3D maze program that uses a first person camera to navigate the maze. I'm trying to scale the blocks that make up the maze walls and floor so the corridors seem more roomy to the ...
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 ...
0
votes
1answer
913 views

NullReferenceException when accessing variables in a 2D array in Unity

I have made a class including variables in Monodevelop which is: public class GridInfo : MonoBehaviour { public float initPosX; public float initPosY; public bool inUse; public int ...
3
votes
1answer
998 views

WiX installer for XNA 4.0 game?

I'm trying to make a quick installer for my XNA 4.0 game which should be able to install silently. I did some research and figured out that WiX would probably be best for me. I don't like the setup ...
1
vote
3answers
4k views

How to import or “using” a custom class in Unity script?

I have downloaded the JSONObject plugin for parsing JSON in Unity but when I use it in a script I get an error indicating JSONObject cannot be found. My question is how do I use a custom object class ...
1
vote
1answer
624 views

Performing simple network call to retreive JSON in Unity?

I have looked at the network documentation for Unity and most examples seem to be related to networking your game for multiplayer. I am just looking to grab a JSON response from an API for dynamically ...
2
votes
1answer
320 views

Moving two objects proportionally

I'm trying to move two objects away from each other at a proportional distance, but on different scales. I'm not quite sure how to do this. Object A can go from position 0.1 to 1. Object B has no ...
2
votes
2answers
1k views

XNA C# How to draw fonts in different color

I'm doing a simple chat system with XNA C#. It is a chatbox that contains 5 lines of chat typed by the users. Something like a MMORPG chatting system. [User1name] says: Hi [User2name] says: Hello ...
1
vote
1answer
753 views

How to set TextureFilter to Point to make example Bloom filter work?

I have simple app that renders some particles and now I am trying to apply the bloom shader from the xna samplers ( http://create.msdn.com/en-US/education/catalog/sample/bloom ) to it, but I am ...
4
votes
1answer
739 views

RK4 Bouncing a Ball

I am trying to wrap my head around RK4. I decided to do the most basic 'ball with gravity that bounces' simulation. I have implemented the following integrator given Glenn Fiedler's tutorial: /// ...
1
vote
0answers
382 views

Stuck with A* implementation [closed]

I have implemented some A* code in C# using this JavaScript code. My C# implementation is the same as the above javascript code. But I'm unable to get it to work properly, e.g pathfinder blocks ...
1
vote
1answer
418 views

Marshalling C# Structs into DX11 cbuffers

I'm having some issues with the packing of my structure in C# and passing them through to cbuffers I have registered in HLSL. When I pack my struct in one manner the information seems to be able to ...
-5
votes
1answer
540 views

How do I make the Cylinder in the model?

I have a class which will draw cylinders with deformer's index in the FBX file. The deformer which was in the 3ds max's biped. ex: If I have 22 bones in the deformer's structure, I will draw 22 ...