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
3answers
304 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
455 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
871 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
418 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
517 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
517 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
118 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
481 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
148 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
157 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
371 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
150 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
177 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
176 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
765 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
312 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
656 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
376 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
143 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
312 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 ...
2
votes
1answer
177 views

Implementing a wait function in a game script

I have been implementing behavior for enemies in my game and so far I have been doing it sort of like below: public void update() { if (frame > 60 && frame % 30 == 0) { ...
0
votes
1answer
100 views

XNA GameDefaults Class Settings

Are items such as the GameDifficulty enum, game settings, and other things in the GameDefaults class used for a lot? If so, is there a way to edit them or anything of the sorts?
0
votes
1answer
677 views

Udp protocol for game server/client

I've been trying to get a simple client server relation using udp for about a week now, And I think it's time for me to stop trying and ask for help... I understand how TCP works and UDP too. The ...
2
votes
1answer
65 views

How to rotate a cell of sprite sheet?

I can draw an animated sprite sheet without problems. But when it comes to rotation, the single cell (which gets drawn) rotates around the center of the whole sheet. How can I get my cell to rotate ...
3
votes
2answers
677 views

Get Unity to read in objects name without the need to hard code

I'm trying to get away from having to hard code in the names of objects I want my code to use. For example, I'm use to do it this way: TextAsset test = new TextAsset(); test = ...
1
vote
0answers
106 views

Non-smooth noise with optimal performance?

Any suggestions on how to get more 'jagged' results like linear interpolation gives with value noise using a faster algorithm concept like simplex noise? Simplex noise I haven't spent enough time ...
2
votes
1answer
122 views

What's a good way to distribute delayable tasks between frames to avoid lost frames?

I'm having a problem with finding a good way to keep the framerate high and at the same time keep running methods of game world update. I figured I could just put those methods in a thread so they are ...
0
votes
2answers
265 views

Trouble using Ray.Intersect method on bounding boxes in a 2D XNA game

I am trying to use a ray and bounding box to determine if a box is between the player and the mouse pointer in 2D space. When I try testing the code, the collision will return true when pointed at ...
5
votes
1answer
566 views

How can I render an .stl file in XNA or Monogame?

How should I go about rendering a .stl file as a 3d model in XNA? The .stl file contains a bunch of triangles that add up to a solid mesh. I have already figured out how to read the contained data. ...
9
votes
2answers
616 views

Algorithm for optimising a match game with known queue

I'm trying to write a solver in C# .NET for a game known as Flowerz. For your reference, you can play it on MSN, here: http://zone.msn.com/gameplayer/gameplayer.aspx?game=flowerz. I'm writing it for ...
6
votes
1answer
448 views

How can one implement a 3D Grid-based Line of Sight algorithm?

I'm creating a grid based Tactical RPG game in XNA. Image below kinda explains the idea. But if you've played Dwarf Fortress before, I'm basically trying to create that 3D line of sight and you can ...