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

1
vote
2answers
193 views

Set vertex position

Can anyone tell me how to set the positions of model vertices? I want to be able to change the position of some of the vertices of a Model. Is there any way to make that happen? And make the changed ...
4
votes
2answers
1k views

Blending textures together, texture fade over / fade in

What is the best way to render a texture overlapping effect? Like in this example: I want either the grass to fade in to the snow texture, or the other way around. No rough edges. Somehow make ...
2
votes
2answers
417 views

Unproject mouse position to tile — extremely jumpy position?

I'm trying to unproject the mouse position to get the position on the X-Z plane of a ray cast from the mouse. The camera is fully controllable by the user. Right now, the algorithm I'm using is... ...
1
vote
1answer
399 views

XNA shield effect with a Primative sphere problem

I'm having issue with a shield effect i'm trying to develop. I want to do a shield effect that surrounds part of a model like this: http://i.imgur.com/jPvrf.png I currently got this: ...
1
vote
1answer
837 views

Input Handling and Game loop

So, I intercept the WM_KEYDOWN and other messages. Thing is, my game can't/shouldn't react to these messages just yet, since my game might be currently drawing to the screen or in the middle of ...
7
votes
1answer
688 views

Spritebatch drawing sprite with jagged borders

Alright, I've been on the making of a sprite class and a sprite sheet manager, but have come across this problem. Pretty much, the project is acting like so; for example: Let's take this .png ...
3
votes
5answers
10k views

Parse/Write JSON with Unity iOS

anybody know a tutorial or maybe can help me to develop a parser/reader for JSON compatible with Unity iOS pro? I've already tried different third part libraries but without luck (i've tried json.net, ...
-5
votes
2answers
251 views

C# in vedio game industry? [closed]

Other than Indie game development, C# is also used for in house tool development at large studios. I have two questions -: 1) Is microsoft planning to release a native C# compiler sharing the ...
6
votes
3answers
667 views

Transforming a primitive tetrahedron into a primitive icosahedron?

I've created a tetrahedron by creating a BoundingBox and building the faces of the tetrahedron within the bounding box as follows (see image as well): VertexPositionNormalTexture[] vertices = new ...
47
votes
3answers
11k views

2D water with dynamic waves

New Super Mario Bros has really cool 2D water that I'd like to learn how to create. Here's a video showing it. When something hits the water, it creates a wave. There are also constant "background" ...
1
vote
2answers
188 views

Point[] and Tri not “could not be found”

Hi I'm trying to learn how to load a .obj file using OpenTK in windows Forms. I have seen a lot of examples out there, but I do see almost everyone uses List, and Point[]. Code example show these ...
1
vote
0answers
73 views

Farseer circle hangs where it's spawned

I'm currently trying to simply spawn a circle in Farseer. However, it's stuck wherever I spawn it! The game is updating fine, as I can see the circle spinning in place when I spawn it because of how I ...
0
votes
1answer
55 views

XNA- Texturing problem, exporting model

How,can I disable coloring when texture is applied, because right now the texture is being colored over. foreach (BasicEffect effect in mesh.Effects) { effect.TextureEnabled = textureApplied; ...
3
votes
2answers
202 views

XNA Sprite Clipping Incorrectly During Rotation

I'm having a bit of trouble getting my sprites in XNA to draw when near the edge of the screen. Seemingly if you use SpriteBatch to draw then XNA will not draw it if for example (mPosition.X + ...
2
votes
1answer
416 views

How do I modify a Boids algorithm to be player controlled?

Found source code on Boids in C#. http://3carrotsonastick.wordpress.com/2012/11/01/boids-in-c-xna/ How do I go about making the raven class in the above player controlled? If I could control it ...
0
votes
2answers
2k views

XNA Health Bar continually decreasing

As per the Health bar tutorial on ... http://www.xnadevelopment.com/tutorials/notsohealthy/NotSoHealthy.shtml I have set up the above, how do I make it decrease by 1 health per second? I want to ...
1
vote
2answers
87 views

XNA- Scale only parent

I was wondering, is it possible to Scale(Vector3) a ModelBone without scaling its children. Lets say I got a Bone A at position 1,0,3. And one of its children Bone B is at position 1,0,5 (he is ...
1
vote
2answers
2k views

Arrive steering behavior

I bought a book called Programming game AI by example and I am trying to implement the arrive steering behavior. The problem I am having is that my objects oscillate around the target position; after ...
0
votes
1answer
196 views

Storing large array of tiles, but allowing easy access to data

I've been thinking about this for a while. I have a 2D tile bases platformer in XNA with a large array of tile data, I've been running into memory problems with large maps. (I will add chunks soon!) ...
0
votes
2answers
773 views

map data structure in pacman

i am trying to make a pacman game in c# using GDI+, i have done some basic work and i have previously replicated games like copter-it and minesweeper. but i am confused about how do i implement the ...
-1
votes
1answer
577 views

Where would I find C# flocking tutorials? [closed]

Been looking for a while now and finding it difficult to find a good tutorial... Where would I find a good tutorial on how to implement flocking in a C# XNA game? Something easy to understand .. for ...
0
votes
1answer
330 views

XNA- Transforming children

So, I have a Model stored in MyModel, that is made from three meshes. If you loop thrue MyModel.Meshes the first two are children of the third one. And was just wondering, if anyone could tell me ...
1
vote
3answers
2k views

Opening an XML in Unity3D when the game is built

At the moment, my game can open up an XML file inside the editor when I run it. In my XMLReader.cs I'm loading in my file like so: _xmlDocument.Load(Application.dataPath + ...
3
votes
3answers
214 views

Scaling Sound Effects and Physics with Framerate

(I'm using XNA and C#) Currently, my game (a shooter) runs flawlessly with 60 FPS (which I developed around). However, if the framerate is changed, there are two major problems: Gunshot sound ...
1
vote
0answers
100 views

How do I add multi-player to a Windows mobile game? [closed]

I have an XNA game on WP7.5 and I like to add a multi-player mode, but I really don't know what to do. At first, I tried it with WCF, but that was really slow for the game. Are there any other ...
1
vote
1answer
648 views

XNA- Rotating around another model

Lets say I have a model with multiple meshes. Mesh A is at position PositionA = new Vector3(5,0,10). And mesh B is at position PositionB = new Vector3(7,0,9). How can I rotate mesh B around meshes A ...
2
votes
1answer
485 views

Ruby Vs. C# - Better for Game Programming [closed]

I have seen some games made in C#, such as using the XNA. I saw some games made in Ruby by using the RGSS1-3 API as well. I just can't decide on my own which would be easier to learn and apply for ...
1
vote
2answers
651 views

HLSL Pixel Shader that does palette swap

I have implemented a simple pixel shader which can replace a particular colour in a sprite with another colour. It looks something like this: sampler input : register(s0); float4 ...
1
vote
2answers
295 views

Events Driven Library XNA C#

Language: C# w/ XNA Framework Relevant and Hopefully Helpful Background Info: I am making a library using the XNA framework for games I make with XNA. The Library has a folder(Namespace) dedication ...
2
votes
2answers
702 views

2D Selective Gaussian Blur

I am attempting to use Gaussian blur on a 2D platform game, selectively blurring specific types of platforms with different amounts. I am currently just messing around with simple test code, trying to ...
2
votes
1answer
441 views

C# 2D Camera Max Zoom

I have a simple ship sprite moving around the screen along with a 2D Camera. I have zooming in and out working, however when I zoom out it goes past the world bounds and has the cornflower blue ...
4
votes
3answers
286 views

Efficient Algorithm for Recording gameplay's objects positions

So, I have a game idea in mind, and for that I need to record the game around the player. I'me not talking about recording it as video, but rather recording the scene objects, and their positions ...
1
vote
2answers
522 views

I enabled and setup glBlendFunc, but my texture has a white outline. What am I doing wrong?

You can see most of my source code in this question: Instead of the specified Texture, black circles on a green background are getting rendered. Why? Now I have the problem, that my texture has a ...
5
votes
1answer
3k views

How to make a iOS plugin for Unity3d

I've passed last 2 days reading articles and book for understand how can i make a plugin for iOS in Unity. Basically i need just a demo for understand how it work. For now i've tried to make this ...
3
votes
2answers
251 views

Instead of the specified Texture, black circles on a green background are getting rendered. Why?

I'm trying to render a Texture via OpenGL. But instead of the texture black circles on a green background are rendered. (They scale, depending what the rotation of the texture is) Example: The ...
2
votes
1answer
175 views

Why do I have to divide the origin of a quad by 4 instead of 2?

I'm currently transitioning from C#/XNA to C#/OpenTK but I'm getting stuck at the basics. So I have this Sprite-Class: public static bool EnableDebugDraw = true; public float X; public float Y; ...
5
votes
2answers
5k views

XNA C# Platformer - physics engine or tile based?

I would like to get some opinions on whether i should develop my game using a physics engine (farseer physics seems to be the best option) or follow the traditional tile-based method. Quick ...
1
vote
0answers
317 views

Matrix.CreateBillboard centre rotation problem

I'm having an issue with Matrix.CreateBillboard and a textured Quad where the center axis seems to be positioned incorrectly to the quad object which is rotating around a center point: Using: ...
1
vote
2answers
410 views

XNA 4.0, Combining model draw calls

I have the following problem: The levels in my game are made up of a Large Quantity of small Models and because of that I am experiencing frame rate problems. I already did some research and came to ...
3
votes
1answer
1k views

Should I use float, double, or decimal for stats, position, etc?

The problem with float and double is that they are not exact. If you are to do something like store replays, the values would have to be exact. The problems with decimal is that they are ...
1
vote
3answers
869 views

Making an AI walk on a NavigationMesh (2D/Top-Down game)

For some time I have been working on a framework which should make it possible to generate 2D levels based on a set of rules specified by level designers. You can read more about it here as I won't go ...
2
votes
2answers
161 views

How can I solve this SAT direct corner intersection edge case?

I have a working SAT implementation, but I am running into a problem where direct collisions at a corner do not work for tiled surfaces. That is, it clips on the surface when going in a certain ...
1
vote
1answer
188 views

this.BoundingBox.Intersects(Wall[0].BoundingBox) not working properly

I seem to be having this problem a lot, I'm still learning XNA / C# and well, trying to make a classic paddle and ball game. The problem I run into (and after debugging have no answer) is that ...
1
vote
1answer
285 views

What is going on in this SAT/vector projection code?

I'm looking at the example XNA SAT collision code presented here: http://www.xnadevelopment.com/tutorials/rotatedrectanglecollisions/rotatedrectanglecollisions.shtml See the following code: private ...
0
votes
1answer
386 views

XNA 4.0 - container with content, that can slide (C#)

I got an idea, but I got no idea on how to make it. Okay, so here is the deal. I want a container which can contain certain objects (These objects will draw the sprites/graphics). But because of ...
1
vote
1answer
248 views

XNA Shader Texture Memory

I was wondering about texture optimization in XNA 4.0. Will the the contentmanager send the texturedata to the GPU directly when the texture gets loaded or do I send the texture data to the GPU when ...
0
votes
2answers
156 views

How do I calculate opposite of a vector, add some slack

How can i calulate a valid range (RED) for my object's (BLACK) traveling direction (GREEN). The green is a Vector2 where x and y range is -1 to 1. What I'm trying to do here is to create rocket ...
-4
votes
2answers
156 views

can't spot the error. Trying to increment [closed]

I really can't spot the error, or the misspelling. This script should increase the variable currentTime with 1 every second, as long as i am holding the Space button down. This is Unity C#. using ...
-1
votes
1answer
299 views

Sending A Class Packet [closed]

How would I be able to send a class through the internet like this. class Player { public int Health; public Player Copy() { return this; } } And do this. SendPacket(new ...
4
votes
1answer
2k views

2D Tile Game - Smooth Biome Terrain Transitions

While working on my 2D tile based game, I encountered a problem. I use Perlin Noise to generate the terrain. Some biomes (Desert, Forest, etc) have different flatness values depending on terrain, ...