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
0answers
9 views

How do you make a bullet ricochet off a vertical wall?

First things first. I am using C# with XNA. My game is top-down and the player can shoot bullets. I've managed to get the bullets to ricochet correctly off horizontal walls. Yet, despite using similar ...
0
votes
0answers
4 views

How can I use custom shaders in Monogame?

I wrote a shader in XNA and I want to use it in a Monogame Windows Phone 8 project. How can I convert the effect file(.fx file) to an .xnb file? I use Monogame 3.2 and Visual Studio Express 2013 for ...
5
votes
1answer
1k views

How can I export a .FBX file from Unity3D at runtime?

I want to export an object as a .fbx at runtime in Unity3D. I've made a C# script to export a mesh filter or skinned mesh renderer to a .obj file at runtime, but I want the animation and skin support ...
0
votes
3answers
391 views

Basic 2D Enemy AI

This is the basic layout of my game: http://www.youtube.com/watch?v=qcd-CcKWjGU&feature=youtu.be To make him move I just made it so you click left or right to move, just for a test. Anyway, I ...
0
votes
1answer
44 views

How to retrieve a cube collision by faces

I work for a while on a minecraft game (voxel). I am front a problem for a long time about the collision detection. I want recover the cubes collision from my highlighted black's cube like on the ...
9
votes
2answers
4k views

Scripting engine for XNA

Say I'm making this big game in C# with XNA. What options do I have to include a scripting feature to my code base?
1
vote
2answers
45 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
173 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
1answer
501 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 ...
0
votes
1answer
68 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
0answers
24 views

XNA - Link between Create Rotations matrices

A friend of mine have been coding some rotations on my XNA project, but the order of the matrices rotation are not good. Some are of form : Matrix.CreateRotationZ(1.21f) * ...
0
votes
1answer
669 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
0answers
27 views

XNA - Store and define level event

I am currently developing a game in C# using XNA/MonoGame and I face an issue to manage and store my level event. I store my level in XML (Enemies, Spawn location...) and I would like to store my ...
0
votes
1answer
96 views

Tile System with moving Platforms

I am using a tile based system where the level is stored in a char: char[,] Level2 = {{'.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.'}, ...
0
votes
2answers
51 views

how to call the specific animation?

I have a script to control the player simply moves Left, move right, etc.. but the animation when winning, losing, or Light, just put it on the animation and animator and no script for it. I wanted ...
-1
votes
0answers
60 views

Serious Memory leak using SlimDX Texture.FromMemory() [on hold]

I am new to stackoverflow and new to DirectX. I'm considering using the C# Wrapper slimdx. After a lot of researches, I found out how to load a texture and Draw on the screen. try { ...
2
votes
3answers
328 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 ...
0
votes
2answers
58 views

SharpDX.Toolkit setting constant buffer

I am trying to use a constant buffer in a program using SharpDX.Toolkit. I use the Toolkit because it has nice font support for writing on the screen. The problem I face is in assigning data to the ...
-1
votes
0answers
43 views

How to built game on windows form [on hold]

I want to build game on c#(windows.form) (Visual studio 2013), but I think that windows form does not support games graphics, some friends suggest me to do this task with the help of CANVAS. how can ...
1
vote
1answer
389 views

InvalidOperationException when using C# DLLs with Unity3D

Description I've been attempting to use a custom DLL in Unity. I've confirmed the DLL runs correctly outside Unity. The DLL imports into Unity and when I refer to it in my scripts, I get no compiler ...
6
votes
2answers
395 views

Detecting Light Intensity Around Characters

Later Edit Since there seemed to be a bit of confusion: I am asking this for purely didactic reasons, I'm not searching for the most efficient solution. Reformulated question: I'm working under ...
1
vote
0answers
22 views

Collision repositioning/resolution help

I've been having a trouble with moving objects out of the hitboxes they've just collided with. Here is my (relevant) code so far: Vector2 oposo = other.position; Vector2 poso = ...
0
votes
0answers
42 views

Why do I get different performance in different build modes of Visual Studio? [on hold]

I am currently diving into OpenGL 3 using SharpGL ( WPF Version ). There is something kinda interesting anomaly. When I run my game in "Release mode" I get 200 frames per second. However, when I am ...
0
votes
0answers
30 views

Could not load sound (MonoGame)

I am using the Window Project (in MonoGame 3.2) which is uisng DirectX instead OpenGL. If I run a game, so its show me: "Could not load wind asset as a non-content file" I think, that is no ...
-1
votes
0answers
26 views

Behavior for a line with different angels [on hold]

hi i need a cod for make a Behavior for a line with different angels . i mean for android if a user draw a Horizontal line on screen , device save the angle and put a Behavior for it if user draw a ...
-1
votes
0answers
38 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 ...
4
votes
1answer
368 views

Can't load vector font in Nuclex Framework

I've been trying to get this to work for the last 2 hours and I'm not getting what I'm doing wrong... I've added Nuclex.TrueTypeImporter to my references in my content and I've added Nuclex.Fonts ...
0
votes
1answer
65 views

How to create public Arrays of game objects so that they can be assigned through inspector

I am making a unity2D game. I need to declare public array of gameobjects so that I can assign them colliders, textures through inspector by drag n drop. Is there any way to do this? I am using c#. I ...
2
votes
1answer
121 views

How can I use XNA with Visual Studio Express 2013 for Windows?

http://dev.windowsphone.com/en-us/downloadsdk I downloaded the current version of Visual Studio to develop Windows Phone apps, but I don't know how to add XNA. I tried to install XNA, but it's not ...
0
votes
1answer
44 views

Variable Jump in Unity3d

I implemented variable jumping in unity for an endless running game. My question, how can I make the jump frame rate independent? My algorithm if ( keyDown ){ isJumping = true ySpeed += ...
0
votes
1answer
72 views

How do I prevent clicking at the end of each sound play in OpenAL?

I have put together a basic sound handler class for use in my game. It uses OpenAL. It's a simple method at the moment to play sounds - here's an extract from a switch block: case "EATEN_PILL": ...
-1
votes
0answers
41 views

How can I show a picture when the user presses a key? [closed]

I imported in my game project a picture for the map. I want the player to be able to see the map when they press a certain key during the game. How can I implement that?
0
votes
1answer
42 views

Why do I get an error about being unable to change rasterizer states in this code?

I'm trying to toggle between wireframe and full mode while drawing a 3d model. So far I have this rs = new RasterizerState(); In my update method: if (state.IsKeyDown(Keys.V)) { ...
1
vote
0answers
36 views

Using Behavior Trees and Events together

I am beginning to work with behavior trees and am unsure how events should be handled within the tree. Lets say we have a space game where the player is dogfighting with a handful of other ships, some ...
0
votes
0answers
55 views

Farseer: How can I break a body into multiple pieces?

I created a breakable body but the pieces are not flying around if the ball touches it. What is wrong? Why is the breakable body not breaking into pieces? I made a video and I enabled debugview, so ...
0
votes
2answers
152 views

Farseer: What can I do so that a body can move through a special kind of bodies?

I have three different kinds of rectangles. Black, white and blue rectangles. The rectangles are moving and can collide with each other. But with one exception, the blue rectangle can collide normally ...
7
votes
1answer
175 views

Finding the correct speed for AI to turn to reach goal

I have a ship that travels at max speed maxSpeed and can turn rotationSpeed degrees per second. The ship always moves in the direction it is facing which means that the faster the ship is travelling ...
1
vote
1answer
95 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
44 views

How to put basic scripting/variable changes into dialog xml files?

I have a simple XML structure for my dialog between the player and NPCs. What I'd like to do is put variable changes (and maybe other things) directly into the XML. So, for instance, if you select a ...
0
votes
0answers
36 views

class instance issue

Currently, i am working on a project which deals with several parts. First, I want to interface with a Sidewinder Force Feedback 2 joystick in Unity using SharpDX and SharpDX.DirectInput libraries. ...
0
votes
2answers
74 views

How can I make RPC function calls in Unity?

I am making a multiplayer game. I am sending score via the server and client but I want to be sure that can I call an RPC function of a script from any other script. For example, say Table_Manager as ...
6
votes
1answer
139 views

Optimize state changes within a render queue

I am refactoring some parts of the game engine I am working on. This engine is made in C# with XNA. The part I have trouble with is shader/material and the render queue. In the new version I will ...
1
vote
0answers
66 views

SpriteFont not found in Nuclex Framework

I am using MonoGame to port my XNA Windows Phone app to iPhone. All is well except that my fonts look distorted/smudged on the iPhone. Turns out this is due to the way that MonoGame builds the ...
2
votes
1answer
47 views

Adding an object viewer to a Unity Editor Window

I'm wondering if its possible to add an object viewer (For example when you import an .fbx file into unity you can see a small preview of it in the inspector) to a Unity Editor Window? I've looked ...
0
votes
0answers
13 views

SlimDX and Parsing .X Files

I'm trying to parse a .x file using SlimDX. I can create the XFile object and register templates but I'm having problems with the enumeration object. The enumeration object has a child count of 0 for ...
1
vote
1answer
135 views

XNA Monogame GameState Management not deserilaizing

I am having some trouble serializing/deserializing in a little game I am doing to teach myself monogame. Basically, I am using the gamestatemnanagement resources common to monogame (screen manager ...
0
votes
0answers
42 views

Script to intelligently move aircraft using curves [Unity]

I am trying to code a script to move an aircraft entity from point A to point B and at some point in the middle of moving have the aircraft forward vector face Point C (to fire a missile at an enemy ...
2
votes
1answer
107 views

C# - Separating Overlapping Rectangles

I'm trying to separate an arbitrary number of randomly sized rectangles, while still keeping them snapped to the grid, and somewhat packed together nicely. The goal is to start with something like ...
4
votes
4answers
495 views

How can I draw a shadow under my character?

I created a 2D tile-based jump and run game for Windows Phone and I want to draw a shadow under the character. How can I do that? The shadow must also be drawn on the tiles if the character jumps. The ...
4
votes
1answer
433 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 ...