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

1
vote
0answers
12 views

Why is my cursor not working if I add a scaling matrix?

After moving the camera to any direction, my cursor isn't getting drawn on the correct position. For example: I move my camera to the right, after that I click on the screen, but the cursor isn't ...
0
votes
0answers
25 views

How to correctly handle collision resolving with the MTV of Separating Axis Theorem?

I am making a top-down 2D game. I am in the process of implementing SAT for better collision detection and resolving (which seems to be resulting in one problem after another). Since I am in the ...
-1
votes
2answers
63 views

Why is my C# array in unity not working?

I'm creating a 2D brick breaking game in unity 4.3. I want all of my bricks to be different colours for each game, so I've created a C# script to assign random colours to each brick when the game ...
-1
votes
0answers
34 views

Updating counters using time.delta

Why when we want to try to make a counter up or down we use counter+=Time.deltaTime; Isn't Time.deltaTime can be a fractions of number like 0.003, that wouldn't be accurate counting.
1
vote
1answer
51 views

How to rotate vertices of 2D shape using a transform matrix?

I am making a top-down 2D game and am currently working on implementing improved collision using SAT. I programmed a Shape class with a Vector2 center that is its position in world space. On top of ...
0
votes
1answer
67 views

2D physics rotation w/ XNA

I'm creating a simple game with space ships made of blocks that are all the same size. After having looked at this: Calculating the rotational force of a 2D sprite I have created the following code ...
0
votes
0answers
35 views

Unity C# Coroutines to Java [on hold]

I wrote a simple Battle System in Unity C# that use Coroutines. I wrote it in Unity C# because at initial stages it was a Single Player game, but I decided to make it an MMO. So I have to port some ...
3
votes
2answers
169 views

Update vs. FixedUpdate in Unity

I was told to use Update() for graphics and FixedUpdate() for physics, but sometimes my inputs won't register when I use FixedUpdate(). It works fine if I use Update() for everything though. Should I ...
0
votes
4answers
75 views

Why are my Unity procedural animations jerky?

I'm working in Unity and getting some crazy weird motion behavior. I have a plane and I'm moving it. It's ever so slightly getting about 1 pixel bigger and smaller. It looks like the it's kind of ...
-1
votes
0answers
31 views

Best Game Engine for 3D Game Development in C# [on hold]

Till now, I am using OpenTK to develop a game in C# programming language. I am looking for any game engine, which is easy to use, open source, well documented and most importantly nice forum support ...
0
votes
1answer
92 views

How can I use a camera matrix with different resolutions?

I created a little jump'n'run game. The character(Mario) is always the center of the viewport. The game is running correctly if I use the resolution 800x480 pixel. But when I use another ...
0
votes
1answer
57 views

What strategies can one employ to do real-time path finding on a server?

In a server where multiple path finding algorithms might be going at once (especially when a mobile might be chasing a player) for several entities at once -- what can we do to speed up path-finding ...
0
votes
1answer
47 views

A problem with texture atlasing in Unity

I have the texture below and I need to get rectangular parts from it. I could finally combine meshes of different quads to improve performance, but I with quads of different tilings, this means ...
0
votes
1answer
63 views

Calculating ball trajectory in Pong

I'm making a Pong game and I'm just looking for a simple way to calculate a straight travelling path for the ball based on the angle of the ball. How would I go about implementing something like this? ...
0
votes
1answer
77 views

Projecting a light onto a quad

I need to project the light onto the quad and use its value for translating the vertices. I'm currently having 6 vertices, two quads, The points are A X C B Y D Point X, Y are coming from two ...
0
votes
1answer
97 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
54 views

How can I use custom shaders in Monogame?

I wrote a shader in XNA and I want to use it in a Monogame Windows Phone 8 project. How can I convert the effect file(.fx file) to an .xnb file? I use Monogame 3.2. How can I add a custom shader to ...
0
votes
1answer
60 views

How to retrieve a cube collision by faces

I work for a while on a minecraft game (voxel). I am front a problem for a long time about the collision detection. I want recover the cubes collision from my highlighted black's cube like on the ...
0
votes
0answers
27 views

XNA - Link between Create Rotations matrices

A friend of mine have been coding some rotations on my XNA project, but the order of the matrices rotation are not good. Some are of form : Matrix.CreateRotationZ(1.21f) * ...
0
votes
0answers
31 views

XNA - Store and define level event [duplicate]

I am currently developing a game in C# using XNA/MonoGame and I face an issue to manage and store my level event. I store my level in XML (Enemies, Spawn location...) and I would like to store my ...
2
votes
2answers
58 views

How to use camera transformation without depending on (1,-1) scale during spriteBatch.draw()

I am creating a 2D platformer type game in XNA. I currently have a camera object, with a position/rotation/zoomlevel that I use to generate a transformation matrix to pass to SpriteBatch.Begin(). ...
-1
votes
0answers
76 views

Serious Memory leak using SlimDX Texture.FromMemory() [closed]

I am new to stackoverflow and new to DirectX. I'm considering using the C# Wrapper slimdx. After a lot of researches, I found out how to load a texture and Draw on the screen.The below code is c# ...
-1
votes
0answers
46 views

How to built game on windows form [closed]

I want to build game on c#(windows.form) (Visual studio 2013), but I think that windows form does not support games graphics, some friends suggest me to do this task with the help of CANVAS. how can ...
0
votes
2answers
55 views

how to call the specific animation?

I have a script to control the player simply moves Left, move right, etc.. but the animation when winning, losing, or Light, just put it on the animation and animator and no script for it. I wanted ...
1
vote
0answers
27 views

Collision repositioning/resolution help

I've been having a trouble with moving objects out of the hitboxes they've just collided with. Here is my (relevant) code so far: Vector2 oposo = other.position; Vector2 poso = ...
0
votes
2answers
68 views

SharpDX.Toolkit setting constant buffer

I am trying to use a constant buffer in a program using SharpDX.Toolkit. I use the Toolkit because it has nice font support for writing on the screen. The problem I face is in assigning data to the ...
0
votes
0answers
36 views

Could not load sound (MonoGame) [on hold]

I am using the Window Project (in MonoGame 3.2) which is uisng DirectX instead OpenGL. If I run a game, so its show me: "Could not load wind asset as a non-content file" I think, that is no ...
-1
votes
0answers
43 views

2d top down tank movement

I am trying out an idea of a tank like movement in a top down 2d game. I'd like to: get the float values of both left and right triggers I have from an xbox controller (float values from 0 to 1). I ...
2
votes
1answer
136 views

How can I use XNA with Visual Studio Express 2013 for Windows?

http://dev.windowsphone.com/en-us/downloadsdk I downloaded the current version of Visual Studio to develop Windows Phone apps, but I don't know how to add XNA. I tried to install XNA, but it's not ...
0
votes
1answer
66 views

How to create public Arrays of game objects so that they can be assigned through inspector

I am making a unity2D game. I need to declare public array of gameobjects so that I can assign them colliders, textures through inspector by drag n drop. Is there any way to do this? I am using c#. I ...
0
votes
1answer
48 views

Variable Jump in Unity3d

I implemented variable jumping in unity for an endless running game. My question, how can I make the jump frame rate independent? My algorithm if ( keyDown ){ isJumping = true ySpeed += ...
0
votes
1answer
43 views

Why do I get an error about being unable to change rasterizer states in this code?

I'm trying to toggle between wireframe and full mode while drawing a 3d model. So far I have this rs = new RasterizerState(); In my update method: if (state.IsKeyDown(Keys.V)) { ...
1
vote
0answers
44 views

Using Behavior Trees and Events together

I am beginning to work with behavior trees and am unsure how events should be handled within the tree. Lets say we have a space game where the player is dogfighting with a handful of other ships, some ...
0
votes
0answers
39 views

class instance issue

Currently, i am working on a project which deals with several parts. First, I want to interface with a Sidewinder Force Feedback 2 joystick in Unity using SharpDX and SharpDX.DirectInput libraries. ...
7
votes
1answer
179 views

Finding the correct speed for AI to turn to reach goal

I have a ship that travels at max speed maxSpeed and can turn rotationSpeed degrees per second. The ship always moves in the direction it is facing which means that the faster the ship is travelling ...
0
votes
2answers
82 views

How can I make RPC function calls in Unity?

I am making a multiplayer game. I am sending score via the server and client but I want to be sure that can I call an RPC function of a script from any other script. For example, say Table_Manager as ...
0
votes
0answers
15 views

SlimDX and Parsing .X Files

I'm trying to parse a .x file using SlimDX. I can create the XFile object and register templates but I'm having problems with the enumeration object. The enumeration object has a child count of 0 for ...
1
vote
1answer
47 views

How to put basic scripting/variable changes into dialog xml files?

I have a simple XML structure for my dialog between the player and NPCs. What I'd like to do is put variable changes (and maybe other things) directly into the XML. So, for instance, if you select a ...
0
votes
0answers
51 views

Script to intelligently move aircraft using curves [Unity]

I am trying to code a script to move an aircraft entity from point A to point B and at some point in the middle of moving have the aircraft forward vector face Point C (to fire a missile at an enemy ...
0
votes
0answers
63 views

Farseer: How can I break a body into multiple pieces?

I created a breakable body but the pieces are not flying around if the ball touches it. What is wrong? Why is the breakable body not breaking into pieces? I made a video and I enabled debugview, so ...
2
votes
1answer
50 views

Adding an object viewer to a Unity Editor Window

I'm wondering if its possible to add an object viewer (For example when you import an .fbx file into unity you can see a small preview of it in the inspector) to a Unity Editor Window? I've looked ...
0
votes
0answers
50 views

Matrix Translate Camera has some sort of spiky movement

public class Camera2D { private Vector2 _position; protected float _viewportHeight; protected float _viewportWidth; public Vector2 ScreenCenter; protected Being _unit; // the sprite camera is ...
0
votes
2answers
153 views

Farseer: What can I do so that a body can move through a special kind of bodies?

I have three different kinds of rectangles. Black, white and blue rectangles. The rectangles are moving and can collide with each other. But with one exception, the blue rectangle can collide normally ...
0
votes
1answer
58 views

MonoGame - 2x2 texture scaling issue

I've just recently switched from XNA to MonoGame and now I've run into something that has never happened to me in XNA before. I've created a 2x2 texture and filled it with a color by doing this: ...
2
votes
1answer
111 views

How do I convert a .dds texture to .png bitmap in C#?

This question is from someone who has not written a line of code for games, but several Game Save editors and other game tools. I'm working on a Save Editor and would like to display icons of some of ...
0
votes
1answer
89 views

How can I scroll my tile maps?

I've been trying to understand how I can use matrix to implement a smooth tile scrolling system but I fail miserably. So I have a pretty big world stored in a multi-dimensional array which is ...
6
votes
1answer
142 views

Optimize state changes within a render queue

I am refactoring some parts of the game engine I am working on. This engine is made in C# with XNA. The part I have trouble with is shader/material and the render queue. In the new version I will ...
1
vote
1answer
408 views

InvalidOperationException when using C# DLLs with Unity3D

Description I've been attempting to use a custom DLL in Unity. I've confirmed the DLL runs correctly outside Unity. The DLL imports into Unity and when I refer to it in my scripts, I get no compiler ...
0
votes
1answer
102 views

Change the sprite of a Object in Unity

Inside the script code of the the hero(object) I want add the possibility to change its sprite. So the player hits the space button and the sprite changes into the other sprite already added to the ...
0
votes
1answer
34 views

How do I handle window resizing in SlimDX?

I'm considering the use of SlimDX in a managed Windows Forms Application. Available with DirectX is DXUT. I use DXUT to handle events such as window resizing and 'lost devices.' How well does SlimDX ...