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

How to initialize once for all a static field of a custom editor in unity

I have a custom editor wich has a static field. Suppose you have a static field of type MyObject: public class myEditor : Editor { ... private static MyObject myObj; ... } I'd like to ...
1
vote
3answers
147 views

Responsibility of rendering in a component/entity game engine

I am developing a simple component/entity game engine in C# (https://github.com/alexvm/BlueShift) and have a few questions regarding the responsibility of certain items in the engine itself. I have ...
0
votes
0answers
17 views

Relationship between Monogame and Cocos2D-XNA and CocosSharp [closed]

I have very simple questions,... I already know that CocosSharp is a fork of Cocos2D-XNA but I am not certain if what is the relationship of the CocosSharp and Cocos2D-XNA to Monogame. I have searched ...
0
votes
0answers
18 views

Upload texture 2d bytes to web server issues [closed]

This is my first post on here. I require a bit of help for a bit of an oddball system here. Basically what I have is a registration/user signup embedded in a game of mine and I have in place a system ...
0
votes
1answer
87 views

Remove item after crafting

I'm having one last problem with my crafting system. Say an item takes 2 rocks, 1 twig, and 1 vine. When I craft the item, only 1 of each item is removed instead of the correct amount of items related ...
3
votes
1answer
310 views

How can I separate component functionality from networking logic?

Is it possible to make network independent components that allow networking details to be specified externally? For example, if I have a "Follow" script that follows a game object, it would need to ...
0
votes
0answers
19 views

Unity3D C#: How to resize an inputfield according the content which is set dynamic

I've got an InputField where the text is filled in upon getting a string back from the server. We can debug the entire text so we receive it correctly. However the text is too long to fit in our ...
0
votes
0answers
27 views

Monogame: Unsupported Landscape Screen Orientation on iOS 8.0

Did anyone have a fix on the landscape orientation problem that monogame has or is it the iOS 8.0 that has a bug? I have visited the github of monogame and tried to compile the latest developer ...
1
vote
1answer
94 views

How to gradually decrease opacity of model?

I have been searching for this matter for a long time and slowly I begin to think that this option is not available in XNA for Windows Phone. I am trying to get a 3D-Model to be drawn at 50% ...
0
votes
0answers
21 views

Creating a ray with angle movement restrictions

In Unity is it possible to create a ray which has movement restrictions. As in creating a ray which is fixed to one point. When this point is moved around. The line is also moved around. But when the ...
0
votes
1answer
364 views

Getting a pixel of Sprite at the cursor position in Unity

Summary: I've been trying to figure out a way to use simple box colliders as a nice and efficient "first pass" collider. For the "second pass", I want to check that the area clicked has an alpha value ...
0
votes
1answer
62 views

Best way to go about collision between rectangle and bool array containing pixel data?

Basically, if I have an array along the lines of bool[] collision; Filled with a value for each pixel in the sprite I am checking collision against (pixel 1 = true, pixel 2 = false etc), how do ...
1
vote
1answer
136 views

Trouble With Quaternions and orbital camera:

UPDATED: I have been trying to implement a Orbital Camera of sorts in a engine I am currently doing in Unity3D, the issue being I can't seem to do the correct rotation no matter what. This is what it ...
0
votes
2answers
78 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 : ...
3
votes
1answer
84 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
1answer
54 views

Find index of GameObject in array of GameObjects

In my script, i have declared an array of GameObjects like this: public GameObject[] go;ld object name. `String temp;` Also, i have a temporary variable to ho Then, i assigned objects to elements ...
0
votes
0answers
52 views

C# Unity Camera smoothing [closed]

I am using this code to smooth cameras' movement with the moving object but when the object reaches max velocity it seems to lag (not fps problem). using UnityEngine; using System.Collections; ...
1
vote
1answer
27 views

How to transform Unity terrain coordinates

My map creator created some terrain in Unity, but all my scripts are based on the X-Y axis. Is there an easy and smart way to transform them into Z-Y, or do I have to change all the vector variables ...
0
votes
1answer
42 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
53 views

How to get display resolution (screen size)?

How to get display resolution in XNA/Monogame ? I tried these on my monitor (1600x900): The below give me 800,600 //1. GraphicsDevice.DisplayMode.Width GraphicsDevice.DisplayMode.Height //2. ...
1
vote
1answer
101 views

How to draw a diagonal fade-in and fade-out?

How to draw a diagonal fade-in/fade-out in 2D using MonoGame draw API? For a simple (non-directional) fade-in/out drawing the background with alpha variation do the tricks, but what is the standard ...
1
vote
2answers
58 views

Better way to position objects in a Matrix/Grid shape

I am working on space a invader game and I'm trying to build levels such that in each of them, the aliens are positioned in a different shape. I have a rectangle shape, circle shape, and a grid-like ...
0
votes
0answers
46 views

Basic .FBX Animation for the Complete Novice [on hold]

okay, so in terms of 3D in XNA, I am pretty much a total beginner. I know all my matrices, basic lighting, transforms etc, but I'm finding 3D animation very confusing. I have been looking a bit at the ...
1
vote
1answer
217 views

Camera movement and threshold not working

I have a platformer that is in progress, part of this has a camera which I only want to move when the character moves out of a certain threshold, to try to accomplish this I have the following if ...
2
votes
1answer
64 views

Mock Collision Object in Unity

Problem: I'm trying to set up some tests with mock collision objects, but i cannot construct collisions with custom objects. What I'm trying to do: Collision2D col = new Collision2D(); ...
0
votes
0answers
13 views

Unity StartApp Ad Sdk dims the screen down when showed

I'm making an android game Which Never Sleeps and it don't. But When Using Startapp ad sdk It seems that it pauses the game and the mobile sleeps when the ad is shown. As if the sdk handles it from ...
0
votes
0answers
19 views

TouchCollection positon not matching button position

I am using a TouchCollection of touchlocations to determine if a button has been pressed, However the touchlocation position does not correspond with the button location as I would expect, the touch ...
0
votes
1answer
58 views

Calculate polygon points from image

I'm new to OpenGL, so please excuse my brevity and/or lack of technical knowledge of the subject. I need some help with rendering a polygon on an OpenGL canvas (using C# w/ Tao). I understand that I ...
-2
votes
1answer
48 views

Split up a string and add each as an item in an array [closed]

I have an input string and input the following "2, 4, 5, 7, 10" (for example). How can I split it as an object(item) for a list array? so it would be in each item "2", "4", "5", "7", "10"
0
votes
1answer
125 views

Tiling 2D textures in random order

I am wondering what the best way to make a random set of 2D textures. Currently I have tried the follow code but I am aware that when this comes to collisions that would be an issue. Therefore I would ...
2
votes
1answer
137 views

Support for different resolutions in a tabletop environment

Right now I am experimenting with XAML and C# to write a small Windows Store App which supports displaying a playmat with cards. However not everyone uses the same resolution and with a somehow fixed ...
0
votes
1answer
60 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 ...
5
votes
1answer
780 views

Should the networking of my game be a component or a service? [on hold]

I am working on a windows game and I am trying to understand the XNA GameComponents and GameServices classes and use. From what I understand about a component is that it has an Update method that ...
0
votes
1answer
174 views

Multiple joysticks event handling

I want to make a game which is totally same idea as "Who pressed the button answers the question". I have 2 joysticks and both are connected to a pc. My application will be Winforms and I will ...
0
votes
1answer
306 views

Angled topdown perspective camera for 2.5d game

I have a 2d tile based game created using Unity's 2d tools and orthographic camera: The tiles are created by programmatically generating a mesh, assigning a texture to each pair of triangles, and ...
0
votes
1answer
104 views

Collision detection doesn't register until player sprite jumps

I have implemented a shooting mechanic into my game, and the act of shooting works fine. The shooting work is done in my "game1" class. The issue that arises is when I incorporate collision detection ...
0
votes
0answers
79 views

C# Monogame & Farseer Physics: Collisions [on hold]

I am a begginer. I am using Monogame and Farseer Physics Library in C#. (latest versions) In my game, whenever my ball (circle) hits the corner of a rectangle, (or even another circle), it is ...
0
votes
0answers
95 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
62 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 ...
2
votes
1answer
119 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
vote
1answer
131 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
1answer
39 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. ...
0
votes
1answer
219 views

How can I create a body with a hole in the middle?

I want to create a shape that looks like the black contour in this picture: The shape must be empty in the middle(white surface). The white surface must not be part of the shape, just the black ...
-1
votes
1answer
81 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
2answers
339 views

Set new forward directions based on camera position

I have a 3rd person camera which can rotate around the player. When I look at the back of the player and press forward, player goes forward. Then I rotate 360 around the player and "forward ...
0
votes
1answer
47 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
36 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 ...
0
votes
1answer
108 views

How can I allow players to draw decals for their avatar and items?

I want the player to be able to draw a simple symbol, even if it's pixelated black or white, that their character can have on their weapons, armour, forehead or even markers and monuments. How would I ...
0
votes
2answers
42 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
1answer
41 views

Trigger scene loading in one device from another device using Unity WWW class

I have a master device and client device. I want to load a scene in the client device by pressing a button in the master. My method is, when the button is pressed in the master device, a data is ...