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

0
votes
0answers
46 views

Particle friction with variable timestep in XNA

Alright, so I'm working on an engine of sorts in XNA (yes, it's deprecated, I know) and I'm implementing my own particle system. I've defined a "ParticleEffect" such that when it's supplied a GameTime ...
1
vote
0answers
17 views

Is it possible to change the position of a Farseer joint tie point?

When I create a revolute joint in Farseer, then there is always a tie point in the center of each of the two bodies. Is it possible to change the position of a tie point? For example: I created a ...
2
votes
0answers
56 views

How can I combine multiple bodies into one in Farseer? [closed]

I want to create a windmill in Farseer, but I don't know how to combine the 3 windmill sails bodies to one body. During gameplay, the sails could get destroyed. For example, if another body hits one ...
5
votes
6answers
319 views

Increasing efficiency of N-Body gravity simulation

I'm making a space exploration type game, it will have many planets and other objects that will all have realistic gravity. I currently have a system in place that works, but if the number of planets ...
0
votes
1answer
69 views

How can I move bodies in Farseer, using touch input?

The player should be able to move a Farseer body with it's fingers. How can I do that? What is the best way to create a Farseer body for the player's finger so that the player can move other Farseer ...
0
votes
0answers
40 views

hide and show many guiTexture

in the 1 scene there are many guiTexture. So how to write this code ? public class guiTanya : MonoBehaviour { public GUITexture guiA, guiB, guiC, guiD, guiE, guiF; void onMouseDown() { //if i press ...
1
vote
1answer
108 views

Multithreading issues - Frame skips [closed]

So I am trying to multithread a Voxel engine in C# made with Sharpdx and I am having a few issues: This is the class I have : #region using System.Collections.Concurrent; using ...
0
votes
1answer
35 views

How do I avoid an infinite loop when testing D3D9 occlusion queries in SlimDX?

I'm creating a Managed DirectX 9 application using SlimDX. I'm trying to utilize occlusion queries in order to cull non-visible geometry found in the scene. The problem I'm having relates to SlimDX's ...
2
votes
1answer
107 views

Does every Windows Phone 8 device have one of a fixed set of resolutions?

Does every Windows Phone have one of the following 4 resolutions? 800x480, 1280x768, 1280x720, 1920x1080 pixels Or is it possible that some devices only have a resolution of 1280x719 or 1279x720 ...
1
vote
1answer
28 views

Predicted target location

I'm having an issue with calculating the predicted linear angle a projectile needs to move in to intersect a moving enemy ship for my 2D game. I've tried following the document here, but what I've ...
1
vote
1answer
23 views

How can I limit the movement angle of a Farseer joint?

How can I create rectangles in Farseer that behave like the two red rectangles in this video: https://www.youtube.com/watch?v=w0p2y4dRylQ I created an angle joint, but it behaves weird. Should I use ...
0
votes
4answers
155 views

Scripts won't affect clones - Unity3d

I made a script which swaps two game objects on click.But the script won't work because the objects are actualy clones of the original prefab. This is the script (UnityScript): #pragma strict var ...
1
vote
1answer
71 views

Predicted target location [duplicate]

I'm having an issue with calculating the predicted linear angle a projectile needs to move in to intersect a moving enemy ship for my 2D game. I've tried following the document here, but what I've ...
1
vote
1answer
99 views

Tile textures on 3D models. HLSL shader code maybe?

I'm making a game in C# with XNA. I'm now applying textures to models. However if I change the scale of the model, the texture stretches with it. How can I make the texture tile over the model instead ...
0
votes
0answers
46 views

Pixel-Perfect Collision With Rotation

I know how to implement pixel perfect collision, but how would I do this with rotations applied to my sprite?
3
votes
2answers
114 views

GameObject once walked on, gives message using C#?

I'm struggling to figure this code out by myself. I'm able to check if the objects are in the scene, and if they are print a message. I now want the GameObject of tag Zone to display a message to let ...
0
votes
1answer
61 views

Path smoothing while path following

I can't find a nice way to do path smoothing while i'm following a path. I have tried this piece of code but aparently it doesn't work as suspected. The idea of how it should work is: Edge 1 (the ...
0
votes
1answer
70 views

I want to make a pause button on the scene

I want to make a pause button on the scene. If I press the button it will show the guiTexture with a variety of buttons with each different script. So what steps should I take? 1. How do make it so ...
1
vote
1answer
57 views

How can I create a seesaw with Farseer Physics Engine?

I want to create a seesaw like in this picture: I created two rectangular bodies, one for the diagonal rectangle and one for the little rectangle in the middle. But I don't know how to connect the ...
0
votes
1answer
41 views

Is it ok to destroy mesh directly from MeshFilter in Unity?

Mesh.Destroy(myGameObject.GetComponent<MeshFilter>()); May it cause any problems or undefined behaviour? (the reason I ask this is that I'm trying to destroy an exiting component which is ...
0
votes
1answer
60 views

XNA 4: RenderTarget2D textures getting transparent on fullscreen

I'm generating a Texture2D object using RenderTarget2D as in the following code public static Texture2D GetTextTexture(string text, Vector2 position, SpriteFont font, Color foreColor, Color ...
1
vote
0answers
44 views

Simplest way to use Steam Leaderboards from C# [closed]

We are about to integrate steamworks for leaderboards and achievements into our game. I see there are many open and closed source libraries that can be used to use SteamWorks from C#. Rolling our ...
2
votes
1answer
82 views

Unable to use Maya animation with scripts when imported to Unity

I am testing to import Maya animation over to Unity. I set up a simple cylinder with 2 bones and an IK handle. Made a simple animation where the cylinder bends and goes back to straight position over ...
-1
votes
1answer
53 views

Problem with publishing an XNA game [closed]

I can't publish a game in XNA, if I try there comes out 2 errors: 1)Could not find required file 'setup.bin' in'C:\Users\Trica\Desktop\example\example\ example\Engine'. 2)Cannot publish because a ...
0
votes
1answer
48 views

XNA tempory pause

I need to do a temporary pause. If I do a collision with an enemy I want to pause the game for 1.5 seconds. Take a look here to my code: bool tPause; float timer; public ovveride Update(GameTime ...
1
vote
3answers
78 views

Rotation matrix for a 3D vector

I have a direction vector on which I have to apply some rotation to align it to positive z-axis. To use Matrix.CreateRotationX(angle) of XNA, I need the angle for which I'd have to compute cos or tan ...
0
votes
0answers
112 views

Zelda-style Top-down RPG. Storing data for each tile type

I'm creating a Zelda-style RPG using Tiled, C#, and MonoGame. When my code parses the .tmx file, it will get a number to associate with each tile type based off of their position in the tile sheet. If ...
0
votes
0answers
55 views

How can I port a MonoGame Windows Phone 8 game to iOS?

I downloaded the trial version of Xamarin Studio and installed it on my iMac. In addition, I installed Xcode on my iMac so that I can use the iPhone emulators in Xamarin Studio. But I don't know how ...
8
votes
1answer
366 views

Picture rendered from above and below using an Orthographic camera do not match

I'm using an orthographic camera to render slices of a model (in order to voxelize it). I render each slice both from above and below in order to determine what is inside each slice. The model I ...
-1
votes
2answers
100 views

How to translate along Z axis in OpenTK

I am playing around with an OpenGL sample application I downloaded for Xamarin-Android. The sample application produces a rotating colored cube I would simply like to edit it so that the rotating cube ...
3
votes
1answer
92 views

Scale a game object to Bounds

I'm trying to scale a lot of dynamically created game objects in Unity3D to the bounds of a sphere collider, based on the size of their current mesh. Each object has a different scale and mesh size. ...
2
votes
1answer
61 views

MonoGame not all letters being drawn with DrawString

I'm currently making a dynamic user interface for my game and are setting up having text on my buttons. I'm having an odd issue where, when i use a specific piece of code to determine the text ...
2
votes
1answer
93 views

Achieve anisotropic filtering

I want to set anisotropic filtering to my scene. I use SharpDX (DirectX 11) and C#. How do i set up anisotropic filtering in my shader? Currently i try that in the shader: Texture2D tex; sampler ...
1
vote
1answer
172 views

How do you make a bullet ricochet off a vertical wall?

First things first. I am using C# with XNA. My game is top-down and the player can shoot bullets. I've managed to get the bullets to ricochet correctly off horizontal walls. Yet, despite using similar ...
0
votes
0answers
28 views

XNA Guide text input - maximum length

so I am using Guide.BeginShowKeyboardInput to get the user to enter their username. I would like this to be limited to 20 characters, and it seems to break expected behaviour to let them input ...
0
votes
0answers
55 views

Maintaining State in Mud Engine

I am currently working on a Mud Engine and have started implementing my state engine. One of the things that has me troubled is maintaining different states at once. For instance, lets say that the ...
0
votes
1answer
210 views

How do I efficiently display image tiles in Unity 4.3 free

I previously wrote a TileEngine with SFML that I would like to port to Unity3D 4.3, but have not found a way to draw a tile on the screen programmatically in Unity. All I am looking for something ...
0
votes
0answers
24 views

Transparency in XNA-4 primitives

I'm using XNA 4 with Visual Studio 2010. I'm trying to create a simple 3D world with walls and doors in which the user to free to roam around. A wall is just a rectangle which is currently being ...
2
votes
1answer
130 views

How can I draw an Xbox Live avatar?

I want to replace the main character of my 2D game by an Xbox avatar. How can I do that? How can I add an avatar to my project? How can I draw an avatar? For example, I draw my main character like ...
1
vote
2answers
87 views

How can I use voice commands to control my game?

Is it possible to use simple voice commands like "run right", "run left", "jump", "stop", "attack", "defend", "finish" to control the player in a Windows Phone 8 game? How can I implement voice ...
3
votes
1answer
348 views

XNA, how to draw two cubes standing in line parallelly?

I just got a problem with drawing two 3D cubes standing in line. In my code, I made a cube class, and in the game1 class, I built two cubes, A on the right side, B on the left side. I also setup an ...
4
votes
1answer
226 views

Unity falling body pendulum behaviour

I wonder if someone could provide some guidance. Im attempting to create a pendulum like behaviour in 2D space in Unity without using a hinge joint. Essentially I want to affect a falling body to ...
4
votes
1answer
424 views

Problem getting information about running processes with .GetProcesses() in Unity3D on OS X

I was going to ask this on Unity Answers, but I keep getting an error when trying to get to the site so thought maybe you guys could help. I've also tried the Unity3d subreddit and didn't manage to ...
2
votes
2answers
364 views

Zelda-style top-down RPG. How to store tile and collision data?

I'm looking to build a Zelda: LTTP style top-down RPG. I've read a lot on the subject and am currently going back and forth on a few solutions. I'm using C#, MonoGame, and Tiled. For my tile maps, ...
5
votes
0answers
91 views

No idea of how to simulate car crashes [closed]

I have a simple car game with all the basic collision detection and movement in Unity with C#. But when I was building the "engine" for the game I didn't include a detail I later decided to include. I ...
1
vote
1answer
65 views

Textures have lines between them when zoomed out

These are two screenshots from my new game, a top-down RTS with tiles. The first one is from a normal view with no zoom, the second one is a zoomed out view of the whole map: In the first image, ...
2
votes
1answer
59 views

Why are my 2D world click-positions offset after camera movement?

I'm writing a 2D game engine. I need to add a camera to my world that can zoom in and out as well as move away from its initial position at (0,0) at the center of the world. The main issue can be ...
1
vote
1answer
74 views

How can I scale Farseer bodies so that they work on different screen resolutions?

I created a little Windows Phone 8 game that supports multiple resolutions. If the resolution of the device is less than 720p, then the sprites and their corresponding Farseer bodies need to be scaled ...
1
vote
1answer
181 views

Adding an existing script to a gameobject programmatically

Is there a way to take a script and apply that specific script to an object through code? In pseudocode, what I'm trying to do is essentially as follows: ObjectOne.MyScript = ...
0
votes
1answer
116 views

How do I set up a depth buffer in SharpDX?

I draw some instanced cubes, but when i rotate the camera (or the world) some cubes that should be behind other cubes are drawn before the cubes. I already had this issue a long time before and i ...