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
1answer
124 views

Connect camera class to game

I've been following a tutorial on making a free camera for a 3D model. What the camera class does is allow the player to move and rotate in respects to the model's current position using the right ...
2
votes
1answer
1k views

Unity3D: default parameters in C# script

Accordingly to this thread, it seems that default parameters aren't supported by C# script in Unity3D environment. Declaring an optional parameter in a C# scirpt makes Mono Ide complaint about it: ...
-3
votes
2answers
879 views

Game Development using C#.Net [closed]

I'm a ASP as well as C#.Net Developer. I love playing Games and willing to Create one. I'm a new bi in this Arena. So can you Help me on How to Create a Game using C#.Net?? Or is there any course ...
1
vote
0answers
306 views

Is it considered poor programming to do this with xna components?

I created my own Menu System that is event driven. In order to have a loading screen and multithreaded loading to work, I devised this sort of implementation: //Let's check if the game is done ...
3
votes
2answers
451 views

Calculating the correct particle angle in an outwards explosion

I'm creating a simple particle explosion but am stuck in finding the correct angle to rotate my particle. The effect I'm going for is similar to this: Where each particle is going outwards from the ...
3
votes
1answer
530 views

Finding closest object to a location within a specific perpendicular distance to direction vector

I have a location and a direction vector indicating facing, I want to find the closest object to that location that is within some tolerance distance (perpendicular distance) to the ray formed by the ...
4
votes
3answers
693 views

IndexOutOfRangeException on World.Step after enabling/disabling a Farseer physics body?

Earlier, I posted a question asking how to swap fixtures on the fly in a 2D side-scroller using Farseer Physics Engine. The ultimate goal being that the player's physical body changes when the player ...
-6
votes
1answer
626 views

World of Warcraft like C++/C# server (highload) [closed]

I know it is very big topic and maybe my question is very beaten, but I'm interesting of basics how to write highload server for UDP/TCP client-server communications in MMO-like game on C++/C#? I mean ...
6
votes
1answer
762 views

Farseer Physics: Ways to create a Body?

I want to create something similar to this using farsser and Kinect: https://vimeo.com/33500649 This is my implementation until now: http://www.youtube.com/watch?v=GlIvJRhco4U I have the outline ...
3
votes
2answers
2k views

Create a Texture2D from larger image

I am having trouble with the basic logic of this solution: Xna: Splitting one large texture into an array of smaller textures in respect to my specific problem (specifically, I'm looking at the second ...
3
votes
2answers
601 views

Animate on tap in XNA (Windows Phone)

I'm trying to convert a AS3 game to C# / XNA and I'm looking for a way to animate a sprite. More precisely, I want the sprite to rotate and scale a bit, then return to its starting position. In AS3 ...
5
votes
1answer
280 views

C++ unmanaged inside winform

First: I am using C# and C++ on windows 7. I have created a basic rendering engine in c++ with directx 10. It works good as a stand alone application. But, when I sending the Form.Handle of a WinForm ...
1
vote
1answer
3k views

Converting world space coordinate to screen space coordinate and getting incorrect range of values

I'm attempting to convert from world space coordinates to screen space coordinates. I have the following code to transform my object position Vector3 screenSpacePoint = ...
1
vote
1answer
224 views

Fitting a rectangle into screen with XNA

I am drawing a rectangle with primitives in XNA. The width is: width = GraphicsDevice.Viewport.Width and the height is height = GraphicsDevice.Viewport.Height I am trying to fit this rectangle ...
9
votes
3answers
392 views

Why does Farseer 2.x store temporaries as members and not on the stack? (.NET)

UPDATE: This question refers to Farseer 2.x. The newer 3.x doesn't seem to do this. I'm using Farseer Physics Engine quite extensively at the moment, and I've noticed that it seems to store a lot of ...
-1
votes
1answer
728 views

Breakout… Getting the ball reflection X angle when htitting paddle / bricks [duplicate]

Im currently creating a breakout clone for my first ever C# / XNA game. Currently Ive had little trouble creating the paddle object, ball object, and all the bricks. The issue im currently having is ...
-2
votes
2answers
366 views

Inputting cheat codes - hidden keyboard input

Okay, here's what I want to do - when the player is at the main menu, I want them to be able to type in cheat codes. That's the only place I want it to work. I don't want to give them a text box to ...
1
vote
1answer
1k views

Enter text in XNA?

I'm looking for some help how to add text in XNA? I'm doing a game where I want the player to enter his or her name in the beginning. Is ther a simple way to do this? Help is preciated! Thanks!
2
votes
2answers
519 views

Organize game classes C# XNA

I've just begun working on my game and I don't know how to organize my game in separate classes, because I need some variables/methods to be available to every class. I have a screen manager class and ...
0
votes
0answers
168 views

XNA C# Phun-Style Window Movement Effects

Ok, so I'm making a game in XNA similar to Uplink (computer hacking) and I have a lot of ingame panels that display information, such as mission details, emails, passwords, and so on. To add to the ...
2
votes
1answer
196 views

Should I take line thickness into consideration for a grid based light game?

I'm currently rewriting some horrific code I wrote for a prototype and have stumbled right at the start! The game I'm working on revolves around directing light and there is a small ambiguity in ...
1
vote
2answers
654 views

XNA How to detect collision between 2d sprites and 3d primitives (not models)

My current status: I have already read some tutorials about 3d collision I know how ray trace works and how to convert mouse follow a vector to track the closest object that collides with out vector ...
2
votes
1answer
282 views

What kind of performance issues does multiple instances of the exact same object have on a game?

I'm fairly new to programming, and I've pretty much learned all the things I know on the go, while working on projects. The problem is that there some things that I just don't know where to begin ...
11
votes
4answers
2k views

Are there any frameworks that allow me to write games in C# on Linux? [closed]

I'm looking for something like an alternative to XNA - I don't care whether it's a 2D or 3D engine. It's not because I dislike Windows or am anti-Microsoft; it's because I like running Linux, code in ...
5
votes
2answers
3k views

Are there .NET bindings for Autodesk's FBX SDK?

I'm writing a tool in C# that needs to open FBX files (and the XNA content pipeline isn't a suitable solution). I note that Autodesk only provides it's FBX SDK as a C++ class library. Before I write ...
2
votes
1answer
166 views

Multiple images written and read from one meta-file?

Short version: I need a way to store multiple image files in one bigger file, to be used using C#, preferably easily compatible with XNA. The files will be read, written to, but also adaitional files ...
1
vote
1answer
147 views

XNA Content Loading works on my machine but not others [closed]

I'm using XNAWinForm series 2 from App Hub for some task that needs 3d rendering. It works fine on my PC, but I have problems in running this code on other machines. I installed XNA framework ...
1
vote
1answer
370 views

Highlight edge on 3d cube in directx

I want to make a 3d editor in DX9/XNA for a project I'm working on. I'm just thinking through how I would go about certain tasks and I'm stuck on one particular thing, which is crucial to making the ...
5
votes
3answers
659 views

How should I handle collectable/droppable/stackable items in an inventory?

I am working on a game with an inventory system, but am trying to figure out the best way of doing it. I have read the post about adding WorldItems or InventoryItems to a list, which is fair enough ...
1
vote
3answers
856 views

How to integrate game logic in game engines

Recently I'm working on a 2d game engine example in .Net with C#. My main problem is that I can't figure out how I should include the game logic within the game. Currently I have a base engine which ...
0
votes
1answer
142 views

Cannot build project for Xbox, using XNA

I'm trying to build a project for Xbox, and when I try to Package as an XNA Creator's Club Game I receive the following errors: The best overloaded method match for ...
2
votes
5answers
2k views

Xna Loading Screens

I'm making a 2D XNA game. I'd like to implement loading screens when stuff has to load for a while. Like when I login to an account, connect to the server, and generate worlds. I'm pretty sure it ...
0
votes
1answer
430 views

XNA Multisampling only for 3D

I am working on a game which consists of 3D elements and a 2D GUI. I have it working properly, but I want to enable multisampling for only the 3D parts, and not the 2D Textures. Otherwise, the GUI ...
2
votes
2answers
512 views

Transforming bounding spheres

When testing bounding spheres as part of the collision detection process, I'm using this method: public static BoundingSphere TransformBoundingSphere(Matrix m, BoundingSphere b) { var ...
-1
votes
3answers
4k views

Trying to generate some unique numbers [closed]

I find impossible to get this code to work! I want to generate 10 numbers that are unique, but despite all I change, I get duplictates of numbers in the array! Would really preciate some help to solve ...
4
votes
2answers
383 views

Strongly Typed Skills

I am working on a skill system for use in a game project I'm chipping away at. The project is entirely in C# so I'm using .NET to its advantage. In my preliminary implementation of a Skill Category ...
1
vote
2answers
866 views

Random position of object in foreach loop

i need help with some "scary" thing. I'm creating some objects in foreach loop. Each object has implemented in Update function random change of position. But while i'm creating this objects in foreach ...
3
votes
3answers
2k views

Handling movement in an Entity Component System

I'm working on a 2d RPG game in C# using an Entity-Component-System architecture, and I'm currently working on movement. Right now, I'm wondering how to organise the code so it looks a bit more.. ...
3
votes
3answers
1k views

Textureing subdivided Icosahedron in XNA, seam problem

*Look below for the updated source code* I have started to to make some different types of objects and create them by code in XNA. Right now I have finished the code for creating a Icosahedron. And ...
1
vote
2answers
264 views

Client/Server Object updates seems to run at different speeds

i have been playing around with the NetworkPrediction sample from Microsoft. Trying to adapt it to use gameTime. The client is running without fixed TimeStep and the server is custom C# and updates a ...
3
votes
3answers
477 views

Tile based platformer, using larger tiles?

So for my tile based platformer, It has a grid of tiles Occupying 1x1 block for each one. However, What if I want larger tiles? Maybe doors, tables, etc. They wouldnt fit in a 1x1 tile, so what I ...
1
vote
3answers
634 views

Smallest increment for a SpriteBatch depth between 0.0 and 1.0?

I experienced some problems with SpriteBatch in XNA when I tried to mix two different SpriteSort modes. (Begin with deferred, end, begin with BackToFront wasn't sorting properly.) I've settled on just ...
9
votes
1answer
2k views

Adding air drag to a golf ball trajectory equation

I'm developing a 2D golf game in VB.NET 2005, but I am stuck on how to implement air or wind drag that should affect the ball. Already I have these equations for projectile: Vo ...
2
votes
3answers
919 views

Stuck in an infinite recursion in Minesweeper

I am trying to build a simple minesweeper game. The game gets stuck in an infinite recursion whenever a user clicks on a tile which is not a mine... I have used the following function code for the ...
2
votes
1answer
277 views

MonoGame: prevent command prompt in windows?

Is there a way to prevent the command prompt from opening in windows when launching the game (via double clicking)?
1
vote
2answers
634 views

PreferredBackBufferWidth/Height from GraphicsDeviceManager not working?

It works fine in other "projects" so it has something to do with project. The project im talking about here has tons of classes but nothing with graphicsdevicemanager other than game1.cs game1.cs ...
0
votes
2answers
1k views

Creating mesh at run-time

I've a set of voxel data and I want to create a mesh out of it at run-time. I've looked into MeshBuilder and MeshHelper but I haven't found anything useful or a good tutorial how to use them. Can ...
0
votes
1answer
175 views

Getting width and height of view of game

well I have googled it and got some answers, asked many times, answered many times. as I read viewport is the "inside window" So I have 2 integers, height and width and this code: ...
2
votes
2answers
227 views

Child parent rendering (flash) in XNA

i am currently in the process of implementing a render engine that works like flash's. Where a sprite is drawn inside another sprite and reflects all transformation (rotation, scale, etc) on the ...
2
votes
1answer
183 views

Overlapping vertices on sphere?

Iv started up doing some programming in XNA as Iv been doing C# for several years and would like to start do some 3D work with C# and XNA framework. Right now Im trying to build a sphere by code. It ...