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

6
votes
1answer
160 views

XNA Deferred + Forward, Depth Problem?

Im working with my deferred engine in XNA 4.0 and Im combining it with a forwardpipeline to support semi-transparency and other "forward only" effects. Let me describe what I do: Render GBuffer ...
5
votes
1answer
2k views

Why would typeof(T) kill performance?

TLDR: using typeof(T) twice; assigning the value to a variable and reusing that = uber fast (30FPS), actually calling typeof(T) twice = derped (5FPS). Why? I have a simple entity/component system; ...
4
votes
3answers
2k views

Lights shining through walls

I'm currently having a problem with lights in Unity. They shine through walls for some reason. Point, directional, etc. If a light is next to a wall on one side, you can see it on the floor on the ...
1
vote
1answer
188 views

Unity3d generating a file in iOS and saving it on a linux machine

I've done a little research and don't know if the following is possible. At the moment I have created a small application in Unity that generates an XML file. This file will be used to help set up ...
-2
votes
1answer
118 views

Ingame menu is not working correctly [closed]

The ingame menu opens when the player presses Escape during the main game. If the player presses Y in the ingame menu, the game switches to the main menu. Up to here, everything works. But: On the ...
-2
votes
1answer
152 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
4k 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
278 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
397 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
1k 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
411 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
588 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
307 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
464 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
187 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
166 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
155 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
202 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
167 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
303 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
1k 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
582 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
312 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
132 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
771 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
148 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
314 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
245 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
800 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
121 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
342 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
294 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
229 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
768 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
1k 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?
5
votes
5answers
3k 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
130 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
403 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
553 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
831 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
193 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
1k 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
423 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
410 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
851 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
696 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 ...
4
votes
6answers
10k views

Parse/Write JSON with Unity iOS [closed]

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
251 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
670 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 ...
47
votes
3answers
12k 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" ...