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

5
votes
2answers
437 views

XNA 3.1 to 4.0 Vertex Shader Not Drawing

I have recently been converting our XNA 3.1 game to XNA 4.0 and am stuck on the shaders. I have the game running, but nothing is drawing to the screen, except things not using a shader. This is only ...
1
vote
2answers
1k 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
2answers
89 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
2answers
39 views

Play animation when click on each player with in maincamera unity3d

I have 3 gameobjects player1, player2, player3, and attached script "playerscript" in to these game objects. In the main camera i have added another script called" testscript". When i click on a ...
-1
votes
2answers
115 views

How to translate along Z axis in OpenTK

I am playing around with an OpenGL sample application I downloaded for Xamarin-Android. The sample application produces a rotating colored cube I would simply like to edit it so that the rotating cube ...
5
votes
1answer
619 views

Should the networking of my game be a component or a service?

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 ...
3
votes
1answer
288 views

Jittery Movement, Uncontrollably Rotating + Front of Sprite?

So I've been looking around to try and figure out how I make my sprite face my mouse. So far the sprite moves to where my mouse is by some vector math. Now I'd like it to rotate and face the mouse as ...
2
votes
1answer
105 views

How to impale and stack targets correctly according to the collider and its coordinate?

I'm making another simple game, a catch game, where a spawning target game object must be captured using a skewer to impale it. Here how: At the start, the falling object (in red) will fall in a ...
1
vote
1answer
31 views

How do I take Direct3D9 full screen using SlimDX?

I'm writing a Direct3D9 application wrapped by SlimDX. I'm trying to take my application full screen but I am having problems. I can reset the device so that it covers the entire screen, however, it ...
1
vote
1answer
74 views

change texture at runtime

How can I change the texture at runtime. I have done changing the label(text) at runtime. The following code is used using UnityEngine; using System.Collections; public class switchtime : ...
1
vote
1answer
134 views

Render 2 images that uses different shaders

Based on the giawa/nehe tutorials, how can I render 2 images with different shaders. I'm pretty new to OpenGl and shaders so I'm not completely sure whats happening in my code, but I think the shaders ...
1
vote
1answer
914 views

How can I make caves with Unity's terrain creator?

With Unity's terrain creator, I can't simply make a "hole" on the mesh. I don't know how I would make cave-like structures other than using "rock" meshes for the roof (wich will indeed look weird) ...
1
vote
1answer
309 views

Sprite collision with color?

Is this possible? To elaborate, I am making a PacMan offshoot. Essentially it is a "zoomed in" version of the game, but the board is randomly generated. I have 11 .png files each to be used as a ...
1
vote
1answer
164 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 ...
1
vote
1answer
144 views

Spritebatch not working in winforms

I'm using the Winforms sample on the app hub and everything is working fine except my spritebatch won't draw anything unless I call Invalidate in the Draw method. I have this in my initialize method: ...
0
votes
1answer
26 views

How to retarget monogame solution vs2012

Im currently having a bit of trouble testing my multiplatform game. It originally started as an android project in monogame has extended to windows 8 and WP8. I'd like to test our the win 8 port, but ...
0
votes
1answer
101 views

Simple heart container script for 2D game (Unity)?

I'm attempting to create a simple mobile game (C#) that involves a simple three-heart life system. After searching for hours online, many of the solutions use OnGUI (which is apparently horrible for ...
0
votes
1answer
56 views

How to inplement a save-system for a complex nested list of character classs?

This is the situation I'm in: I'm developing a game with C# using unity. In the game I have characters which is either locked or unlocked, and they're pretty much the same. For every character, they ...
0
votes
1answer
53 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
1answer
59 views

Generating a particle effect on top of a GUIElement (Unity)

I am working in Unity on a 2D project which is using C#. I have a number of guitextures which are hearts in order to create a sort of life meter. I would like when the player loses a heart for the ...
0
votes
1answer
129 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
136 views

Farseer: 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 ...
0
votes
1answer
114 views

Why is my Simplex Noise appearing in four columns?

I'm trying to make a Texture out of Simplex noise, but it keeps appearing like this regardless of how big or small scale is: The following code is used to produce the image's color date: private ...
0
votes
1answer
50 views

touch in guiTexture

Before time in my game start. i want there will show a guiTexture.. if i touch this guiTexture, that will hidden and the time game will start. I try to make a script but it doesn't work. I'm a bit ...
0
votes
1answer
154 views

Unity Gui from text file templates

I've been banging my head against a wall this past while over how I might create menu's and menu components in unity from text file. I would normally just build my own extended panel/label classes etc ...
0
votes
1answer
109 views

Make GuiText responsive

I'm using C# code to make a responsive GuiText. I was abel to make a responsive GuiTexture, but I'm struggling with doing the same for a GuiText. Code for the responsive GuiTexture using ...
0
votes
1answer
78 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
101 views

Converting a GameObject method call from UnityScript to C#

Here is the UnityScript implementation of the method i use to generate a randomly tiled background, the problem i'm having relates to how to translate the call to the newTile method in c#, so far i've ...
0
votes
1answer
121 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
121 views

Rectangle touch sides of another rectangle

I am making a platformer game and im trying to make the player collide with all the blocks, here's a picture: The blocks is stored in List and im trying to get the side's of the block usin static ...
0
votes
1answer
191 views

Make Gameobject Stand On Surface Facing Certain Direction

I want to make a biped character stand on any surface I click on. Surfaces have up vectors of any of positive or negative X,Y,Z. So imagine a cube with each face being a gameobject whose up vector ...
0
votes
1answer
711 views

How to make custom shaped holes in terrain

So I'm trying to create a game where you fit certain shaped objects into the hole that fits them (similar to the young children's game with different shaped blocks) in Unity 3D. I've encountered a ...
-1
votes
1answer
26 views

how would I go on about making a movement system like mario party

main question how would i go about getting a movement system similar to the one they have on mario party only minus the dice roll things i have researched so I have been studying the uses for ...
-1
votes
1answer
99 views

Projectile motion based off angle

I was using this code to hit an object that is moving horizontally(from right to left) and player on the left is throwing bullets to hit the object.But, what I am finding difficult is projectile ...
-1
votes
1answer
60 views

How do I check in which region of a map an object is located?

For example I have a character and two areas A and B, I want to test which area, A or B, my character is on.
-1
votes
1answer
125 views

Why are the coordinates interchanged in Monogame?

If I use XNA Gamestudio, I can draw a sprite on a specific position like this: spriteBatch.Draw(Texture2D, new Vector2(PositionX, PositionY), Color.White); But in Monogame, I must change the ...
-1
votes
1answer
121 views

Show message to one player issue in multi-player game

I Needed to show message to only one person of the multi player game,i am using smartfoxserver to developed a board based game and in this game how to differentiate 2 players in unity c#,and also how ...
-1
votes
1answer
721 views

Xna tile map collision

I finally found a tutorial on tile maps and loading them in from a file that I understand (http://circlessuck.blogspot.co.uk/2012/09/xna-tutorial-basic-tile-engine-part-2.html), however the tutorial ...
-1
votes
1answer
242 views

3d Wall sliding collision

I'm working on collision for walls in my game and the way I currently have it I get stuck walking into a wall. I'm trying to make my character slide on the walls but still collide. My character moves ...
-1
votes
1answer
170 views

Recommended aspect ratio for android / smartphones?

I'm making a game for android and would do it in 720p, but the phones got all different aspect ratios. Also thinking about a ios and windows phone port later. When the aspect ratio does not match, ...
-1
votes
1answer
74 views

Setting texture in effect pass

I created different types of cubes for my cube class and based on the height of the cube, the cube type is different. This means changing the texture for the cube. if (y >= 1) ...
-1
votes
1answer
123 views

SpriteBatch memory leak

I have a strange problem with XNA 4. I'm constructing a SpriteBatch using this.spriteBatch = new SpriteBatch( GraphicsDevice );. This leads to a memory leak up to 600 MB memory consumption. This ...
-1
votes
1answer
130 views

Why is my model flickering when translating

I have several models here. When they stand still during gameTime, there's no flickering. But as soon as I move them across the x-axis, they flicker on some places. protected override void ...
-1
votes
1answer
345 views

Server Based High Scores

I'm currently using the following MySQL example to make a server side high score table: Unity Server Side high score The above example allows me to create a top 5 player high score table that sorts ...
-2
votes
1answer
211 views

Programmatically creating a 3d mesh in XNA

Surprise! Another question related to Minecraft. Anyways: Rather than drawing thousands of blocks each frame, I remember reading somewhere that Minecraft breaks the map into 16x16x256 chunks, and ...
-3
votes
1answer
119 views

I need to make a create-a-class system like in COD

I need to make a create-a-class system like in COD but I don't know what code I need. I am also wondering if I have to make a photoshop image for every way it could look or do I type in the code to ...
-4
votes
1answer
205 views

How Do Game Timers Work?

I don't understand the whole game timer things, I know XNA comes with one but im realying on VSync to do the work rather then a game timer. I know what they are It's just can someone show me of a ...
-5
votes
1answer
531 views

How do I make the Cylinder in the model?

I have a class which will draw cylinders with deformer's index in the FBX file. The deformer which was in the 3ds max's biped. ex: If I have 22 bones in the deformer's structure, I will draw 22 ...
-1
votes
0answers
72 views

How to fasten the avatar's feet on the ground

I'm developing a Kinect Project using C# and XNA 4.0.Now facing a problem that I couldn't solve. When the player bends to near side , the avatar's feet are leaving the ground and it is moving like ...
-1
votes
0answers
28 views

how to make unity3D client handle network message more effectly?

Recently I am working on a Unity3D client program. It will recevie message from game server. I use TCPClient to receive the message aync and store it to a locked queue. As u know, the client must read ...