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

4
votes
1answer
432 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
205 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 ...
3
votes
1answer
289 views

Set a 2d camera's position so that a building is under the players feet

My issue is this: i am making a scrolling game in XNA, and the camera updates based on the players velocity, but the player never actually moves, he is always in the center of the screen. When he hits ...
1
vote
1answer
36 views

How to use camera transformation without depending on (1,-1) scale during spriteBatch.draw()

I am creating a 2D platformer type game in XNA. I currently have a camera object, with a position/rotation/zoomlevel that I use to generate a transformation matrix to pass to SpriteBatch.Begin(). ...
1
vote
1answer
159 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 ...
0
votes
0answers
47 views

Matrix Translate Camera has some sort of spiky movement

public class Camera2D { private Vector2 _position; protected float _viewportHeight; protected float _viewportWidth; public Vector2 ScreenCenter; protected Being _unit; // the sprite camera is ...
0
votes
0answers
54 views

Implementing Exponential Shadow Mapping

I've been following the tutorials (link1) and (link2) to implement Shadow Mapping. However, I'm getting shadowing artifacts which are quite ugly. I've done some research, and found that ESM ...
0
votes
0answers
38 views

Calculating intersection of line segment with view frustum

I want to calculate the intersection of a line segment with the view frustum. Here's what I tried so far. The code works perfectly when the look direction vector is orthogonal to the line. E.g. ...
0
votes
0answers
33 views

How can I measure the weight in Farseer?

I have two different objects(star and rectangle) and I want to measure the entire weight that lies on the balance. How can I do that? Is it possible to know the entire weight that presses on the ...
0
votes
0answers
46 views

Drawing objects that visible on the screen

So I generated a terrain using list's of tiles, and I display it only if its visible on the user screen (if he move's to the right, the tiles that aren't visible wont be drawn, for performance ...
0
votes
0answers
156 views

Unity working on wall jump

I have a 2D platformer game and in it I have recently implemented wall jumping, and the way I have it works great. However when one jumps with the character and moves towards the wall one can hold ...
0
votes
0answers
63 views

Farseer Player Movement and Collision

I have added a video link for any one who whats to see what the problems are by watching the game. I am trying to create a player movement system and there are small problems that I am running into. ...
0
votes
0answers
59 views

Non-rectangular hitbox methods in XNA

I'm creating a 2D top-down RPG, and many of my buildings/scenery have non-rectangular corners to the textures. Does anyone know a good way to create circular/triangular/polygonal hitboxes, or is too ...
0
votes
0answers
71 views

Interactions between camera and procedural terrain

QUESTION REWORKED I need to update every frame camera position along a surface with hills and drops. In this picture you can see a particle of the surface terrain (just one triangle) and a sphere ...
0
votes
0answers
43 views

“Blinking” graphical bug when rotating shadow matrix

So, we have implemented Krypton shadows into our code for our 2D game, and it's working beautifully. Only issue is that we're running into a bizarre graphical bug when rotating the shadows with the ...
0
votes
0answers
69 views

Smooth circular collisions with edges/collision boxes [C# + XNA]

So, me and a friend are working on our top-down perspective 2D game, and have come to work on perfecting our collisions. In its current state our player sprite is colliding with walls, but is ...
0
votes
0answers
71 views

C# XNA game window's ClientBounds not equal to Viewport/BackBuffer at native resolution

I'm having a rather strange issue involving my game window and its resolution. I have a function in my Engine that sets the resolution (with the appropriate checks to make sure the resolution is ...
0
votes
0answers
133 views

NavMesh agents pushing other NavMesh Agents in Unity Pro

Using the NavMesh system in Unity, I created pathing system for my player character as well as the enemy AI. When a group of enemy NavMesh Agents surround my player character, they can be pushed out ...
0
votes
0answers
126 views

Server Character Movement calculation

I am creating the movement function for an 3D MMO game server. It seems that I cant no get the position calculation to match the client and was wondering the best way to do this. Let me explain. The ...
0
votes
0answers
92 views

Encapsulating variable elements into one drawable object - XNA/MVVM

Ok so I'm building a game and there is a class for an Object which gets the Values of a specific card from a XML Table and stores them in varibles. Note: I will have many "Card"'s instantiated at any ...
0
votes
0answers
43 views

Spritefonts gets very messed up when scaling up

I'm recoding a retro video game, but because the original resolution is very low, I scale everything up. I render to a renderTarget and render the renderTarget to the target resolution. I'm using my ...
0
votes
0answers
63 views

Bounding box not right rotation XNA blender object (.fbx)

I am importing .fbx models (a simple cuboid), the model itself displays fine (and is repeated to make a wall) however the bounding box seems to be on the wrong rotation. Below is a screen shoot: ...
0
votes
0answers
198 views

Use opentk window handle to host wpf control - Monogame

well my boss asked me to try and get wpf controls rendered in Monogame. From what I understand this was easly doable in Xna, however in monogame it fails. Is there any way to make the window hadle ...
0
votes
0answers
89 views

When should I set a texture as a shader resource in order to read it?

I'm writing a Direct3D 11 HLSL shader with SharpDX. What I want to do is write the depth to a texture in one pass and read it in the next one. After declaring the texture, do I have to set the depth ...
0
votes
0answers
78 views

Create random level platforms on screen

I'm trying to create random level platforms like this: public Level(int platfromsInLevel, Texture2D sprite, int screenWidth) { rnd = new Random(); this.screenWidth = screenWidth; ...
0
votes
0answers
76 views

Incorrect frustum culling with center/half-size AABB

I'm trying to implement an axis-aligned bounding box with center/half-size instead of min/max. And I have some problems when it comes to create a method to detect if the aabb is visible or not. I try ...
0
votes
0answers
77 views

Overlay partially transparent texture onto another, but not the background

I'm using XNA and C#. I have two shapes (texture2ds), and I want to overlay shape 2 (50% transparent square) over shape 1 (opaque circle), but I want to get Option B, not Option A. I basically want ...
0
votes
0answers
97 views

C# SDL.NET how to enable vsync

To start, I know that you cannot enable vsync in the application if it is disabled in the driver. My problem is, I cannot get it to work at all, even though it's NOT disabled in my driver. From what ...
0
votes
0answers
36 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 ...
0
votes
0answers
59 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 ...
0
votes
0answers
97 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
0answers
84 views

Projecting shadow map

I'm having a problem with shadow mapping and don't know where to go from here. Take a look at this screenshot: The cube circled in green is the light position, the light direction is pointed ...
0
votes
0answers
247 views

Unity3D Standalone player crashes on ALT+TAB

EDIT: After a bit of testing I've figured out that the problem is caused by Directx 11. When I build without that enabled everything is fine. So I've ran in to an odd error with my Unity standalone ...
0
votes
0answers
76 views

Generate complex (non-convex) polyhedron UV mapping

I need to find an approach to the problem of generating texture maps for non-convex polyhedrons without using a design tool like Maya. Specifically, I am mapping simulation results data onto a 3D ...
0
votes
0answers
126 views

Play streaming sound in OpenTK?

What's the simplest way to make a sound stream from disk and play in OpenTK?
0
votes
0answers
53 views

XNA inverted matrix acting strange

First of all, I am trying to calculate the two points of a triangle that have a given z position. I have figured out what I think to be quite a good method. First of all I move the triangle to be ...
0
votes
0answers
64 views

XNA 4.0 Smoothest thread option?

At start, I'm having my game play a background video, and have the MediaPlayer play music. void InitializeMainMenu() { MediaPlayer.Play(package_music.bgm_main_menu); ...
0
votes
0answers
266 views

XNA 4.0 - stretch full screen window?

I have an issue with resolution in XNA 4.0. I'm running fullscreen. The game runs standard at 1920x1080, and can be scaled down to 1280x720. The resolutions are both 16:9 (1920/1,5 = 1280, 1080/1,5 ...
0
votes
0answers
98 views

Body is pushed back from the wall sometimes

I have a strange issue with the collision between the wall and my player. If I press W and D or W and A to move up and right respectively up and left, the player sometimes gets pushed back from the ...
0
votes
0answers
73 views

Texture not drawing on cubes

I can draw the cubes fine but they are just solid black besides the occasional lighting that goes on. The basic effect is being set for each cube also. public void Draw(BasicEffect effect) { ...
0
votes
0answers
94 views

Drawing one texture with different Color fps issue

I'm trying to change texture color by aplying mask, which is exactly the same texture but with changed color and alpha < 150. I'm doing smth like this: spriteBatch.Begin(); spriteBatch.Draw(pic, ...
0
votes
0answers
145 views

Farseer: Difficulties with implementation of DebugView

I added the project "Farseer Physics Engine 3.3.1 HelloWorld XNA\DebugView XNA\DebugView XNA.csproj" to my solution explorer in Visual Studio. In addition, I added a reference to my project and the ...
0
votes
0answers
107 views

How to integrate Javascript into C# and run scriptcode step by step

We are currently working on a Pokemon MMO trying to figure out how to implement an asynchronous scripting language the best. We don't want to work with threads or tasks, but the goal was to wait for ...
0
votes
0answers
180 views

Most effective way to build a lobby application for a game?

I'm trying to steer clear from "which technology should I use" and more of "what aspects of tool s should I look for to make this easy". What is the rest of the industry doing? Web stacks? I'm trying ...
0
votes
0answers
87 views

How can I draw an Xbox Avatar?

I want to replace the main character of my 2D game by an Xbox avatar. How can I do that? How can I add an avatar to my project? How can I draw an avatar? For example, I draw my main character like ...
0
votes
0answers
113 views

How can I efficiently store Vertex data in C#/XNA?

I am creating a terrain system using voxels in a somewhat minecraft-like style and I was wondering if there was anything I could do to increase the number of vertices I am able to store (and therefore ...
0
votes
0answers
88 views

Sceneview Lags when using Arrays

I'm getting a strange behavior here - when i create a simple C# script which holds an Array of classes, where both, the script class and the array classes, are marked as Serializable, my sceneview ...
0
votes
0answers
117 views

Draw mesh with multiple bones

So I currently have an object made up of only one mesh. And this object contains three bones. One for strecthing the mesh left, one for streching the mesh up, and a center bone, which moves the object ...
0
votes
0answers
158 views

XNA C# Phun-Style Window Movement Effects

Ok, so I'm making a game in XNA similar to Uplink (computer hacking) and I have a lot of ingame panels that display information, such as mission details, emails, passwords, and so on. To add to the ...
-1
votes
0answers
32 views

2d top down tank movement

I am trying out an idea of a tank like movement in a top down 2d game. I'd like to: get the float values of both left and right triggers I have from an xbox controller (float values from 0 to 1). I ...