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

How to create laser redirection?

Think portal 2, where a laser can go through a cube, and depending on the rotation of that cube, it will redirect it. Examples: Here is my barely functioning code. It works for one cube, I'm able ...
0
votes
0answers
52 views

How do I create a dungeon mapper [on hold]

I'm attempting to write a dungeon mapper based on the random dungeon generation tables in the AD&D DMG starting on pg. 169. What I don't know how to do is, where do I start? Meaning, I don't know ...
0
votes
0answers
13 views

Draw my array at a position defined with Vector2

I'm developing a space invaders game in C# using XNA Game Studio. So I got some of the invader logic complete: An array holds the invaders and draws them on the screen, animated and moving.But I can't ...
0
votes
1answer
52 views

How do I avoid going through objects at high speed? [duplicate]

I am quite the beginner in XNA. I have only recently started using GameComponents. I have a multiplayer game called Better Pong. I move the ball (which is an object) by incrementing the Vector2 (the ...
0
votes
0answers
86 views

How manage target selection in a high speed brawler?

I'm thinking of games like Batman Arkham Asylum and the Assassin's Creed series, in which landing the first blow gives you a soft lock that automatically rotates you to continue facing the target as ...
0
votes
1answer
28 views

How to invisible first window on click unity3d

I have a window called "red window" on scene1. When i click on the hello world button it should displays another window called green window and the first window should invisible. How it possible. ...
2
votes
1answer
68 views

Modular enemy behaviour in a shmup - Delegates unsuitable?

I'm creating a shmup type game and trying to implement the enemy wave system, which includes the associated enemy behaviours like their movement and bullet patterns. I've tried to separate the ...
-1
votes
1answer
69 views

Sprites get terribly scaled

I've been making a Space Invaders game in XNA for a while. I got the invaders animated and contained within an array. But when I call spriteBatch.Draw and debug the invaders sprites get a huge ...
0
votes
1answer
35 views

How to access multiple 2DTexture which is assigned in Unity3D inspector panel created by an array in C#?

I am making a puzzle game, i made 5X5 cube, lets take example of orange. very left column is orange, upper with orange dot is static and lower with orange dot is also static. inbetween there are 3 ...
0
votes
1answer
33 views

Is there a way to use the ContentManager with full directory paths

So i want to figure out a way to use the ContentManager.Load method with full directory paths, so lets say Content.Load<T>(@"Images\SomeImage"); becomes ...
-1
votes
0answers
15 views

Xna collision Prob [on hold]

i have problem with doing game 2D now till now i did: create Player + map + Keyboard+ mouse now i am doing the collision with the Player and the map and i try that if the Player though One or more ...
0
votes
2answers
34 views

Loading content into an Winforms/XNA Editor's content project

So i am bulding a game editor/engine basically for teh lulz but i have encountered a problem i cannot seem to fix, i cannot load any new content through the Winforms UI during runtime. I tried using ...
0
votes
0answers
38 views

C# BreakOut Game [closed]

Hi this is my first year of Uni doing a programming degree, I am beginner to the whole concept. Firstly I need help with getting the ball (which is drawn in a pictureBox) to collide with the bat ...
1
vote
1answer
29 views

Unity 4.6: Position jumps when switching Canvas render mode from Overlay to camera in code

In the project I am currently working on I have two sets of main UI: one set that is on the screen at all times for the players use, and the second set which the player can open and look at to gauge ...
0
votes
0answers
18 views

some images on grid are not being displayed using random . [closed]

So I have an image that is going to be presented in a grid in random spots and I have a 2d array that will check if a position in the array is available or not. the problem is that not all images are ...
0
votes
0answers
40 views

Dynamically destroy objects when player enters a boxcollider2D

What would be the best approach for destroying dynamically objects when player enters a boxcollider2D? Currently using parent objects with boxcollider2d to activate OnTriggerEnter2D, boxcollider2d is ...
-2
votes
0answers
67 views

Can anyone explain that code? [closed]

public class Player : MonoBehaviour { public float speed =10f; public Vector2 maxVelocity = new Vector2(3, 5); void Update () { var forceX = 0f; var forceY = 0f; var absVelX = ...
0
votes
1answer
58 views

Unity, Cannot change a single Vector2 element of mesh.uv?

I have a simple procedurally generated mesh, with uvs that tile correctly for(int i=1; i<vertices; i++) { uv[i] = new Vector2(x,z); //pseudocode } mesh.uv = uv; This works fine. However if ...
0
votes
2answers
47 views

GUI Text counter Skips numbers after a few seconds

The counter counts perfectly up until the first bump. After this it starts to add about 4-5 "points" instead of just 1. using UnityEngine; using System.Collections; public class GameController : ...
0
votes
1answer
37 views

I am trying to implement a falling animation to my game and i am having alot of problems doing so

i am trying to have it so that when my character isnt touching anything he plays an animation of falling, yet when he moves from one game object to different one, he plays the animation. for example ...
0
votes
1answer
35 views

Change one prefab without changing all prefabs

I have this code that will spawn in a lot of prefabs. It then edits the prefabs. The problem is that every time it changes a prefab it will reset and move all the other ones. Can you please explain ...
-1
votes
0answers
34 views

C# OpenTK - How to get a Bitmap from a loaded Texture [closed]

After some searching around, I put this code together: public static Bitmap BMPfromTextureID(int id) { int w, h; GL.BindTexture(TextureTarget.ProxyTexture2D, id); ...
-1
votes
1answer
64 views

Game Lag due to so many vertices and edges in Unity free version [closed]

Actually, I'm new to Unity and I'm making a car racing Game. Now, I'm stuck at some point. My Problem is:- When i run my game into phone, It stuck badly and reason is--- Whenever there will be ...
1
vote
2answers
94 views

Framerate dependent movement

I'm moving my character controller using Euler integration like this: Vector3 originalPos = transform.position; Vector3 acceleration = Physics.gravity; velocity += acceleration * Time.deltaTime; ...
0
votes
1answer
45 views

Transparency using HLSL in XNA

I currently working on Depth Data on Kinect SDK v1.8 on XNA and I wanna show an Image Inside the Depth view of Human body. the image below is just an example of what I wanna do : ...
0
votes
1answer
27 views

Editing the components of an instantiated prefab

Is it possible to edit one or more components of an instantiated prefab ? For example if you instantiated five cube prefabs. Is it possible to reference each of the cube prefab and change a value ...
-1
votes
1answer
20 views

Sound plays several times upon collision

Upon collision, my sound effect plays several times. How can I fix this? public Sprite charAlive, charDead; public AudioClip popAudio; void OnCollisionEnter2D (Collision2D col ){ if ...
0
votes
0answers
24 views

Resize gameObject when it has extended a restricted area

So here i have an image will provide a better understanding of my problem. So currently i have some white blocks and within the white blocks i have some cyan bordered boxes. So the current problem i ...
5
votes
3answers
908 views

How to find path in graph without crossing the walls?

I would like to know how to find path in a graph while having the edges "double-sided". Consider this scenario: I have list of the line segments. These represents "walls" or rather impassable edges ...
0
votes
1answer
57 views

Marching cubes leaving holes in the mesh

Hi I'm trying to reproduce GPU Gems 3 chapter 1 (Generating Complex Procedural Terrains Using the GPU) and so far I managed the basics... Now I'm betting some strange output. I started with the ...
0
votes
0answers
50 views

Load character instead of load level

I have some trouble finding out how I can load my character at the start of the level, instead of resetting the whole thing. The game mechanics are quite straight forward; don't touch the walls. If ...
-1
votes
1answer
44 views

How to increase player Lifes count

I am new in Unity Game Development. I am designing infinite game using C# scripting. There are many cubes in my game scene. if single cube is hit by player, He gets 100 points. if same color, two ...
0
votes
1answer
20 views

How can I Separate model parts when I click on it

Here I am using a heart model, in dis model I want to identify each part .Under the model Iam having 3 part(Sub1,Sub2,sub3)When I click on the each part how to separate or differentiate it by using ...
2
votes
4answers
115 views

.fnt font file offset issues in Unity

I want to display 2D text in Unity using bitmap fonts (.fnt files). There are some solutions out there, but I'm writing my own. Each character is a game object with a SpriteRenderer. It works. ...
0
votes
1answer
81 views

Collectible Card Game Card Text To Code Association

I am making a collectible card game using a command pattern for using card abilities and creating a class for each card text ability. The game is setup to work with an authoritative server structure. ...
0
votes
0answers
32 views

Game Development Books [duplicate]

I am looking to expand my C# knowledge and am looking into a fun, long term project to help expand my knowledge. I've been studying programming for about a year, but I would still consider myself a ...
-1
votes
1answer
112 views

C# XNA - How to animate using Texture Atlas/ Sprite Sheet

I have a problem which I need to resolve. I am making a Space Invaders game in C# XNA. I've been following this tutorial for the Invaders: ...
0
votes
0answers
33 views

How do I apply Farseer Physics Engine Collision on my image? I tried it on my codes and it is not working

How do I apply Farseer Physics Engine Collision on my image? I tried it on my codes and it is not working. PoolGameSingle poolgame = new PoolGameSingle(); var cue = poolgame.CueStick; ...
0
votes
1answer
72 views

OpenGL not rendering full scene, it is a mystery [closed]

I am trying to draw a scene in the sort of style of mock vector graphics. I've helped on a 2D game before with GLSL, but I tried to keep a simple approach to this project since I'm working by myself, ...
0
votes
3answers
140 views

Do I need to learn any physics if I use a physics engine? [closed]

Complete novice out here. Of course I know basic physics like mass and inertia. I don't want to make an engine I just want to make a game and use a physics engine made by someone else. Do I need to ...
0
votes
0answers
56 views

How to overlay texture materials on top of each other in Unity 2D tiled game

I'm learning how to do a 2D tile-based game. So far, I have followed this tutorial which seems like a good starting point. With his method of building the raw triangles and then applying the uvs, I ...
0
votes
2answers
92 views

How to Create a New Instance of a Game Object

Alright, please don't scald me here haha. I'm very new to XNA, C#, and game development as a whole. I have done web-design, but that is my main experience with programming. It is a Space Invaders ...
0
votes
3answers
106 views

OpenGL Texture Mapping distorts image

So, I'm just trying to draw a texture to two triangles that are the same size as the viewport, but it breaks up the image and distorts it. I have tried resizing the image file and everything, but ...
0
votes
1answer
185 views

2D sprite 360 degrees rotation according to the mouse

I am trying to make my top down character rotate according to degrees between its position and the mouse. I'm using this code: float xDiff = mouseState.X - (graphics.PreferredBackBufferWidth / 2); ...
0
votes
1answer
76 views

How to rotate and move a model in the direction it is facing?

I am not using Unity or XNA. Eventually, I will probably use OpenTK for graphics. But for the concept of a game I'm writing, I am using the console for keyboard input and visual logging of events, ...
0
votes
1answer
130 views

OpenGL: I only see one square instead of a cube / giving information to vertex shader

I am new to OpenGL and tried to follow this tutorial. I use C# and OpenTK. So I translate the C++ Code from the Tutorial: My C#-Code: /* Hintergrundfarbe */ ...
1
vote
1answer
50 views

Yield and loading textures

I have a need to dynamically load textures from the player's filesystem. WWW provides the functionality I need, but I can't get the example code to compile. "yield www" causes my code to not compile. ...
0
votes
1answer
46 views

Loading Song in MonoGame Windows

I cannot load the song into my game. I got error in both templates WindowsDX and WindowsGL. Monogame Develop Build 1252 Both files .wma and .xnb are exist in Content folder and Build Actions are sets ...
0
votes
2answers
84 views

How to cleanly serialize/de serialize a Dictionary whose values are of a derived class using c# newtonsoft json [closed]

I am working on and entity component system and I am storing entities as a JSON file. Components are stored in an entity as a Dictionary of components. I am using newtonsoft's JSON library. After ...
0
votes
1answer
37 views

Using RPC's for movement of an object across a network [closed]

I've been building upon http://www.gamasutra.com/blogs/DarrelCusey/20130221/187128/Unity_Networking_Sample_Using_One_NetworkView.php At the moment when I spawn a sphere on the server it spawns on the ...