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

How would I be able to get a game over screen using the pause function?

I am having problems with my snake game, when the snake collides with itself it draws a "game over" image in the background, but only while it's colliding with itself. I want it to behave like the ...
2
votes
4answers
1k views

Simulating a sine wave/oscillating pattern for enemies

I'm creating a simple top down shooter, right now I have an enemy which simply follows the player. I'd like to change things up and have the enemies move towards the player but in a wave like motion. ...
2
votes
3answers
6k views

Game engine like Unity 3D that allow me to use .NET code [closed]

I've been looking at Unity 3D for developing a 3D PC game and I really like the scene editor and how it simplifies the process of constructing 3D scenes, managing assets, animations, transitions etc. ...
5
votes
2answers
2k views

Is there a simpler way to create a borderless window with XNA 4.0?

When looking into making my XNA game's window border-less, I found no properties or methods under Game.Window that would provide this, but I did find a window handle to the form. I was able to ...
3
votes
3answers
751 views

Does every Entity in an XNA game need it's own BasicEffect instance?

From what I see, the position/matrix is stored in the BasicEffect instance, so it makes sense to me that every object has it's own position matrix, but I'm not 100% sure it's correct to let every ...
0
votes
1answer
180 views

Get blocky look on textures some textures

If I do this: GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap; All textures I draw are blocky. GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap; All of my textures are blurred a ...
9
votes
1answer
1k views

Xbox thumbstick used to rotate sprite, basic formula makes it “stick” or feel “sticky” at 90 degree intervals! How do you get smooth rotation?

I am using a very basic formula to calculate what angle my sprite (spaceship for example) should be facing based on the Xbox controller thumbstick i.e. you use the thumbstick to rotate the ship. In ...
0
votes
1answer
493 views

Alpha blend 3D png texture in XNA

I'm trying to draw a partly transparent texture a plane, but the problem is that it's incorrectly displaying what is behind that texture. Pseudo code: vertices1 basiceffect1 // The vertices of ...
3
votes
3answers
403 views

How do I render everything in software using XNA/C#?

I'm trying to find how to render everything with software in XNA, but I can't find what option I need to set. I'd like to know which method/properties I have to call/set to make my app run in ...
3
votes
2answers
520 views

XNA frame rate spikes in full screen mode

I'm loading a simple texture and rotating it in XNA, and this works. But when I run it in full screen 1920x1080 mode I see spikes while my texture is rotating. If I run it windowed with 1920x1080 ...
1
vote
1answer
250 views

Selection of a mesh with arbitrary region

Considering example: I have a mesh(es) on the OpenGL screen and would like to select a part of it (say for delete purpose). There is a clear way to do the selction via Ray Tracing, or via Selection ...
1
vote
0answers
89 views

RasterizerState set to null after calling DrawText in Nuclex [closed]

I have the following classes. // Basically hots the instance of the Vectorfont & Matrix internal class Text3D : AManageable { private Text _textFont; private ...
0
votes
3answers
901 views

Method for spawning enemies according to player score and game time

I'm making a top-down shooter and want to scale the difficulty of the game according to what the score is and how much time has Passed. Along with this, I want to spawn enemies in different patterns ...
8
votes
2answers
5k views

How to decompose sprite sheet

I have a lot of spritesheets that are poorly formatted that I want to decompose, or split out into many small images, one for each sprite. If I can do that, I can use my custom texture packer tool to ...
2
votes
2answers
344 views

How to offset particles from point of origin

Hi I'm having troubles off setting particles from a point of origin. I want my particles to spread out after a certain radius from a the point of origin. For example, this is what I have right now: ...
0
votes
1answer
125 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 ...
1
vote
1answer
580 views

default xna 4.0 gametime don´t works well for 2D physics

I am developing a game using Visual Studio 2010 and XNA 4.0, after advancing to some extent with the project (a platform based 2d platformer msdn starter kit) I got to test it on different computers ...
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: ...
0
votes
1answer
209 views

Move model forward base on model orientation

My model rotates on it's own Y-axis regardless of where it is in the world. Here are the controls for the left ThumbStick: UP (move model forward on Z-Axis) DOWN (move model backward on Z-Axis) LEFT ...
-3
votes
2answers
886 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 ...
0
votes
1answer
120 views

how to create texture for modelmesh?

Is there a possibiltiy to create a texture from a meshpart in xna. By getting a flat version of the mesh. So I can create a texture for it and edit that texture(via rendertarget)? I need to get the ...
-2
votes
2answers
687 views

Game development using C# or .Net technology [closed]

I am new to .Net and C# and I am interested in game development . I just studied about Mono-andriod and mono-iOS but they are not free to use . I also read about XNA and I think its free to use . So ...
3
votes
2answers
458 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 ...
1
vote
1answer
550 views

Why does my 3D model not translate the way I expect? [closed]

In my first image, my model displays correctly: But when I move the model's position along the Z-axis (forward) I get this, yet the Y-axis doesnt change. An if I keep going, the model disappears ...
1
vote
3answers
804 views

Randomly placing items script not working - sometimes items spawn in walls, sometimes items spawn in weird locations

EDIT: I changed some code after getting advice from colleagues. However it still has problems occasionally, though the problems aren't as bad or frequent. Here's the new code I'm actually using: ` ...
-6
votes
1answer
639 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 ...
4
votes
1answer
439 views

Can't load vector font in Nuclex Framework

I've been trying to get this to work for the last 2 hours and I'm not getting what I'm doing wrong... I've added Nuclex.TrueTypeImporter to my references in my content and I've added Nuclex.Fonts ...
6
votes
1answer
778 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 ...
10
votes
6answers
21k views

Visual Studio 2012 and Game Development [closed]

Alright, I think it's a simple question, but I got difficulties to find some answers around. I already read that XNA wouldn't be in Visual Studio 2012. I recently learned to use XNA, but since I ...
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
614 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
281 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 ...
-1
votes
1answer
747 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
369 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!
3
votes
1answer
843 views

First-Time GLSL Shadow Mapping Problems [closed]

I'm working on building out a 2.5D engine and having massive problems getting my shadows working. I'm at a point where I'm VERY close. So, let's see a picture to see what I have: As you can see ...
0
votes
0answers
170 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
198 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 ...
4
votes
2answers
5k views

Where to attach global scripts in Unity?

As far as Iknow in Unity, every script must be attached to an object. But what is the case with global scripts? For example in a tetris-like game to which object should I attach the element spawner ...
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
3k views

Should I use XNA or Unity to build a video game? [closed]

My friend and I are planning to make a video game (like Slender) where the character is stuck in a building, when lightning strikes, and the lights go out and your objective is to find the back-up ...
1
vote
1answer
377 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 ...
0
votes
1answer
143 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
2answers
528 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 ...
0
votes
1answer
441 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 ...
5
votes
3answers
899 views

XNA shader compiler error in release mode

I'm having a hard time figuring out if I'm doing something wrong, or if there is a bug with Visual Studio. I want to pass a float into my pixel shader, clamp it to a value, and then return it as part ...
-1
votes
3answers
3k 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 ...