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
votes
2answers
167 views

Tile collision, can't get correct behaviour [closed]

I define a tile with a rectangle. This is displayed below. public class Tile : Sprite { Rectangle rectangle; public Rectangle GetRectangle { get { return ...
-3
votes
1answer
173 views

How long would it take to learn c# if I know c++? [closed]

I already know c++, having worked through Accelerated C++ reading all the chapters and doing all the problems, with a bit of college coursework in C++ as well. From what I read, I seem to have ...
3
votes
1answer
571 views

Storing items in external data files

My project, in its current state, keeps all of the info for each inventory item in script files. That means, inventory items and their properties are part of the codebase. This works well, but I'm ...
2
votes
1answer
454 views

XNA Textures with background color

I am fairly new to XNA and I have questions in regards to textures. Most of my of textures have a background color along with the overall image (white, black, or whatever). This is quite ugly as the ...
0
votes
2answers
171 views

How do I achieve one touch one shot for WP7 game?

I want to be able to have a sprite shoot in a game for WP7. What I have at the moment is that as long as the shoot button is held down the sprite constantly shoots. How do I sort it that only one ...
2
votes
1answer
189 views

How to implement in-game purchase?

I am currently developing an indie game using XNA/C#. I would like to give players the opportunity to try a free (but somewhat limited) demo version of the game. Nevertheless, the player should be ...
1
vote
4answers
603 views

What is a good way to load more than a million images for a collectible card game?

I'm using C# with MonoGame and I'm wondering what would be an efficient way to load more than a million card images for a collectible card game. More cards would be continuously added in future ...
3
votes
1answer
439 views

Dynamically save an assetbundle during run time

I'm wondering if it is possible to dynamically save / amend a current asset bundle during the running of my Unity application. I've been looking into this for a few hours, but can't find anything ...
0
votes
1answer
139 views

Tile Draw Order

I started working on a tile engine recently and have been trying to get this depth sorting for the tiles right. I am using XNA and the SpriteSortMode.Deferred to get the tiles to sort correctly in the ...
6
votes
2answers
466 views

Detecting Light Intensity Around Characters

Later Edit Since there seemed to be a bit of confusion: I am asking this for purely didactic reasons, I'm not searching for the most efficient solution. Reformulated question: I'm working under ...
1
vote
3answers
237 views

Objects being drawn on wrong layers

I have the main game (Game1.cs) draw the sprites like so: //Clear everything GraphicsDevice.Clear(Color.CornflowerBlue); //Begin drawing ...
0
votes
2answers
866 views

How to make a smooth movement in XNA?

I'm trying to make a nice controls for my game, but I can't achieve enough SMOOTHNESS. if (kbState.GetPressedKeys().Length != 0 && _direction != Vector2.Zero) { ...
1
vote
0answers
186 views

3D Animations in XNA 3.1

Well, guys. I'm in a Game Design class at school. Before you ask "WHY ARE YOU USING 3.1 INSTEAD OF 4" -- I would like to point out that C# 2008, and .NET framework 3 is NOT my preferred environment, ...
1
vote
2answers
218 views

2D tilemap editor UI--how do I disable editing while save/load dialog is open?

I'm working on a basic 2D tilemap editor in C#/XNA. Currently, it displays the map through a picturebox through which XNA's output is being routed, and editing is accomplished through simply checking ...
2
votes
3answers
492 views

Minecraft like blocky-clouds

We are working on a minecraft-like block-based engine/lib. Lately I've started working a blocky-clouds as in minecraft; So it appers that in minecraft, clouds are not procedural. I'm still looking ...
2
votes
3answers
256 views

Complex Scaling

I've been trying to figure this thing out for weeks now, but with no luck.So, I am creating this program in WindowsForms and Xna, that allows users to create a 3D room. By draging and customizing ...
0
votes
1answer
151 views

Vector2's static methods and the garbage collector

I discovered that Vector2's static methods return a different Vector2 from the parameters you give them and I'm under the impression that creating new objects and dereferencing old ones on this kind ...
1
vote
1answer
814 views

XNA HLSL 2D outline shader

I have gotten into quite a bit of trouble getting my rendering correct in my tile based 2D game. This kind of shader is surprisingly annoying to write, I've heard (we used it in one of our 3D ...
5
votes
2answers
1k views

Entity Component System: Retrieving components quickly [duplicate]

Possible Duplicate: Retrieving components from game objects (entities) I'm working on an entity-component-system game at the moment. I've looked in particular at the Artemis framework and a ...
3
votes
2answers
845 views

How do I properly use particle simulation in Unity?

So I'm using Unity's simulate function to pre-render particles. It seems that simulate is not quite working as to what I expect. It's most likely a setting that I missed. But I just really cannot find ...
1
vote
2answers
832 views

Drawing with SpriteBatch and GraphicsDevice.DrawPrimitives

I've faced with a problem when i tried to draw 2d game with SpriteBatch and GraphicsDevice.DrawUserPrimitives. I suppose that what is drawing with SpriteBatch has higher priority, because i can not ...
1
vote
0answers
455 views

Unity - Mesh Deforms terribly while mixing animations

I have a simple game I'm working on to help me learn unity3d. In my Start() function, I've used the following code to set up my animations. walkAnimation = animation["Walk"]; ...
2
votes
1answer
383 views

High volume sprite management in entity component system

I'm working on an entity-component-system based 2.5d game. That is, entities are groups of components that are processed by systems. I am having a hard time seeing how a sprite rendering system, that ...
3
votes
1answer
673 views

Why would a borderless full-screen window stutter occasionally?

I want to be able to allow players to switch between full-screen, windowed, and full-screen-with-a-borderless-window rendering modes. The last mode, borderless is an important one lots of players, ...
0
votes
2answers
764 views

HLSL shader optimization [closed]

The following HLSL shader (without preprocessing) results in 65 arithmetic operations (see below). Can the same effect achieved with <=64 operations? // Center of "light" float x; float y; // ...
2
votes
2answers
1k views

Flip sprite vertically AND horizontally?

In Microsoft.Xna.Framework.Graphics.SpriteEffects there is the possibility to flip a texture horizontally or vertically before rendering. But can one do both at the same time? When I use: ...
6
votes
1answer
547 views

ObjectDisposedException when Texture2D isn't disposed

I'm making a particle engine so I develop a texture programatically and I want to display it in a Windows Form picture box. So I create the Texture2D which goes fine. Then I use this code to convert ...
4
votes
1answer
415 views

Sound effects in separate thread?

Does it make sense to carry out all audio (music, sound effects, etc.) in a separate thread? In your experience, how large would you expect the performance impact of playing some MP3 music and 10-30 ...
2
votes
1answer
346 views

Collision detection with XNA and TiledLib

I recently started learning XNA and after getting annoyed with creating individuals rectangles each time I wanted to add something I went with TiledLib so I could more easily create levels using the ...
0
votes
1answer
138 views

Separating Axis Theorem fails at certain angles

I'm currently attempting to add an overlap tester for an axis aligned and orientated bounding box but the solution only seems to work accurately when the OBB's angle is between -10 and +10. As the ...
-1
votes
1answer
595 views

How to run Minecraft from a different folder [closed]

My problem is that I can run minecraft from a different folder, but when I run it, it is still using .minecraft folder. It saves the worlds there and so on. How can I run it like "everything get from ...
2
votes
2answers
359 views

Rotating a 2D Skeleton

I am currently implementing a 2D skeleton system in C# with XNA, but got stuck in how I would rotate the bones around a skeleton's axis. A basic algorithm that I have figured out already would ...
6
votes
2answers
432 views

Simulate movement towards the screen in a 2D world

I need to create the illusion of someone kicking a ball to the screen. For that, I have a initial position of the ball (about the middle of the screen), and I put the sprite of the ball scaled at 0.2 ...
5
votes
1answer
271 views

How do I pass arguments to an XNA Game executable?

How do for example make it possible to pass an argument to the .exe file and read it in my XNA Game? Examples: Enable Editor: game.exe -devmode Set Resolution: game.exe -width 1280 -height 720 ...
0
votes
1answer
647 views

XNA - move camera over tilemap

I am trying to build a game based on Advance Wars in XNA. I am so far where the tiles are placed on the screen, except here starts my problem. During the game, I ofcourse want to move the camera ...
1
vote
1answer
321 views

XNA (BEPU) Physics Performance

Im using XNA 4.0 with the BEPU physics engine v1.2 and I have encountered some performance problems on Xbox. Im not sure if the my mesurements are an expected result of the Xbox (with alot of dynamic ...
3
votes
2answers
1k views

Sprite Animation in XAML/C# for Windows 8 Modern UI (Metro)

I'm working on a project that requires doing sprite based animation in XAML / C# for a windows store app. I've worked out a method for displaying the animation, but it causes flickering during the ...
1
vote
1answer
269 views

MultiTexturing by neighbouring points textures

Visual example: I've been trying to understand multitexturing for a while now, I've created a terrain generator but have no need for height just yet and I still want one texture to blend over to ...
7
votes
1answer
459 views

Timestep in multiplayer game

I'm trying to wrap my brain around the concept of creating a server/client multiplayer experience. My problem is mainly related to timestep. Consider the following scenario: A client connects to ...
5
votes
1answer
306 views

How can I debug live multiplayer servers effectively?

I have a multiplayer server made by a small team of developers and we have bugs that crop up on our live server occasionally that we simply can't reproduce while playing with our small team on a live ...
6
votes
4answers
2k views

Retrieving components from game objects (entities)

Using C# and XNA 4, I've made the decision to go for an entity-component based design for my game after reading such posts as this and this, but I'm now struggling to find how to retrieve components ...
14
votes
6answers
966 views

How to make my characters turn smoothy while walking on a path(list of coordinates)?

I have a list with coordinates - output from A* algorithm - and I would like to make my characters smoothly follow this path with rotations. So I have something like A and I want to get C How can ...
5
votes
2answers
369 views

Black bars on 720p emulator?

I'm making a game for Windows Phone 8 using XNA 4.0 in Visual Studio express 2012. I'm trying to add a background image to the game with a size of 1366x768 (as i believe WP8 only supports up to 720p). ...
2
votes
3answers
844 views

Creating Rectangle-based buttons with OnClick events

As the title implies, I want a Button class with an OnClick event handler. It should fire off connected events when it is clicked. This is as far as I've made it: public class Button { public ...
4
votes
2answers
742 views

XNA 4.0 / C# Collision Response

Okay, this is really starting to annoy me. First of all, detecting collisions is nice and easy. I have a list of tiles, and a player. The player and each tile have their own rectangles. (The tiles ...
-4
votes
1answer
184 views

Dynamic cubes for cube engine [closed]

I had an idea for a cube world (i'm writing in C#) that would make creating new types of cubes simple and dynamic. Here is how I imagine it: 1.Text file stores everything including block name, ...
2
votes
3answers
637 views

MonoGame and normal windowed desktop application

I am trying to move all my XNA projects to Monogame. But in project templates I found only XAML and horrible metro application template. Is MonoGame support creating application in good old windowed ...
1
vote
1answer
207 views

Collision detection between player and tiles

I am trying to implement basic (for now) collision detection into my platformer. I have tiles that are each 16 x 16 in size. The character is 32 x 32 pixels in size and has its own bounding box. Now, ...
0
votes
1answer
252 views

Iterating 1D array and getting 2D tile position

I know I'm missing something very obvious here, but I have a 1D array that contains integers.I have a map that is 30 x 30 and the center coordinate is 0,0 (This is actually 3D, but I'm essentially ...
1
vote
0answers
388 views

XNA - How to move skinned model and merge animations

After you helped me to resolve my loadContent problem I've wrote some code and made 3D model with animation. Because XNA 4.0 doesn't support .fbx with multiple animations I've generated 3 models with ...