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
1answer
139 views

If I have a character on the screen, how do I make it look in the direction my mouse is pointing? [duplicate]

Possible Duplicate: Set sprite to face direction of mouse I'm drawing a character on the screen, and I would like it so that the character is looking where my mouse is pointing. It's a ...
6
votes
2answers
2k views

Get collision details from Rectangle.Intersects()

I have a Breakout game in which, at some point, I detect the collision between the ball and the paddle with something like this: // Ball class rectangle.Intersects(paddle.Rectangle); Is there any ...
9
votes
2answers
207 views

Interpolating between two networked states?

I have many entities on the client side that are simulated (their velocities are added to their positions on a per frame basis) and I let them dead reckon themselves. They send updates about where ...
0
votes
1answer
231 views

Can't detect collision properly using Rectangle.Intersects() [closed]

I'm using a single sprite sheet image as the main texture for my breakout game. The image is this: My code is a little confusing, since I'm creating two elements from the same Texture using a ...
-1
votes
1answer
765 views

Writing to XML issue Unity3D C#

I'm trying to create a tool using Unity to generate an XML file for use in another project. Now, please, before someone suggests I do it in something, the reason I am using Unity is that it allows me ...
-2
votes
1answer
349 views

Using XNA for a 2D isometric game, but wanna move on

I've been building a 2D isometric game (with learning purposes) in C# using XNA. I found it's really easy to manage sprite sheets loading, collision, basic physics and such with the XNA api. The ...
1
vote
1answer
432 views

How can I implement collision detection for these tiles?

I am wondering how this would be possible, if at all. In the image below: The light brows tiles are ground, while the dark brown is background, so the player can pass over those tiles. Here's the ...
3
votes
2answers
244 views

Why can't I compare two Texture2D's?

I am trying to use an accessor, as it seems to me that that is the only way to accomplish what I want to do. Here is my code: Game1.cs public class GroundTexture { private Texture2D dirt; ...
3
votes
1answer
315 views

How do I make a more or less realistic water surface?

I want to make a similar water surface like in this picture: I need the water surface in the same view than in the picture. Is it possible to work without shaders? I want to develop a little game ...
0
votes
1answer
161 views

Speed up content loading

I am using WinForms Sample downloaded from microsoft website. The problem is, that the model loading time is quite long, using: contentBuilder.Add(ModelPath, ModelName, null, "ModelProcessor"); ...
1
vote
1answer
159 views

Keeping the meshes “thickness” the same when scaling an object

I've been bashing my head for the past couple of weeks trying to find a way to help me accomplish, on first look very easy task. So, I got this one object currently made out of 5 cuboids (2 sides, 1 ...
0
votes
1answer
117 views

How stoper one annimation model on XNA?

I do not understand how to pause an animation of XNA. I can "Start" the animation of my model but not stop it. I use SkinningSample_4_0 sample dll Here is my code to use. Here is my code to use. ...
0
votes
1answer
143 views

Points around a circumference C#

Im trying to get a list of vectors that go around a circle, but i keep getting the circle to go around several times. I want one circel and the dots to be placed along its circumference. I want the ...
3
votes
2answers
132 views

XNA: Runtime differences in ClickOnce install versus development version

I have a game written in XNA, and I use ClickOnce installers to distribute the game to testers. I keep once computer as a test machine which does NOT have development environments installed, so that ...
6
votes
1answer
279 views

How do I make something visible only when I'm looking at it?

So I'm making a basic 2D game in C# XNA. I want it so wherever my character is facing there is a cone of light and only that part of the level is visible while the right of the screen is dark. Please ...
9
votes
1answer
868 views

C#/XNA get hardware mouse position

I'm using C# and trying to get hardware mouse position. First thing I tryed was simple XNA functionality that is simple to use Vector2 position = new Vector2(Mouse.GetState().X, Mouse.GetState().Y); ...
4
votes
1answer
414 views

XNA Moddable Game - Architecture Design and Reflection

I've decided to embark on an XNA moddable game project of a simple rogue style. For all purposes of this question, I'm going to not be using a scripting engine, but rather allow modders to directly ...
2
votes
1answer
228 views

XNA running slow when making a texture

I'm using XNA to test an image analysis algorithm for a robot. I made a simple 3D world that has a grass, a robot, and white lines (that are represent the course). The image analysis algorithm is a ...
-1
votes
1answer
105 views

Error when using Environment.SpecialFolder.Desktop

I'm trying to get the current location of the Desktop so that I can automate a few things in my game. The current problem though is that following line doesn't work after I publish but it works in ...
-1
votes
1answer
461 views

Problem rendering VBO [closed]

I'm developing a game engine using OpenTK. I'm trying to get to grips with the use of VBO's. I've run into some trouble because somehow it doesn't render correctly. Thus far I've used immediate mode ...
4
votes
1answer
137 views

Why does CameraZ=0 result in no render?

I am trying to draw simple model, but I am experiencing strange error. When I use this View matrix: Matrix.CreateLookAt(new Vector3(0, 200, 1), new Vector3(0, 0, 0), Vector3.Up); my model is drawn ...
0
votes
1answer
190 views

UnityEngine.Vector2 does not contian a definition for “Set”… using futile

I am a bit lost, I am using futile and I am just trying to run the demo. But I keep getting UnityEngine.Vector2 does not contian a definition for "Set" in just one class, my using statments are: ...
2
votes
1answer
163 views

Can't load model using ContentTypeReader

I'm writing a game where I want to use ContentTypeReader. While loading my model like this: terrain = Content.Load<Model>("Text/terrain"); I get following error: Error loading ...
3
votes
1answer
583 views

How do I make a jumping dolphin rotate realistically?

I want to program a dolphin that jumps and rotates like a real dolphin. Jumping is not the problem, but I don't know how to make the rotation. At the moment, my dolphin rotates a little weird. But I ...
-1
votes
2answers
103 views

Setting a leader from a sprite array [closed]

I'm looking to set a leader from an array of sprites, I keep on getting a NullReferenceException was unhandled error from within my main game class when calling the UpdateMouse Method. What have I ...
0
votes
3answers
264 views

c# scripting execution with xna (actions take more than 1 frame)

I'm trying to figure out how to implement c# scripting into my game (XNA with C#). I will be using C# as the scripting language. My question is, how to call functions that take more than 1 frame to ...
0
votes
1answer
164 views

Difficulties with rotation of a sprite [duplicate]

Possible Duplicate: How do I make a jumping dolphin rotate realistically? I want to program a dolphin that jumps and rotates like a real dolphin. Jumping is not the problem, but I don't ...
1
vote
1answer
167 views

how to move the camera behind a model with the same angle? in XNA

I'm having difficulty moving my camera behind an object in a 3D world. I'd like to have two view modes: for fps (first person). external view behind the character (third person). I've searched the ...
2
votes
1answer
706 views

Scripting for a C#, multiplayer game

I have a multiplayer game written in C# and we've recently been creating a lot of content but have been looking for a way to give our entities customization logic that the designers can hook into. I ...
-3
votes
2answers
570 views

Can I develop 2D tower defense game with unit3D in C# for Android? [closed]

I tried to find the answer in unity3d site but without success. If the answer to my question is yes, does anyone know where I can find an example?
4
votes
5answers
2k views

Input/Output console window in XNA

I am currently making a simple game in XNA but am at a point where testing various aspect gets a bit tricky, especially when you have to wait till you have 1000 score to see if your animation is ...
1
vote
2answers
129 views

Displaying total playing seconds at end of game

Creating a simple survival game. When the player has been caught I want to display the amount of seconds that they survived for. How do I go about this?
0
votes
1answer
194 views

Calculating Hit Accuracy score in a game

I'm currently in the process of making a scoreboard for my game. One of things I would like to display is the players accuracy in the amount of hits they had in game. However, I have never done this ...
-1
votes
3answers
354 views

How to implement smooth flocking

I'm working on a simple survival game, avoid the big guy and chase the the small guys to stay alive for as long as possible. I have taken the chase and evade example from MSDN create and drawn 20 ...
1
vote
1answer
481 views

Unity3d import file on iOS device

im trying to figure out how to recall an external file in runtime on iOS device. I've already tried using Application.data+"/Raw/MY_FILE", with Application.streamingAssetsPath+"/MY_FILE", and with ...
1
vote
2answers
160 views

Set vertex position

Can anyone tell me how to set the positions of model vertices? I want to be able to change the position of some of the vertices of a Model. Is there any way to make that happen? And make the changed ...
4
votes
2answers
796 views

Blending textures together, texture fade over / fade in

What is the best way to render a texture overlapping effect? Like in this example: I want either the grass to fade in to the snow texture, or the other way around. No rough edges. Somehow make ...
2
votes
2answers
321 views

Unproject mouse position to tile — extremely jumpy position?

I'm trying to unproject the mouse position to get the position on the X-Z plane of a ray cast from the mouse. The camera is fully controllable by the user. Right now, the algorithm I'm using is... ...
1
vote
1answer
201 views

XNA shield effect with a Primative sphere problem

I'm having issue with a shield effect i'm trying to develop. I want to do a shield effect that surrounds part of a model like this: http://i.imgur.com/jPvrf.png I currently got this: ...
1
vote
1answer
528 views

Input Handling and Game loop

So, I intercept the WM_KEYDOWN and other messages. Thing is, my game can't/shouldn't react to these messages just yet, since my game might be currently drawing to the screen or in the middle of ...
7
votes
1answer
492 views

Spritebatch drawing sprite with jagged borders

Alright, I've been on the making of a sprite class and a sprite sheet manager, but have come across this problem. Pretty much, the project is acting like so; for example: Let's take this .png ...
3
votes
5answers
5k views

Parse/Write JSON with Unity iOS

anybody know a tutorial or maybe can help me to develop a parser/reader for JSON compatible with Unity iOS pro? I've already tried different third part libraries but without luck (i've tried json.net, ...
-5
votes
2answers
203 views

C# in vedio game industry? [closed]

Other than Indie game development, C# is also used for in house tool development at large studios. I have two questions -: 1) Is microsoft planning to release a native C# compiler sharing the ...
6
votes
3answers
526 views

Transforming a primitive tetrahedron into a primitive icosahedron?

I've created a tetrahedron by creating a BoundingBox and building the faces of the tetrahedron within the bounding box as follows (see image as well): VertexPositionNormalTexture[] vertices = new ...
35
votes
3answers
7k views

2D water with dynamic waves

New Super Mario Bros has really cool 2D water that I'd like to learn how to create. Here's a video showing it. When something hits the water, it creates a wave. There are also constant "background" ...
1
vote
2answers
160 views

Point[] and Tri not “could not be found”

Hi I'm trying to learn how to load a .obj file using OpenTK in windows Forms. I have seen a lot of examples out there, but I do see almost everyone uses List, and Point[]. Code example show these ...
1
vote
0answers
66 views

Farseer circle hangs where it's spawned

I'm currently trying to simply spawn a circle in Farseer. However, it's stuck wherever I spawn it! The game is updating fine, as I can see the circle spinning in place when I spawn it because of how I ...
0
votes
1answer
52 views

XNA- Texturing problem, exporting model

How,can I disable coloring when texture is applied, because right now the texture is being colored over. foreach (BasicEffect effect in mesh.Effects) { effect.TextureEnabled = textureApplied; ...
2
votes
2answers
156 views

XNA Sprite Clipping Incorrectly During Rotation

I'm having a bit of trouble getting my sprites in XNA to draw when near the edge of the screen. Seemingly if you use SpriteBatch to draw then XNA will not draw it if for example (mPosition.X + ...
2
votes
1answer
218 views

How do I modify a Boids algorithm to be player controlled?

Found source code on Boids in C#. http://3carrotsonastick.wordpress.com/2012/11/01/boids-in-c-xna/ How do I go about making the raven class in the above player controlled? If I could control it ...