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
2answers
126 views

Jumping with a player Matrix

My players position is stored in a world matrix and I want to make him jump. Can I do this just by creating a translation from the matrix? I want the player to be able to jump while moving in a ...
1
vote
0answers
88 views

Farseer: Cutting body from texture

Is it possible to cut a body from a texture in Farseer 3.0? I have a texture converted to a body with multiple fixtures ( using BayazitDecomposer, CreatePolygon method, ..) and can even do it as a ...
0
votes
0answers
78 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) { ...
1
vote
1answer
836 views

Loading images in XNA 4.0; “Cannot Open File” Problems

Okay, I'm writing a game in C#/XNA 4.0 and am utterly stumped at my current juncture: Sprite animation. I understand how it works and have all the code in place, but my ContentLoader won't open my ...
-1
votes
1answer
163 views

Win32 strange exception

When creating 2500 objects, I get a strange windows exception. It says the operation copmleted successfully at my constructor line. The program doesn't run or anything. I'm assuming it has something ...
1
vote
1answer
165 views

Gap in parallaxing background loop

The bug here is that my background kind of offset a bit itself from where it should draw and so I have this line. I have some troubles understanding why I get this bug when I set a speed that is ...
2
votes
1answer
193 views

How can I determine if a cube is adjacent to another cube, and optimize its buffers if so?

I'm trying to optimize the rendering of a collection of cubes, (based on an answer I was given to another question I asked). I understand the logic behind occlusion culling, but I'm having trouble ...
2
votes
1answer
281 views

Frustum culling with third person camera

I have a third person camera that contains two matrices: view and projection, and two Vector3's: camPosition and camTarget. I've read up on frustum culling and it makes it seem easy enough for a first ...
5
votes
1answer
2k 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 ...
1
vote
1answer
139 views

How do I have an arrow follow different height parabolas depending on how long the player holds down a key?

i'm trying to throw an arrow in my game, but i'm having a hard time trying to realize how to make a good parabola. What I need: The more you hold "enter" stronger the arrow goes. The arrow angle will ...
4
votes
2answers
274 views

Game physics presentation by Richard Lord, some questions

I been implementing (in XNA) the examples in this physics presentation by Richard Lord where he discusses various integration techniques. Bearing in mind that I am a newcomer to game physics (and ...
4
votes
3answers
306 views

Matrix multiplication - Scene Graphs

I wrote a MatrixStack class in C# to use in a SceneGraph. So, to get the world matrix for an object I am suposed to use: WorldMatrix = ParentWorld * LocalTransform But, in fact, it only works as ...
4
votes
1answer
609 views

Material System

I'm designing Material/Shader System (target API DX10+ and may be OpenGL3+, now only DX10). I know, there was a lot of topics about this, but i can't find what i need. I don't want to do some kind of ...
2
votes
2answers
2k views

C# and Unity - Learning to Develop a game by developing the game I want to develop [closed]

So I am pretty new to C#, I have some python and javascript experience, but nothing substantial. I have read a lot about C# and Unity and I know they are the tools I want to use. My question is: ...
-1
votes
3answers
211 views

Optimizing drawing of cubes

After googling for hours I've come to a few conclusions, I need to either rewrite my whole cube class, or figure out how to use hardware instancing. I can draw up to 2500 cubes with little lag, but ...
0
votes
1answer
457 views

Grid Based Lighting in XNA/Monogame

I know that questions like this have been asked many times, but I have not found one exactly like this yes. I have implemented a top-down grid based world in Monogame, and am starting on the lighting ...
0
votes
2answers
61 views

creating bounding box list

I'm trying to create a list of bounding boxes for each cube drawn, so I can use the boxes to intersect with a ray that my mouse position is casting, but I have no idea how. I've created a list that ...
0
votes
1answer
246 views

How can I load 24-bit audio as SoundEffect?

When I try to load .wav file I get an error: Audio file *.wav contains 24-bit audio. Only 8-bit and 16-bit audio data is supported. Here is my code: SoundEffect menuSelectionChange = ...
1
vote
3answers
886 views

Creating Multiple Instances of a camera at run time

I'm trying to create a bunch of different game objects from a settings file I'm passing in at run time. I've checked and my game is reading in settings fine. But when I run the program, I get the ...
3
votes
2answers
342 views

How do I take a screenshot and blur it?

I want to take a screenshot of the game when it's running, blur it and draw it on the screen. Could you help me with taking a screenshot and blurring it?
0
votes
1answer
85 views

Move-Cycle generates unintended numbers

I have an image I want to move like it's hovering up and own in a cycle. For that image I have the Y float _sMY = 10; My cycle is this: if (!_hoveredDown) { _sMY -= 0.1f; } else { _sMY += ...
3
votes
1answer
180 views

Why would a Bounding Sphere and BoundingBox not intersect (when they should)?

I have a bounding sphere and a bounding box that should be intersecting, however, Intersects(...) is returning false. For example, the following returns false: new BoundingSphere(new Vector3(500, ...
-1
votes
1answer
420 views

Why is Farseer not working in Windows Phone 7/8?

I created a new Windows Phone Game (4.0) project in Visual Studio Express 2012 and added the Farseer project to the solution explorer. But adding a reference to the Farseer project is not working. I ...
5
votes
2answers
523 views

Something other than Vertex Welding with Texture Atlas?

What options (in C# with XNA) would there be for texture usage in a procedural generated 3D world made of cubes to increase performance? Yes, it's like Minecraft. I've been doing a texture atlas and ...
1
vote
1answer
520 views

Getting a 3d mouse position

I've looked at a few tutorials about picking and the method Unproject, so I have an idea of how getting the mouse in 3d space is done. The code I have does display a mouse position, but it is way off ...
3
votes
1answer
120 views

How to determine depth of a pixel perfect collision

I am trying to figure out how to determine the depth of a pixel perfect collision in XNA. I want to know the depth in order to be able to use it in my collision response. At the moment I have the ...
3
votes
1answer
483 views

Is There an Easy Way to Convert Python/Pygame code into C#?

I am working on a game, sort of like this and I want to convert it to C#, as it is currently written in Python. The reason of this is because I can add features more easily and with less writing in ...
1
vote
1answer
2k views

What is the status of Monogame now that XNA has been discontinued?

XNA has officially been discontinued, with support no longer being offered by Microsoft. Does this mean that Monogame has died also? I see that the site still says it is based upon XNA 4. What is the ...
-1
votes
1answer
149 views

Loop through arrays to create a map

I have a 2D array called map which holds the coordinates to my level like this: float[,] map = { {1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}, {1, 0, 1, 0, 1}, {0, 1, 0, 1, 0}, {1, 0, 1, ...
2
votes
1answer
114 views

How I support different display resolutions? [duplicate]

I'm developing a 2D windows phone game. The game should look the same on every windows phone device. But I have no idea what to do so that my game looks great on every display resolution. How can I do ...
0
votes
1answer
158 views

Formula throwing a ball to destination [duplicate]

I am throwing a ball using this: double v, vx, vy, alpha, t2 = 0; if (Keyboard.GetState().IsKeyDown(Keys.Up)) { alpha = MathHelper.ToRadians(60f); v = ...
-1
votes
1answer
163 views

Is this a efficient implementation of a pool?

This is how I realized a pool, to prevent stutters during gameplay. I load everything I will probably need during runtime upfront, and take each model I need from the pool during runtime. Now, my ...
1
vote
1answer
100 views

MonoGame WP custom vertex decleration

How do I go about implementing and using a custom vertex deceleration in monogame for windows phone 8. I want to be able to store a position, a colour and a normal?
-2
votes
1answer
100 views

System.Random giving duplicates in runtime [closed]

Normally, when I call this method of mine public static int Randomize(int min, int max) { Random r = new Random(); return r.Next(min, max); } I get a completely ...
1
vote
2answers
373 views

Third person camera xna

I'm trying to create a third person camera in my XNA game. I'm able to move the model I have and the camera at the same time, although the camera is not "following" the model. The model moves faster ...
0
votes
1answer
155 views

Problems when randomizing x and y position of a picturebox [closed]

So, I'm making a simple game. It's like snake but the picturebox doesn't grow. In the game, you have to get fruits and other objects. Look at berry's code: public class Berry : PictureBox { ...
2
votes
1answer
162 views

Shadowmapping theory question

I think im on good way to grasp the complete concept of simple hard-edged shadowmapping! The thing i find the hardest to grasp though is about the individual shadow-render for each light... Since the ...
1
vote
2answers
178 views

SpriteBatch does not draw on graphicDevice

I'm using a control which is using XNA inside. But when I try to draw something, it doesn't appear. I already did a lot of tests but can't figure out what's wrong. Here is the test I set up: ...
0
votes
1answer
177 views

Collision Resolution: Objects “swap” places

I am working on making my own simple collision resolution class so I can learn a bit about how it works, while also improving my entity-component model framework. For those of you unfamiliar with a ...
1
vote
2answers
775 views

XNA Using velocity

Previously when making games I have just been using a Vector2 as the sprites position and altering that for movement, i.e.: if(right key pressed) Position.X += movementspeed * gametime...; ...
2
votes
1answer
52 views

How to get max viewable X-Value in Viewport

How can I calculate or get the farthest X-Value of a Viewport during gameplay? Say a model is moving in from the right-hand side (beyond Viewport) and starting from a certain X-Value it is visible on ...
1
vote
1answer
317 views

Ignore specific key press in textbox

there is a text box on GUI in my application created using Unity3D. in the textbox user can input only the keys of "A-Z", "0-9" , "enter key" , "." and "," other key press should be ignored (not ...
1
vote
1answer
663 views

Change animation speed of a 3D model

I am working on a small simulator. There is a 3D character on the screen and it randomly plays an animation (I used animation.PlayQueued(...) command inside a for loop). Now I have added a slider ( ...
1
vote
1answer
4k views

Enter Key press event detect from textbox - Unity3D - C#

i am doing a project with Unity3D . in the interface there is a textbox. once user input some text and and press enter key then i want to read the text in text box. so please tell me how to ...
3
votes
1answer
151 views

How do you get the collision plane when using AABBs? [duplicate]

My collision detection initially seemed to work well enough, but my answer to this question shows that I have went with SAT testing now instead. My goal was to find the plane at which to slide the ...
-2
votes
2answers
270 views

Check for Updates [duplicate]

How would you make your game check for updates at the beginning of startup, and if there are any updates, how would you make them install? Thanks in advanced
1
vote
1answer
382 views

Strange rendering in XNA/Monogame

I am trying to render G-Code generated for a 3d-printer as the printed product by reading the file as line segments and the drawing cylinders with the diameter of the filament around the segment. I ...
2
votes
1answer
144 views

Farseer: Shooting a ball in a certain angle?

How can I shoot a ball in a certain angle? When I press the Space key, the ball should be shot in a 45 degree angle. How can I do that?
14
votes
2answers
1k views

Best way to gain C++ working experience for a job in games (coming from C#) [closed]

I am a software developer, experienced with C# (5 years experience) alongside a few other languages. My "dream job" is working in video games as a developer. Most jobs require knowledge of C++, ...
-1
votes
3answers
313 views

Looking for detailed pathfinding examples

I am currently working on a 2D-TopDown game. Now I was looking for pathfinding algorithms. I read and understood A* and Dijkstra. But there are still some questions I have. So I am looking for ...