Tagged Questions

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

2
votes
2answers
919 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
430 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
699 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
695 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
727 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
474 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
449 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
366 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
475 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
854 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
424 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
830 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
450 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
695 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
643 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
685 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
930 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
1k 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
640 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
321 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
2k 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
754 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
743 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
421 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
545 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 ...
12
votes
7answers
7k views

What is a good way to store tilemap data?

I'm developing a 2D platformer with some uni friends. We've based it upon the XNA Platformer Starter Kit which uses .txt files to store the tile map. While this is simple it does not give us enough ...
3
votes
2answers
978 views

Is there a universal method to send key or mouse input to any application from C#?

I need method or group of them to send signals to any application (browsers, games, et cetera) about mouse movement or key input. I can easly retrieve an IntPtr to any process, but I don't know what ...
1
vote
1answer
1k views

How can I reference multiple XNA content projects from my game project?

I'm developing an engine in XNA and would like to have two different ContentManagers: one for the game (sprites, sounds, etc.) and one for the engine (shaders, dlls, etc.) Right now, I have this: ...
13
votes
3answers
6k views

How do I implement a quaternion based camera?

UPDATE The error here was a pretty simple one. I have missed a radian to degrees conversion. No need to read the whole thing if you have some other problem. I looked at several tutorials about this ...
6
votes
2answers
2k views

How do I save and load settings on the Xbox?

I'm using XNA 4.0. How can I load and save settings when on the Xbox? And can I write to and read from files?
7
votes
4answers
906 views

How can I create NPCs and scenes?

How would I go about creating NPC Events/Scenes? For example, any RPG will have a ton of different in-game cut scenes where you can express a story line. What I have thought of so far is having ...
4
votes
1answer
731 views

How should I handle different aspect ratios in a fullscreen game?

I am creating a game using C#, GDI+ and Raster images (2D images). For performance sake, I believe that I should have the game change the user's resolution to 800 x 600 and run the game in that ...
4
votes
2answers
931 views

What can I do to render generated 2D terrain in XNA?

I am working on a smooth terrain generation algorithm in C# and using XNA to display the data. I am making it so it creates a new point halfway between each point per iteration, at a random height ...
4
votes
1answer
823 views

Rotate entity to match current velocity

I have an entity in 2D space moving around, lerping between waypoints. I would like to make the entity rotate around its own origin to face the current direction that it is going, I.E. towards the ...
2
votes
2answers
1k views

How can I achieve smooth animation of sprites between discrete tiles?

I'm currently learning game development with C# and XNA and my current assignment is to create a Pac-Man clone. The game is partially tile based, which means that the level itself is built out of an ...
3
votes
3answers
680 views

Why large builder classes rather than separate clases in component-based entity systems?

I was reading about component-based entity systems and I was wondering why there is usually a large EntityBuilder class with methods like CreatePlayer(), CreateEnemySpaceship(), and CreatePowerup(), ...