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

iOS Game that Runs Continuously in Background

I'm trying to understand the most logical way of creating an iOS game that runs continuously in the background. For example.. you have tower and enemy waves. The game has endless enemy waves even ...
0
votes
0answers
31 views

Windows 8 desktop game development [on hold]

I m keen to develop a physics game for windows 8 desktop. It includes 3 levels. I m willing to do it using C# , Xaml and sharpDx. But as i m naive to this, and have to develope it in 2 months ...
2
votes
0answers
71 views

Game performs poorly when sideloaded [on hold]

My game runs smooth when I deploy it to my windows phone directly from Visual Studio 2012 in debugging mode. But when I sideload/deploy the same .xap file with the Application Deployment Tool, the ...
1
vote
1answer
123 views

Grid-Based 2D Lighting Problems

I am aware this question has been asked before, but unfortunately I am new to the language, so the complicated explanations I've found do not help me in the least. I need a lighting engine for my ...
1
vote
1answer
40 views

ContentManager in XNA cant find any XML

Im making a game in XNA 4 and this is the first time I'm using the Content loader to initialize a simple class with a XML file, but no matter how many guide I follow, or how simple or complicated is ...
1
vote
2answers
144 views

Physics for moving blocks

I'm working on a 2D game for windows phone where the player moves blocks around to bounce a laser beams. I need to create some simple physics for moving the blocks. For the moment I have a simple ...
0
votes
0answers
19 views

Gui not showing when accessing AudioSource.Volume

I have A GuiManager class A SoundManager with 2 AudioSources SfxPlayer is created in the inspector on the same object as SoundManager MusicPlayer is created programatically within the SoundManager ...
1
vote
1answer
66 views

Non OnGUI based progress bar

How can I make a progress bar appear in Unity that doesn't make use of the OnGUI functionality in C#? I'm doing something with an Oculus and the OnGUI stuff doesn't work too well in a stereoscopic ...
2
votes
1answer
170 views

How to give a ball a following texture trailing effect

How do I draw copies of the leading texture so that there is a line of the leading ball following behind it? (that don't collide) So far I have tried to create the effect by placing another graphic 2 ...
5
votes
3answers
250 views

Slerping rotation mirrors

I rotate my game character to watch at the target using the following code: transform.rotation = Quaternion.Slerp(startQuaternion, lookQuaternion, turningNormalizer*turningSpeed/10f) ...
0
votes
0answers
42 views

Saving to a file in C# [closed]

If I use this code: using (StreamWriter streamWriter = new StreamWriter("Content/player.txt", true)) { ...
0
votes
1answer
90 views

Unity GUI not in build, but works fine in editor

I have: GUITexture attached to an object A script that has GUIStyles created for the Textfield and Buttons that are created in OnGUI(). This script is attached to the same object in number 1 3 ...
-1
votes
0answers
74 views

Are VM-based languages becoming viable for Graphics since the move to GPU computing? [closed]

Perhaps the title is not the most clear, so let me elaborate it more: I am talking about VM-based languages, by that I mean languages that run on the JVM (java) and for example C#. Also I am talking ...
0
votes
0answers
71 views

Dynamic real-time pathfinding with C# and unity [closed]

A buddy and I are working on a simple 2D top down arena combat game similar to OpenGLAD (grew up on ye olde GLADIATOR). Thing is, we want to make some substantial deviation from our source of ...
-1
votes
0answers
59 views

Unity 3D coding language, C# or JavaScript [closed]

Hello to the gaming community. I am a budding game designer, learning to code for the first time in my life. I did learned c++ in school, 8 years back, so I sort of understand the logic when people ...
1
vote
2answers
91 views

GameObject in hierarchy needs to know who it belongs to

I have two objects from the same prefab. They have bodies and swords. What good options do i have to check if a sword belongs to player2 or player1? For example when body registers that it has been ...
0
votes
1answer
54 views

Rotating object along bezier curve: not rotating enough?

I tried to follow the instructions from the threads on the forum (Cocos2d rotating sprite while moving with CCBezierBy) with Unity, in order to rotate my object as it moves along a bezier curve. But ...
0
votes
2answers
64 views

OnTrigger not firing consistently

I have a Prefab called Player which has a Body and a Sword. The game uses 2 instances of Player, Player1 and Player2. I use Player1 to strike Player2. This is code on the sword. My hope is that ...
0
votes
1answer
108 views

Octrees as data structure

In my cube world, I want to use octrees to represent my chunks of 20x20x20 cubes for frustum and occlusion culling. I understand how octrees work, I just dont know if I'm going about this the right ...
0
votes
1answer
44 views

Obtain rectangle indicating 2D world space camera can see

I have a 2D tile based game in XNA, with a moveable camera that can scroll around and zoom. I'm trying to obtain a rectangle which indicates the area, in world space, that my camera is looking at, so ...
8
votes
1answer
179 views

How to change Gravity towards certain object in Unity?

I have two spheres in Unity. One is 1000x in size other is 1x in size. So I want the smaller sphere to be attracted to bigger sphere. So how do I do it. I know that it can be down through gravity ...
0
votes
1answer
65 views

Unity Extension method with coroutine

Is it possible to have extension methods that starts coroutines? Id like to have an extension method for the GameObject that checks if itself has a renderer and a material and then lerps the color to ...
0
votes
0answers
85 views

Diamond Isometric Tile Picking C# Xna

I recently converted the display style of a isometric map from staggered to diamond and I can't figure out the tile picking process. I'm well aware of the other existing threads regarding this subject ...
0
votes
1answer
75 views

Stacking items, c# XNA: When item reaches maximum stack, new items added are also maximum stack

haven't used this site before so I'm sorry if I format my post badly. I am trying to build a stackable inventory for my game in c# XNA and the problem I've encountered is when an item in my inventory ...
0
votes
0answers
53 views

Circular grid creation

How to create a circular grid (Preferably using Unity3D C#). Hex wont work in my case as I need to read circular object's precise placement and positioning. It needs to be clickable as well. My ...
0
votes
2answers
85 views

XNA C# Making the game scaleable for different resolutions [closed]

I am currently developing a game in C# and XNA, and I want it to look right at all resolutions. How would I get started with doing that?
0
votes
1answer
70 views

Changing enum in a different class for screen

I'm trying to make a start menu for my game and my code uses Enum's to moniter the screen state. Now i want to change the screenstate declared in the main class, in my Background class Screen screen ...
-4
votes
1answer
111 views

Does C# affect performance in Unity? [closed]

similar question :How does Unity use C# as a scripting language? In Unity , some functions like Update , run per object , per frame. so , is .Net framework involved at runtime ? could it affect ...
-3
votes
0answers
46 views

Larger scale chunking

I was able to cull whole cubes in my chunk class, so my next step is creating a larger map with a grayscale image, and then take groups of 20x20 cubes and store them into chunks. The chunks will then ...
1
vote
3answers
83 views

Error on running exe, build using SharpDX

I have developed a windows application to read gamepad using SharpDx (XInput) and C# (VS 2008). The application is running smoothly in my development environment. But when i move to some other machine ...
1
vote
1answer
134 views

Correct rotation with Quaternion

I have some problems with a rotating marble. I've tried it with Matrix.CreateFromYawPitchRoll and Matrix.CreateRotation but there were some problems, I think it's due to the Gimbal lock effect. So, ...
0
votes
0answers
31 views

Determining desktop bounds by D3D9 adapter

I've got a Direct3D 9 application which normally runs full-screen. The user is able to select a display adapter to determine which screen it is shown on. I also offer a Windowed mode which launches ...
1
vote
1answer
180 views

What's the simplest way to determine the size of an empty space between rectangles?

I'm working on a dungeon generator and I'd like to be able to connect rooms through other rooms. What I currently have set up is two dictionaries and a map (an int array.) The first dictionary holds ...
0
votes
1answer
109 views

Use light cone/range as a Trigger

I was wondering, in Unity 3D, how I could do something with the Spot Light (Range/cone) as a trigger? Since it would be very interesting to be able to manipulate whats actually in sight of Light ...
0
votes
1answer
213 views

Hook into League of Legends client [closed]

I would like to write a small software which will hook into the League of Legends client and record my performances and store them locally, because Riot only stores last 10 matches. Is there some way ...
-1
votes
1answer
111 views

How do I make a health bar that drains when the player takes damage? C#/XNA

I've drawn a Health Bar before and had it drain/refill on a button press using if statements and rectangles. First I loaded the image, then I set a new rectangle to be equal to the image's height and ...
1
vote
2answers
134 views

C# Design for Ability System

I'm a novice programmer but I have completed a pre-university in web prog so I am not a total noob. I'm using Unity, but this is just C# for now. This is my first big project and I need some ...
-1
votes
0answers
66 views

2d platformer Tiles collision

I have a problem with detecting collision between my player and the tiles that makes the map. I have been looking all day for a solution but I can't seem to find one that suits my needs. Here is how ...
1
vote
1answer
86 views

XNA - Where should I start playing a song?

I am just wondering where is the best place to start playing the background song for a game. In the loadContent() method, Draw(), or Update() methods or when I initialize it? I am trying to make it ...
-1
votes
0answers
57 views

Rendering WebCam onto Texture2D

I'm really new to C# XNA and I'm experimenting with a webcam trying to get it to render to a Texture2D on a rectangle. All I'm getting is black in my rectangle. I'm using a library called MetriCam ...
2
votes
2answers
97 views

Get GameTime's milliseconds in plain format

I am trying to fire an action every 125ms. To get the current milliseconds, I go this way: double passedMs = GameTime.TotalGameTime.TotalMilliseconds; //this is a double as well currentMs += ...
0
votes
0answers
21 views

XNA Accessing a particluar type of screen from the screen manager

I am using monogame and the screen manager sample. I have a small question regarding how to access a particular type of game screen; GamePlayScreen. All of the screens extend a class GameScreen and ...
2
votes
1answer
148 views

Teamviewer doesn't show my game screen

I've been building a 3D engine from scratch using C# and I've tried to show the result to a friend of mine using Teamviewer. When my demo game starts he doesn't see it. He can only see the last active ...
0
votes
0answers
44 views

Monogame Font Problems in Windows Metro

Last week, I decided to see if I could develop a Windows 8 game for Metro using Monogame. I got the app to load, run and quit properly, but I cannot get fonts to render no matter what I try. When I ...
0
votes
2answers
110 views

Best way to play footstep-sounds of character?

I am developing an XNA-Game, which is pretty much a runner game (side-scrolling). Now I am in the middle of adding sounds to my game. And as it turns out, I am having quite some problems with the ...
1
vote
1answer
143 views

Can I use DirectX with C#?

I thought that if you wanted to make games using DirectX, you had to know C++. But I recently found out that that is not actually true. It looks like some parts of Direct3D can be used from C#. This ...
0
votes
1answer
125 views

Representing a world in memory

I'm attempting to write a chunk based map system for a game, where as the player moves around chunks are loaded/unloaded, so that the program doesn't run out of memory by having the whole map in ...
0
votes
0answers
58 views

I am getting an AccessViolationException error in Visual Studio 2012 and MonoGame w/ C#

Here is a link to a screenshot of the error: It also says OpenTK.pdb Not Open as well. This happens when I close the game window after running it. When I comment out this part of my code, it ...
0
votes
0answers
52 views

Loading sound file into monogame

I'm trying to load sound into my game. I downloaded an .mp3 sound (a second long) and tried to load it both as Song and as SoundEffect, but it didn't work, so I tried loading the same sound but as ...
0
votes
2answers
204 views

Cube worlds, instancing vs mesh generation

For a Minecraft type game, what are the pros and cons of hardware instancing the terrain vs generating a mesh of vertices based on what's visible? The terrain is dynamic so cubes will be ...