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

Entity systems, creating new entities?

How do I create new entities (the collection of their components) in an entity system? I have space ships in my game, for example, they need a lot of information set in their components when I create ...
0
votes
0answers
216 views

Play streaming sound in OpenTK?

What's the simplest way to make a sound stream from disk and play in OpenTK?
2
votes
1answer
356 views

Unity3d reading profiler binary information

So I'm using Unity's profiler to help debug some of my code in the standalone. I've got it running smoothly, and writing all it's data to a .data file which I can read. However, the binary file Unity ...
11
votes
1answer
1k views

How to implement a shotgun in a game?

Pistols and machine guns are easy - you can just have bullets flying in a certain direction, so I already implemented that. A shotgun, on the other hand, does damage to anything in a certain area that ...
1
vote
1answer
161 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
0answers
22 views

Invalidate not working (winforms & xna) [duplicate]

I'm using winforms with xna. Everything's working so far except for the drawing because invalidate won't refresh the screen unless repeated. This is the initial code I had: protected ...
1
vote
2answers
135 views

XNA Calculate two points of triangle with given Z

I want to calculate the two points of a 3D triangle that have a specified Z coordinate. I guess the way to do this would be to somehow create a plane which is perfectly flat with my given Z coordinate ...
0
votes
0answers
62 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
2answers
291 views

Udp VS Tcp connection for a platformer multiplayer

Tcp is connection based so it's really good for chat or login or anything that needs reliability. Udp should be used for lots of small packets like position packets... The problem is that in a game ...
-1
votes
1answer
779 views

Matchmaking system in Unity

I was wondering, how would one go about making a matchmaking system in Unity? I've tried some ideas with the Master Server, but it wasn't doing its job right, since thats a lobby based solution. I ...
2
votes
1answer
185 views

Calculate Distance Using Lifetime, Speed, and Time Between Ticks

I am trying to draw a line from the player to where he is facing, with the line being the distance his rockets will travel. I have ShipMissile.Speed, which is the number of pixels to move per tick, ...
0
votes
1answer
172 views

XNA - how to prevent a sound from looping

So in XNA I have this code: Variables: SoundEffect optionSelected; In the LoadContent() method: optionSelected = Content.Load<SoundEffect>("gameSounds\\selectOption"); In the Update() ...
0
votes
0answers
70 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); ...
1
vote
2answers
172 views

Custom timeout for xna wp7 Webclient [closed]

Since there is no timeout for responce in windows phone xna version of WebClient i need to implement one. The idea is to make MyWebClient derived class from WebClient with timer. But i got stuck on ...
3
votes
1answer
330 views

Rotations and angular velocity

I'm new to 3D-game programming and I'm having some trouble making objects rotate the way I want them to. I just read Glenn Fiedler's tutorials on game physics, awesome stuff by the way! ...
5
votes
3answers
803 views

Why is this code producing jittery movement?

I have a new project, all settings default with a simple cube on a plane. Cube is not kinematic but is a rigid body under the effects of gravity. I'm trying to normalize the direction before I ...
0
votes
1answer
304 views

XNA Arcball and moving model - the model is altered instead of the camera

I'm trying to implement an arcball type camera, I've got all controls working very nicely. I can rotate the X/Y axis with my mouse and zoom in and out with the Z/X keys. The problem is, that the ...
0
votes
0answers
625 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
1answer
132 views

how to set up a contract between a Client and Server in C#

I am trying to make a turn based game, so first should I use UDP or TCP for the client server set up and why? Second how do I implement it? I have seen a lot of code that just sends byte strings to ...
2
votes
2answers
323 views

Player jitter when positioned at large coordinate values

I am trying to make a simple top down scrolling shooter using Unity3D comprising of the following elements: 1) Top down orthographic camera: points at 65 degrees towards the ground. At a height of ...
11
votes
4answers
1k views

Monogame minimum hardware requirements?

What are the minimum hardware / driver requirements for running a Monogame 3.x game, on each of the various Operating Systems?
-1
votes
2answers
130 views

Velocity deacceleration working incorrectly

Basicly, I've tried to code velocity into my game, which works sort of. The deaccelaration works sort of, but not correctly. The problem is, that the positive values, decreases just fine and dandy to ...
0
votes
0answers
104 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
2answers
287 views

What type of server should I use?

I am planning on making a game in c#. It will be a turn based, space exploration game. I want the turns of the different players to be able to happen at the same time though. I have been researching ...
0
votes
1answer
195 views

Implementing a 2d Selection Box

I'm in the process of implementing a selection box for my simulation and am having difficulty with something which appears simple. At the moment, I can draw the selection box and accurately select the ...
1
vote
1answer
647 views

XNA soundEffectInstance set to loop, does not loop

Using the code below I can play background music, this works. Eventhough I've set 'IsLooped' to 'true', the sound won't loop. What Am I doing wrong? protected override void LoadContent() { ...
0
votes
2answers
991 views

SharpDx how to detect if Mouse Button is pressed?

I'm wondering how it's possible to detect if a mousebutton is pressed or released. var di = new DirectInput(); _mouse = new Mouse(di); _mouse.Acquire(); _mouseState = _mouse.GetCurrentState() All I ...
2
votes
2answers
376 views

Unlimited inventory system?

I am working on a small game, I need to add an unlimited inventory to the game but I am not sure how to do it. I have an inventory system with a specific amount of slots, here it is: <?xml ...
2
votes
1answer
176 views

xna model scaling - model is bigger than world

I'm having trouble scaling my model in XNA with C#. The model is bigger than the world itself and I can't seem to scale it down. Below is the code I'm using and an attached screenshot. How can I scale ...
7
votes
3answers
735 views

Reusable top-down collision class

I've recently picked up monogame and am working on a simple top down game to get me started and learn the basics. I've got the movement and the rotation to follow the mouse sorted out but I'm stuck ...
2
votes
1answer
124 views

SlimDX: Error while loading Effect

Im trying to load a effect in SlimDX, but I get a error when I try to get the ShaderSignature. The error-code: E_FAIL: An undetermined error occurred (-2147467259) This is my code: ...
0
votes
1answer
2k views

Rotate a 3D object in Unity3D on button click

There is a 3D character in my application developed using Unity3D. Now I want to rotate this 3D character when the user press the rotation button. I tried several ways, but didn't work. How can I ...
0
votes
1answer
186 views

Xna menu navigation with controller

I have a menu that you can navigate with the keyboard, but I also want it so you can navigate it with the controller thumb sticks. But my problem is that if you push down or up on the thumb sticks it ...
0
votes
1answer
278 views

render sprites with a transparent background (XNA)

For my game I want to make a map of the world. Per country I made a file with the border of the country and the rest of background is transparent. This way all my files have the same width and height. ...
2
votes
1answer
118 views

How to open prerequisite retrieval application

I have an application that cannot use OneClick publishing. I still want to access those nice prerequisite (applications?) that install .NET and XNA for you when you create a OneClick publisher. I ...
0
votes
1answer
114 views

Rectangle collision doesn't work on WP 8

Collision detection is not working correctly when my 64x64 pixel block touches a bigger block. The big(rect2big) block measures 128x128 pixel. The falling block should change it's color to black when ...
0
votes
1answer
70 views

Items failing to cast as Image Items in GLEED2D

When I try to cast an Item as an ImageItem in fails to convert and returns null, hence skipping the code I want to use to extract the texture data. I have already down cast my Item to an ImageItem, ...
0
votes
1answer
12k views

Rotate an object smoothly on the Y axis in Unity

I am attempting a simple script to swing a door open in Unity. This requires a smooth rotation of 90 degrees around the Y axis. I have seen that one way to do this is using Unity's Quanternion ...
0
votes
1answer
198 views

How can I make a clickable menu in WP 7/8?

I'm trying to make a clickable menu for my XNA Windows Phone game. If the player makes a tap gesture on a button(rectangle), something will happen. For example, the game will start if you touch the ...
0
votes
1answer
178 views

Texture2D can't find my sprite - how to setup the content directory in XNA

So I keep getting told that spr_lives can't be found. I'm working out of a book and using the samples given to me (have not changed the code or folder structure, so it /should/ work) but nothing's ...
-1
votes
2answers
460 views

Move a player in the opposite direction they are looking

I'm looking to move the player in the opposite direction they are facing with a specified force. Rather than try to explain that better I created an image showing what I mean, I've tried reversing ...
1
vote
1answer
223 views

How could I figure out the shortest way to turn, and whats the angle? [duplicate]

I'm creating some robots for my tank game. I want them to find each other and shoot each other down, so I'm trying to implement a way for them to turn towards each other, and turn the shortest way. ...
-1
votes
1answer
942 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
vote
2answers
325 views

How to tile multiple procedurally generated textures?

I'm trying to develop a procedural tile generator for a game, mostly for the ground tiles, instead of using "hand-drawn" tiles. To achieve this I'm using Perlin noise and a sine wave with multiple ...
1
vote
2answers
335 views

Rotate around the centre of the screen

I want my camera to rotate around the centre of screen and I'm not sure how to achieve that. I have a rotation in the camera but I'm not sure what its rotating around. (I think it might be rotating ...
0
votes
1answer
915 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
389 views

XNA & HLSL - rendering a model with its original materials (colors)

I am currently trying to code my own HLSL effect file, in order to render an FBX model I made with Autodesk maya, and to which I have applied some materials (colors). before trying to write an effect ...
1
vote
2answers
155 views

Rotating sprite 180 deg

I should say first, that I have the rotation down. Its just that I want my square to rotate exactly 180 degrees. Currently, it will rotate but it will rotate but by less each jump. So after several ...
1
vote
1answer
545 views

Using multiple passes in OpenCL .net

I'm new to opencl but I have some experience using HLSL. In HLSL multiple passes are used when you need to finish a computation before moving on to the next step. I would like to know how this sort ...