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

What's involved in resetting the graphics device?

I'm playing with XNA 4.0, VS2010. I've created a window (not maximized) and drawn some sprites. All is good until I resize the window, after which the sprites stop displaying or only partially ...
1
vote
1answer
139 views

Rectangle collision is not working correctly [closed]

I have difficulties with the rectangle collision. My character can go through the right side and through the bottom of each platform rectangle. I guess their is a mathematical problem with the ...
0
votes
1answer
253 views

How to prevent the player from clicking too fast [closed]

I'm having trouble with some bullets in my game, the M1911, which is supposed to be semi-auto is only capable of shooting one projectile per mouse click (trying to learn how to do multiple ones at ...
-1
votes
2answers
141 views

Trying to reduce health by a certain value once XNA [closed]

I've got a bullet and collision data for the bullet, when the bullet collides, it's supposed to cut an integer off of the max health for the object. Basically heres what I want: Object is shot, ...
2
votes
1answer
355 views

Unity3D custom camera matrix breaking shadows/lights in deferred rendering

EDIT 1: So it seems this is a common issue with Unity, and it comes from a bug in which custom camera matrices break deferred lighting and shadows. This topic right here talks about it a bit, but the ...
-1
votes
1answer
136 views

Why is my model flickering when translating

I have several models here. When they stand still during gameTime, there's no flickering. But as soon as I move them across the x-axis, they flicker on some places. protected override void ...
2
votes
1answer
1k views

Unity3D How too write to the back buffer AFTER the final pass of deferred rendering

I've been using this script and shader from the wiki, and they work wonders; my only problem is using them in deferred rendering. Now, the way this shader works is by writing to the depth buffer to ...
3
votes
2answers
866 views

Playing different particle effects in Unity on the same ParticleSystem

The question really sums it up: What is the best way to use one particle system for playing different particle effects? The scenario: GameObject is picked up and it starts playing a simple indicator ...
2
votes
1answer
143 views

How can I draw an Xbox Live avatar?

I want to replace the main character of my 2D game by an Xbox avatar. How can I do that? How can I add an avatar to my project? How can I draw an avatar? For example, I draw my main character like ...
-1
votes
1answer
109 views

Program closes without Exception

I'm using XNA 3.1 ( .NET 3.5 ) and my program closes without any warning, errors, or code instructing it to do so. I looked in the output, and there aren't any obscure messages outside of telling me ...
0
votes
1answer
67 views

Managing Background Sprites

I tried asking in Chat and no one answered, so the question goes here. Anyone have advice for loading background Sprite maps? I'm trying to do it as efficiently as possible for a grid of 25 ...
1
vote
0answers
212 views

DRY 0-bandwidth-overhead-serialization in C#: virtual, delegates or reflection? [closed]

I'm (de)serializing some datastructures for a network-multiplayer game, and for each datastructure that's to be (de)serialized, I want to define the order of (de)serialization only once for ...
1
vote
1answer
534 views

Can not enable IME to capture Chinese characters in SharpDX

Just found that direct integration of IME is blocked in Windows 8, moving on to TSF now. By now, there is lack of Microsoft's Document about TSF, this will be hard. I am using SharpDX and the ...
1
vote
3answers
391 views

Splitting tileset into individual tiles

I'm trying to split a tileset (from here) into individual tiles. For debugging purposes I wrote some code to split the tileset into individual tiles and display them on screen, but some aren't being ...
5
votes
1answer
745 views

Smoothing Heightmap Data

I've made a Heightmap Generator that creates island heightmaps like in this picture: I am dividing the grayscale ( 0 - 255 ) into 4 diferent parts ( water, sand, gras and forrest ) and after ...
18
votes
4answers
2k views

A Simple Method To Create Island Map Mask

I'm searching for a nice and easy way to generate a mask for an island map with C#. Basically I'm using with a random heightmap generated with perlin noise, where the terrain is NOT surrounded by ...
0
votes
1answer
126 views

Why does my object “jump” immediately as the game starts?

I'm having a problem where, when I start my game, my game object (a 3D plane) immediately jumps 300 pixels or so. I suspect this has something to do with my joystick handling code that I've written to ...
3
votes
1answer
1k views

How do I implement movement in a WPF Adventure game?

I'm working on making a short WPF adventure game. The only major hurdle I have right now is how to animate objects on the screen correctly. I've experimented with DoubleAnimation and ...
2
votes
1answer
166 views

Getting a uint color array from a portion of a Texture2D

I'm currently using the Farseer tools to create a body from a Texture2D. However, my texture is a spritesheet and I need to get the uint array containing the colors from a portion of the full ...
3
votes
1answer
604 views

Reading text files XNA 4.0 on Xbox 360

I'm working on porting a game from PC to Xbox 360. When I want to create a level I read a .txt file that I store in my content I read the whole file as a string using this method ...
3
votes
0answers
256 views

Legality, implementation, and viability of using the BSP map format in a procedurally generated XNA game? [closed]

First off, this is not a "which technology should I use" type of question, but rather a question about the viability (And legality, and how to implement) BSP maps into an XNA game. The legality part ...
1
vote
1answer
171 views

Recommended collision response needed [closed]

In my game, I have Player class Enemy class Wall class GameComponents class ( Which is the base class for Player, Enemy and Wall) The rules are Enemy chase Player, if collided with Walls, ...
2
votes
1answer
122 views

Support for different resolutions in a tabletop environment

Right now I am experimenting with XAML and C# to write a small Windows Store App which supports displaying a playmat with cards. However not everyone uses the same resolution and with a somehow fixed ...
3
votes
1answer
249 views

Stitching meshes together

I have a voxel engine that generates a mesh per chunk and now I want my meshes to be 1 mesh, but if I create them as a single mesh I kind of lose the benefit of chunking the data in the first place. ...
5
votes
1answer
1k views

Producing a smooth mesh from density cloud and marching cubes

Based on my results from this question I decided to build myself a 3D noise map containing float values in place of my existing boolean point values. The effect I'm trying to produce is something like ...
-7
votes
2answers
59 views

How do i create a Xna 4.0 Creating BoundyBox [closed]

I understand what other people have done and when creating it myself it just seems to go wrong or the version is different so doesn't work in first place. Any easy code for this?
-1
votes
1answer
90 views

XACT support outside of XNA?

I was building a new game in Monogame when I realized that it didn't have XACT support like XNA did. I was wondering if anyone knew another framework that could be used with or instead of MonoGame ...
2
votes
2answers
358 views

Raytracer texture mapping (to triangle mesh) leaving artifacts

So I am trying to get OBJ loading working in my raytracer. Loading OBJs works fine, but I am having some trouble with getting the texture mapping working. Here is an image of my result. It is ...
-1
votes
1answer
355 views

Server Based High Scores

I'm currently using the following MySQL example to make a server side high score table: Unity Server Side high score The above example allows me to create a top 5 player high score table that sorts ...
1
vote
1answer
236 views

graphics.GraphicsDevice.Clear strange result (XNA)

I have such Execution: graphics.GraphicsDevice.Clear(new Color(255, 0, 0, 0)); Alpha is 0. So why it draws me Red color? graphics.GraphicsDevice.Clear(new Color(255, 0, 0, 255)); Also draws the ...
1
vote
2answers
868 views

Level editors compatible with MonoGame? [closed]

I'm thinking about a future project using MonoGame and it seems there are no level editors that outright support it, though obviously there are those for XNA that may possibly be compatible. So I ...
1
vote
2answers
775 views

Resolving 2D Collision with Rectangles

For about a week I've been trying to grasp the basics of collision, but I've been driven to the point of wanting to just give up on everything when it comes to collision. I just don't understand it. ...
0
votes
0answers
132 views

How can I efficiently store Vertex data in C#/XNA?

I am creating a terrain system using voxels in a somewhat minecraft-like style and I was wondering if there was anything I could do to increase the number of vertices I am able to store (and therefore ...
3
votes
2answers
3k views

Understanding marching cubes and voxel data relationships

in case it matters i'm doing all this in unity with C# ... I think I missed something or maybe don't understand the logic correctly. I have an existing voxel engine that looks very "minecrafty" at ...
1
vote
3answers
211 views

Creating an update “Tick” on tiles for simulating growth of plants

In my 2D tile based platformer I have added plants to be able to farm such as the simplest, grass, to other things like corn. Now each of these speacial tiles must be updated to show how much it has ...
-5
votes
1answer
154 views

camera2d class will not work [closed]

using System; using System.IO; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using ...
13
votes
2answers
3k views

How to blend two cameras when traveling through a portal in Unity3D

Before I get to my question, I know the most obvious solution would be to use the normalized view port rect, however I need more complex shapes than a rectangle, and I've looked in to using the view ...
-2
votes
3answers
693 views

Can I use a list to spawn enemies? [closed]

I need to have about 10 enemies in my game, can I use a list to spawn them all in? This is what I was working on but it only spawns 1 enemy in the coordinates of the last added to the list. Here are ...
1
vote
1answer
342 views

Pixel Shader - apply a mask (XNA)

I'd like to apply a simple few masks to few images. The first mask I'd like to implement is mask like: XXXOOO I mean, that on the right everything is masked (to black), and on the left everything ...
3
votes
1answer
860 views

How to optimise mesh data

So i have some procedurally generated mesh data and i want to reduce it down to its minimum number of verts. In case it matters this is a unity project. Working on the basis of a simple example, ...
0
votes
1answer
56 views

What is the point of the XNA.Input.Button enum?

I am trying to make an InputManager class that will let me basically bridge XNA's various input methods and do a corresponding action in my game. Part of this is designing different keybindings. ...
1
vote
1answer
361 views

Defining a random irregular shape in a bool array

I need to find out how to populate an array bool[x,y] with a random filled shape. lets say I want a triangle depicted in my array i would define an area within the array and set all points to "true" ...
1
vote
1answer
283 views

Player positions in a race game through arrays or…?

First time posting on these forums so go easy on me! I've been programming a race game which has been going quite well. I've just discovered now how hard it is to set up player positions!(As in 1st, ...
2
votes
0answers
202 views

Implementing Branching Conversation Dialogue in C# with XNA [duplicate]

How could I add logical branching conversation dialogue in C# with XNA? What I mean by this is a dialogue tree similar to this: If the user is wearing red: DisplayText "You're wearing a red ...
-1
votes
1answer
186 views

Creating physics in xna

I am creating a racing game using visual studio 2010 and xna 4.0. I'm trying to create some simple physics so my car sticks to the heightmap I have created within my game world and the model adjusts ...
5
votes
1answer
374 views

Why does this Unity code work as expected only with the while loop?

In unity, in C#, I have the following code in Awake(): Awake() { Transform obj = InstantiateTarget(); //the bizarrely required and "working" loop while (transform.childCount > 0) { ...
0
votes
1answer
203 views

Lerp an object based on timers

I'm trying to make a target lerp between two objects based on a timer. At the moment, I have the following code: float distCovered = (Time.time - waitTime) * speed; float fracJourney = ...
4
votes
2answers
294 views

Changing game controls using .txt file

I'm using XNA to create a simple block breaker game. At the moment I have controls set in the standard way: if (keystate.IsKeyDown(Keys.s)) I've figured out the file handling problems involved and ...
1
vote
3answers
2k views

How can I convert screen coordinatess to world coordinates in OpenTK?

I'm making a windows forms application with opengl view. I need to get the mouse coords converted to the opengl world coords. Well, my Y coord gets converted wrong. It's hard to explain, so here is ...
5
votes
2answers
409 views

Set a 2d camera's position so that a building is under the players feet

My issue is this: i am making a scrolling game in XNA, and the camera updates based on the players velocity, but the player never actually moves, he is always in the center of the screen. When he hits ...