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
3answers
333 views

Looking for detailed pathfinding examples

I am currently working on a 2D-TopDown game. Now I was looking for pathfinding algorithms. I read and understood A* and Dijkstra. But there are still some questions I have. So I am looking for ...
2
votes
1answer
188 views

Implementing a wait function in a game script

I have been implementing behavior for enemies in my game and so far I have been doing it sort of like below: public void update() { if (frame > 60 && frame % 30 == 0) { ...
0
votes
1answer
104 views

XNA GameDefaults Class Settings

Are items such as the GameDifficulty enum, game settings, and other things in the GameDefaults class used for a lot? If so, is there a way to edit them or anything of the sorts?
1
vote
1answer
787 views

Udp protocol for game server/client

I've been trying to get a simple client server relation using udp for about a week now, And I think it's time for me to stop trying and ask for help... I understand how TCP works and UDP too. The ...
2
votes
1answer
65 views

How to rotate a cell of sprite sheet?

I can draw an animated sprite sheet without problems. But when it comes to rotation, the single cell (which gets drawn) rotates around the center of the whole sheet. How can I get my cell to rotate ...
3
votes
2answers
755 views

Get Unity to read in objects name without the need to hard code

I'm trying to get away from having to hard code in the names of objects I want my code to use. For example, I'm use to do it this way: TextAsset test = new TextAsset(); test = ...
1
vote
0answers
112 views

Non-smooth noise with optimal performance?

Any suggestions on how to get more 'jagged' results like linear interpolation gives with value noise using a faster algorithm concept like simplex noise? Simplex noise I haven't spent enough time ...
2
votes
1answer
130 views

What's a good way to distribute delayable tasks between frames to avoid lost frames?

I'm having a problem with finding a good way to keep the framerate high and at the same time keep running methods of game world update. I figured I could just put those methods in a thread so they are ...
0
votes
2answers
314 views

Trouble using Ray.Intersect method on bounding boxes in a 2D XNA game

I am trying to use a ray and bounding box to determine if a box is between the player and the mouse pointer in 2D space. When I try testing the code, the collision will return true when pointed at ...
5
votes
1answer
643 views

How can I render an .stl file in XNA or Monogame?

How should I go about rendering a .stl file as a 3d model in XNA? The .stl file contains a bunch of triangles that add up to a solid mesh. I have already figured out how to read the contained data. ...
9
votes
2answers
676 views

Algorithm for optimising a match game with known queue

I'm trying to write a solver in C# .NET for a game known as Flowerz. For your reference, you can play it on MSN, here: http://zone.msn.com/gameplayer/gameplayer.aspx?game=flowerz. I'm writing it for ...
6
votes
1answer
498 views

How can one implement a 3D Grid-based Line of Sight algorithm?

I'm creating a grid based Tactical RPG game in XNA. Image below kinda explains the idea. But if you've played Dwarf Fortress before, I'm basically trying to create that 3D line of sight and you can ...
0
votes
1answer
99 views

How to change something inside an switch statement? [closed]

So my question is how would you draw a list of strings, and then if a case of the enum is a certain way, then draw them a different way? Here is an example of what I mean: enum CurrentState { ...
0
votes
2answers
107 views

Keyboard Enter doing two things at once

In my CheckKeyboard(Keys.Enter) it does both of the things when I only want it to do one and the the other on the next enter click, I can't think of how to fix it. Thanks in Advanced, here is the ...
0
votes
1answer
102 views

3D Position won't translate to 2D

My 3D Hero-Model is positioned at a certain point in 3D-Coordinates. Whenever he's colliding with a coin, I want to place an animated sprite sheet there. But my following implementation won't give me ...
-4
votes
1answer
1k views

A very simple game server using c# [closed]

I just want to see a very simple sample of a c# game server that listens for connections from game client. Hope somebody can help me. I'm on the learning process of making a simple game server
-4
votes
1answer
96 views

.NET in Windows ME [closed]

So I'm used to work with C# and I recently started studying C++. So I have a Vista computer, which I'm using right now, but I also have an old Windows Millennium Edition Computer, and I also wanna ...
0
votes
0answers
247 views

Farseer: Difficulties with implementation of DebugView

I added the project "Farseer Physics Engine 3.3.1 HelloWorld XNA\DebugView XNA\DebugView XNA.csproj" to my solution explorer in Visual Studio. In addition, I added a reference to my project and the ...
2
votes
0answers
283 views

Call Unity3D coroutines from a scripting language

I created a simple scripting language to use on a Unity3D game. My parser generates an AST with nodes for every type of operation, and to run the script all I need to do is call Execute() on the root ...
1
vote
1answer
204 views

When to use GameComponents?

I know what it is and I'm using it as a frame counter for example. But when should I use it? Does it make sense to say "I make all the input handling happen in a gamecomponent"? Is it flexible enough ...
0
votes
1answer
236 views

Sharp DX Identity Matrix, Matrix.Forward vector pointing at negative Z

I'm trying to take a steady grip on Sharp DX. Already done some work like translating, scaling and rotating objects. Now i have to calculate the rotation matrix using only direction vector and ...
0
votes
1answer
293 views

MonoGame Linux Mouse.SetPosition doesn't work!

Having a really weird issue, it seems that no matter what I do I cannot get the Mouse to lock to the center of the screen in MonoGame. I triple checked all the possible noob mistakes, and ...
0
votes
1answer
72 views

Farseer: RemoveBody is not working [closed]

I want to remove bodies after they touched the character(playerrect). But the bodies get not removed. I set a breakpoint in the following line but it doesn't get yellow: ...
1
vote
1answer
148 views

Farseer: How can I remove a body?

I have many sensors(coins) in each level and I want to remove the sensors(coins) when the player rectangle(Mario) touches them. I check in OnCollision if Mario touches a coin, if he touches it, it ...
-2
votes
1answer
246 views

Programmatically creating a 3d mesh in XNA

Surprise! Another question related to Minecraft. Anyways: Rather than drawing thousands of blocks each frame, I remember reading somewhere that Minecraft breaks the map into 16x16x256 chunks, and ...
2
votes
1answer
361 views

Game Development AI, NPC & Entities Definition using Scripting Languages

i am developing a Multiplayer(actually MMORPG) architecture for learning purpose. I do have some game developement background, but all my engines were very rigid and completly developed for the game ...
-1
votes
1answer
1k views

“Car” movement in 2D dimension [closed]

I am searching for a simple tutorial how to add arcade car physics for my game. Exactly same user units behaviour i found in next games: Tank Hero: Laser Wars Death Worm: Video: ...
-4
votes
2answers
613 views

2D Graphics in CMD in C#

So, almost every programmer used Doom as inspiration for new Projects, right? So Doom and other classic MS-DOS game were played on something like Command Prompt. How do you display images in Command ...
0
votes
1answer
91 views

My Sprite Rectangle moves, but my sprite doesn't

Here's the issue, When I build, everything loads fine, everything works, but then, when you enter the game, the sprite is there. However, The sprite does not move, the sprite RECTANGLE does. Meaning ...
0
votes
3answers
419 views

Trying to get enemy sprites to move on C#

In my XNA game, I'm have the enemy sprites loaded and in the game screen. However, I put in the code to update their position in the Update method of the main class. The objective is to get the ...
3
votes
5answers
956 views

Can I write code from 2 computers at the same time? [closed]

So I know it might not be that related to game dev, but I'm now starting a project with friends and we want to code. Thing is, we are not living close, and when several programmers write different ...
0
votes
1answer
54 views

Farseer: Difficulties with ContactListener

How can I register the ContactListener in XNA? In the box2d manual is written: 9.4 Contact Listener ... At run-time you can create an instance of the listener and register it with ...
-2
votes
1answer
78 views

C# Stack<> Problem [closed]

I'm trying to change List<> to Stack<> however I'm having a hard time figuring out. A snippet of my code on where my issue occurs is: private Stack<Gem> gems = new ...
-1
votes
2answers
2k views

Move object to position using velocity [duplicate]

I'm trying to make a simple object move to a desired location using its velocity. But I'm having trouble with it over shooting its target. I have to use velocity, I can't simply lerp the position, ...
2
votes
1answer
644 views

How to blend biomes with procedural terrain

I'm working on a terrain generator. Through multiple noise functions, I'm able to create many kinds of terrain I like, but I'm having a bit of difficulty joining them together in a seamless fashion. ...
1
vote
1answer
94 views

How to gradually decrease opacity of model?

I have been searching for this matter for a long time and slowly I begin to think that this option is not available in XNA for Windows Phone. I am trying to get a 3D-Model to be drawn at 50% ...
0
votes
1answer
260 views

Isometric Map Rendering Incorrectly [closed]

I've currently been trying my hand at Isometric map rendering via the tutorial over at XNA resources; http://www.xnaresources.com/default.asp?page=Tutorial:TileEngineSeries:4 However, unfortuanely ...
1
vote
1answer
329 views

MonoGame Cross-Platform Conditional Compilation Symbols

What are the possible compiler directives for MonoGame? For example, XNA contained directives for WINDOWS, XBOX/XBOX360, and WINDOWS_PHONE. I've also seen DIRECTX and OPENGL, but when would you need ...
-1
votes
1answer
137 views

SpriteBatch memory leak

I have a strange problem with XNA 4. I'm constructing a SpriteBatch using this.spriteBatch = new SpriteBatch( GraphicsDevice );. This leads to a memory leak up to 600 MB memory consumption. This ...
-2
votes
3answers
2k views

What should I know to start in game development? [closed]

I know this is asked very often here and probably my question will get closed, but I am clueless in this direction. I want to start creating my own PC games. I know C++ and a bit of C#. I created a ...
2
votes
1answer
122 views

XNA Scale and Render Targets

I'm working on a top down Strategy/RPG/Tower Defense XNA Game for Windows, and I'm running into an issue while scaling. My display mode is 1680 X 1050, and that is what I'm setting the ...
4
votes
1answer
198 views

How do I make a tile passable in one direction only?

I want that my character can jump through some of the tiles, like Mario does in this video: http://www.youtube.com/watch?v=zIPYzbNrNhc In this video, Mario jumps up through orange platforms, but ...
0
votes
3answers
814 views

How do I move a sprite to the mouse position?

So, I'm trying to make my sprite walk to the X-coordinate of my mouse click. This is my code: currentMouseState = Mouse.GetState(); MouseState mouseState = Mouse.GetState(); ...
-3
votes
1answer
396 views

Farseer: are you missing a using directive or an assembly reference?

I want to create a polygon in Farseer. I found an example in the documentation but it's not working because I get this error message: The type or namespace name 'Vertices' could not be found (are you ...
0
votes
1answer
108 views

Farseer: Ball is not getting slower

The ball is not getting slower when it rolls over a straight platform. I added friction but that changed nothing, the ball still gets not slower. I want that the ball gets slower and slower and stops ...
0
votes
1answer
205 views

Farseer: Ball is not bouncing realistically

I created a ball that is rolling over platforms. When it falls from one platform to another, it should bounce just like in real life, but the ball keeps bouncing constantly and I don't know how to ...
1
vote
2answers
319 views

XNA spritebatch.Draw: Which part gets colored by the color parameter?

Which part gets colored and how can I control it? I have a rounded block and my goal is to have the center filled with a certain color chosen by that parameter. Here's the picture: ...
3
votes
3answers
561 views

MMOFPS Choosing protocol for high-traffic network (UDP or TCP)? [closed]

my question about the player position sender protocol. In this article, he says "Never use TCP for networking a multiplayer game". Ok but UDP datas are not ordered. In this case, if somebody walking, ...
1
vote
2answers
148 views

MMOFPS Player Positions [closed]

I'm working on a MMO game project. I have a question about MMOFPS game architecture. (I have basic network knowladge) (MMOFPS) I want to send player position to other players(clients) and other ...
1
vote
1answer
56 views

How can I access the translation part of a skinned Model object's bone transformation?

I have an animated Model, which I process with the SkinnedEffectProcessor. How I can access translations of that model during animation? It's always a BoneTransform I am working with, but I'd like to ...