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
11 views

How to play a video and run content at the same time

Alright, so I have a video loaded, and other game content. Earlier this morning, when I was just learning how to actually play a video, I magically happened to get the video running in the ...
0
votes
0answers
22 views

“Orbiting” four objects to a specific point over time

I'm hoping my image makes sense as it is the best explanation for what I'm trying to do. Basically, I have four objects (think of them as a moving rectangle: x,y,w,h) that start all in a row beside ...
0
votes
2answers
56 views

2D indicator for Rotation in 3D space

This is the view from my spaceship. It can move around in 3d space and turn up, down, left and right. The planet Earth on the top right is selected. Now I want to create the red arrow to always ...
1
vote
1answer
189 views

How to rotate an object to face another in Unity?

I'm having an issue where I can't seem to rotate my bullet appropriately whenever I spawn one. I currently have a capsule prefab I am testing with. I spawn it with the following code. ...
0
votes
1answer
38 views

Can someone explain to me the difference between 2 XNA methods?

I was recently trying to make a boucing ball off the environment walls. I apparently had everything correct, except for one thing, that I corrected stupidly, which made my code work, but I don't ...
0
votes
1answer
21 views

Rotation and timer at the same time

I have a project where I flip a card after 5 seconds, then I want to start a countdown timer of x seconds. After x seconds the card flips again. I found a good example for the timer here, but that ...
1
vote
2answers
118 views

Unity: DontDestroyOnLoad

I'm viewing tutorial of Unity. In this tutorial, I see this piece of code: public class GameControl : MonoBehaviour { public static GameControl control; public void Awake() { if ...
0
votes
1answer
33 views

Trying to implement physics to my player. Can't get it to work

I'm currently stuck on where to add physics to my player. Currently it's set so the player spawns in the middle to the left of the screen and can move around, but I want to make it so the user has to ...
0
votes
0answers
40 views

How to get a position from a radial distance and angles?

I have a radius and the 2 angles for northSouth and eastWest rotations in degrees. I need a Spherical position or a cartesian position (I have code translate one to the other) Where a position is ...
0
votes
1answer
17 views

Unity3d - c# - changing FPSInputController controls through script

For a game I am making I would like the user to be able to change the controls (in game NOT through the clunky launch window (wich i disabled)) I have the system working but don't know how to change ...
2
votes
1answer
36 views

Replacing a sprite for another on runtime (Unity3D)

I need to replace the sprite of a face down card for another sprite (of a face up card). This is the C# script attached to the face down card: using UnityEngine; using System.Collections; public ...
0
votes
0answers
22 views

Can Raknet 3.x be used with C#? [on hold]

I have a project which needs to use Raknet version 3.x. Is it possible to use Raknet 3.x with C#?
0
votes
0answers
43 views

Isometric staggered multi tile buildings

I'm writing a isometric staggered rpg engine and i am at loss to how to make the buildings placement diamond show up. What I mean is i have tile2screen and screen2tile functions and it works ok. I ...
-2
votes
0answers
46 views

Looking to learn a new language and create a game, what language should I learn? [on hold]

Currently I have some basic knowledge in c# and I know Javascript/HTML/CSS/PHP on a high level. I have a idea for a game which I want to create and along the way learn a Object Orientated language. ...
1
vote
2answers
101 views

how to 'Scale up' my procedurally generated island/continent without losing its uniqueness?

Currently I am trying to make a procedural terrain generator. When I first started creating my terrain generator I decided to use a radial mask to generate my islands/continents like so: But as ...
1
vote
1answer
59 views

Smooth slow pixel art movement MonoGame/XNA

When ever I move a sprite that is scaling using point filtering slower then 1 pixel for example 0.1 pixels the movement becomes choppy/jerky instead of moving in sub pixel movement it jumps from pixel ...
0
votes
0answers
15 views

save and view snapshot image from android device

I'm having a problem with saving image into an android device this is what i did My java class : package com.test.app; import com.unity3d.player.UnityPlayerActivity; import android.os.Bundle; ...
1
vote
1answer
38 views

XNA Monogame - Move .dll and .xml root folder

I was just wondering if it's possible to move the dll and xml files into a subfolder, like in this picture: Thanks !
0
votes
1answer
47 views

How to deal with events in a game with multiple players, in Unity?

As I'm developing our game I have asked myself a couple times "When we have more than 1 player, how will I ensure events from player A do not crossover to player B?" As an example, lets say player A ...
-1
votes
0answers
76 views

Is XNA still relevant? [closed]

I am currently devlopping a game with XNA. But the community seems to not be active anymore. That's why I am asking if I should still go on... What's the advantage of using Unity3D ? Will I be able to ...
1
vote
1answer
45 views

Unity2D: Automatic scaling of camera and sprites

I'm working on a point-and-click adventure game using Unity2D for mobile devices and possible PCs and I'm trying to wrap my head around supporting devices with different screen sizes and aspect ...
0
votes
1answer
19 views

Changing the texture filtering methodology within the same SpriteBatch Begin/End pair

How would I go about using changing the texture filtering method being used within the same SpriteBatch Begin/End pairing? I have this code so far. spriteBatch.Begin(SpriteSortMode.Deferred, ...
2
votes
1answer
109 views

Why are Texture2d arrays so expensive? [closed]

I'm building a 2d engine in C# and I have several static sprites that have multiple color variations. Ok, easy enough, I create the Texture2D images at start time, then stuff them into an array, and ...
0
votes
2answers
92 views

How to stop objects pushing each other away on collision?

I'm creating something along the lines of Super Smash Brothers. There's a problem with the collision between the two players and projectiles. We have rigid body on the characters and projectiles and ...
0
votes
1answer
33 views

MonoGame InstancePlayLimitException on Windows w/ OpenGL

Why am I getting the InstancePlayLimitException when playing several SoundEffects per second despite there being no limit unless programming for mobile? It occurs after only a few seconds of repeated ...
0
votes
2answers
70 views

How to add a logo to a captured image?

I have a plane which contain a WebCamTexture and a button to capture the image script to capture the image void CaptureAndSave () { Debug.Log (Camera_panel_script.webCameraTexture); ...
-2
votes
0answers
41 views

i want to increase timer by 40 sec but code is not working . help me [closed]

using UnityEngine; using System.Collections; public class Timer : MonoBehaviour { public double timeremaining = 40 ; public double newcount ; // Use this for initialization void Start () ...
1
vote
1answer
48 views

Rotate on key down, revert rotate on key up?

How would I rotate an object a certain number of degrees when the left arrow is pressed and then rotate it back to its start when the left arrow is released?
1
vote
1answer
48 views

Good way to support multiple types of triangles? (C# XNA)

[this question is somewhat long. here's my question in a nutshell] I want to use multiple types of Vertex data types for my triangle, interchangeably. So if I have a generic type T private void ...
0
votes
0answers
31 views

LineRenderer is not collide [closed]

I am trying to make a jumble word game in which there are number of English letters in matrix form and the user needs to make a proper English word by drawing a line between letters. The line can be ...
-2
votes
0answers
33 views

i am trying to access static variable from class “Scoremanager” to “Timeincrease”.but i have got an error [closed]

using UnityEngine; using System.Collections; public class Timeincrease : MonoBehaviour { //public Scoremanager plustime ; Animator animax ; void Start(){ int x = ...
1
vote
1answer
36 views

Pick which directional light shades which object

Suppose you have two directional lights pointing at one sphere from different angles. You would expect the sphere to cast two shadows, but it turns out that this isn't the default behavior. The first ...
0
votes
0answers
27 views

Raycasting from vertices is not working

I have two perpendicular planes in xz and yz like this I want to find the projection of the vertices of plane 2 on plane 1 using raycasting.The rays are hitting the plane but the log is showing ...
1
vote
1answer
54 views

From XML to class method

I'm trying to implement a dialogue system for a game in Unity(c#). I'm going to use xml cause I want the dialogues to be editable/added from outside. I have a practical problem. Let's say I got this ...
0
votes
2answers
36 views

Why is this 2d game object platform not moving [closed]

I found this code on a website and translated it to C#. While there are no errors, the platform still doesn't move. It's probably something really simple but I can't figure it out. My game scene: ...
0
votes
1answer
51 views

How to find the closest point on a plane

So I have this terrain with a perpendicular plane setup, now I want to move the vertices of the plane to their closest resp. vertices on the terrain. I made a drawing to illustrate my thoughts. ...
0
votes
1answer
124 views

Vector2 to 3D world coordinates

I think I am almost there, but not quite. I am trying to transform a 2D point, (in the following example (100,100)) into 3D world coordinates, in order to draw my 3D Model named TestModel in ...
0
votes
0answers
33 views

How would I change an object's fixed angle upon collision with another object?

I'm trying to get an object to change its fixed angle once it gets hit with an object via collision, unless there's a better way. This is the code that I was using for a slingshot weapon so I figured ...
1
vote
1answer
75 views

How can I test if one point can “see” another point. (XNA)

I want to test if my enemy can see the player, however I want this to be pixel-perfect. I already have all of the solid objects drawing into a separate render state. It should be noted that every ...
1
vote
1answer
39 views

Event handling on own UI implementation in XNA

I´m creating a game in XNA with my own UI and its controls/components. Currently I have some problems with the event handling. Let me tell me the way I do it right now. Every object is handles as a ...
0
votes
2answers
66 views

How to make instantiated objects not on top of each other?

I randomly instantiate game objects, to create a dynamic "sky map". But some planets appear on top of another ones. I'm trying to solve this problem with Collision detection and Colliders, but it ...
-1
votes
2answers
76 views

Rotating an object continously with OnMouseDown

I have a script that works but it does not do what I want it to do. My script makes an object rotate on when another is clicked. However, I want the object to continuously rotate until I click on the ...
0
votes
0answers
15 views

Rotating an object continously in UNITY with onclick [duplicate]

I have a script that works but it does not do what I want it to do. My script makes an object rotate on when another is clicked. However, I want the object to continuously rotate until I click on the ...
0
votes
1answer
40 views

Creating a queue for BeginInvoke method - loading chunks

I have a voxel game similar to Minecraft. I have a funciton PushLoadedChunks(Direction) that pushes all of the loaded chunks forward, backward, left, right. This is done with ...
2
votes
0answers
66 views

Basic Node Based Pathfinding

I am new to pathfinding but i have read and watched through some articles, blogs and videos about Pathfinding. Since those that i have read and watched from are mainly for RTS Games, Grid Based ...
0
votes
2answers
83 views

Collision detection with moving tilemap

I have a player whose who's sprite is 48* 32. I know the player's position. The player can move up and down based on user input. I have a tilemap which moves. Here is an example of the array I use to ...
1
vote
1answer
37 views

How to write testable MonoBehaviour and test scripts in Unity?

I had problems with decoupled scripts and exposing interfaces in Unity, and these answers helped me a lot. But now, since I don't have hard-coded references in my scripts, I wanted to write unit tests ...
1
vote
1answer
64 views

Store game events data with XML

I am new in the game development and now I am at the stage when you need to fill the game content. I want to create the events that occur with the player (like in FTL). Now I make these events with ...
-1
votes
1answer
44 views

How to render 2d image with sharpdx after post processing by hlsl [on hold]

using System; using System.Diagnostics; using System.Windows.Forms; using SharpDX; using SharpDX.D3DCompiler; using SharpDX.Direct3D11; using SharpDX.Direct3D; using SharpDX.DXGI; using ...
0
votes
1answer
55 views

Center a 3D model to cursor's position

I am having a hard time understanding how to go about this. I have a 2D game with some 3D models in it. I want to move a 3D model to where the mouse cursor is currently at in every frame (In other ...