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

3
votes
5answers
733 views

GameplayScreen does not contain a definition for GraphicsDevice

Long story short: I'm trying to intergrate my game with Microsoft's Game State Management. In doing so I've run into some errors, and the latest one is in the title. I'm not able to display my HUD for ...
0
votes
2answers
159 views

GameStateManagement and inputs not being recognized

EDIT: I've removed a bit of code from the input class to make this more readable, and updated my StartScreen class, which is now at the bottom. I have the same issues though, but they are explained in ...
4
votes
1answer
755 views

XNA: Networking gone totally out of sync

I'm creating a multiplayer interface for a game in 2D some of my friends made, and I'm stuck with a huge latency or sync problem. I started by adapting my game to the msdn xna network tutorial and ...
0
votes
1answer
543 views

Initializing entities vs having a constructor parameter

I'm working on a turn-based tile-based puzzle game, and to create new entities, I use this code: Field.CreateEntity(10, 5, Factory.Player()); This creates a new Player at [10; 5]. I'm using a ...
0
votes
1answer
380 views

Creating movement path displays in a top-down 2d RTS

My game is a top-down 2d RTS coded in C# using SFML's libraries. I want that during unit selection, a unit will display it's movement path on the map. Currently, after the path is computed as a list ...
0
votes
1answer
187 views

XNA:Rectangles Movement Behavior

im trying to create simple pong game, and learning some XNA. im creating for each paddle 3 rectangles, who represnt the collision when the ball hit them, so i can dicide where to throw the ball back. ...
3
votes
0answers
207 views

How can I stop my Jitter physics meshes being offset? [closed]

I'm developing a C# game engine and have hit a snag trying to add physics. I'm using XNA for graphics and Jitter for physics. I am trying to split the XNA model into it's meshes, then create a ...
1
vote
1answer
1k views

Having troubles with LibNoise.XNA and generating tileable maps

Following up on my previous post, I found a wonderful port of LibNoise for XNA. I've been working with it for about 8 hours straight and I'm tearing my hair out - I just can not get maps to tile, I ...
1
vote
1answer
228 views

OpenAL seems to ignore sound attentuation/orientation for long sounds

I don't know how else to describe it in the title, sorry. My sound engine currently works perfectly with listener positioning and sound positioning to create the attentuation and panning effects. At ...
-2
votes
2answers
298 views

XNA: int as Vector2 so i can move sprite

I am really new XNA programming, and i am having a big problem. I have a Vector2, spritePosistion, that controls what position the sprite is at, now i want to move it by 1, every time that a player ...
6
votes
2answers
4k views

C# Perlin noise - generating “endless” terrain chunks?

I'm currently writing a little side scroller in C#, to both learn C# and have fun. Right now I have a simple random number generator generating the world but it isn't exactly all that great - so with ...
0
votes
1answer
2k views

C# multi-player socket server (need clarification/suggestions)

I've been working on an 2D-RPG for a while and I recently decided to make it into an MMO (not really massive, but multi-player). Anyways, I'm attempting to write a game server in C#. Yes, I know I ...
0
votes
1answer
292 views

Is there an SDK to write console apps to simulate an Xbox 360 controller?

Is there any SDK I can use to write a console app that can connect to an Xbox 360 as a controller and simulate controller interaction?
7
votes
3answers
383 views

Sort Polygons in order - not working?

I'm fairly new to programming in a 3d world. I'm trying to create a canvas where all the objects are drawn in order of furthest-to-closest and from bottom to top - so they don't overlap each other, ...
4
votes
4answers
928 views

Drawing 2D Images “3D-Like”

So, I want to use textures for weapons in my FPS game instead of actual models. However, if I just draw the texture onto a square in the game, it has the rotation and stuff, but it looks "2D". How ...
11
votes
6answers
3k views

Ball Physics : Smoothing the final bounces as the ball comes to rest

I've come against another issue in my little bouncing ball game. My ball is bouncing around fine except for the last moments when it is about to come to rest. The movement of the ball is smooth for ...
1
vote
1answer
444 views

Ball Physics : Bounce height altered by elasticity of ball and bounce surface

I have created a bouncing ball simulator using XNA and I am happy with my use of gravity, acceleration, change of direction and friction/spin. However, I am now at a stage where I would like to ...
5
votes
2answers
735 views

XNA significant loss in fps by just adding a few hundred thousand more triangles?

I've got a minecraftish game that's running nice and smooth with a total of 9.3 million triangles, about 50-70fps average. Then if I try to render 9.9 million triangles I get hell and it drops to ...
1
vote
1answer
809 views

XNA game looks laggy below 100 fps?

My xna game is running at about 70-90fps and it looks laggy at this fps. I'm using fraps to record the fps and I have a 120hz monitor, over 120hz looks fine but I can't understand why it feels like ...
5
votes
1answer
325 views

Loading content (meshes, textures, sounds) in the background

In my game, I am aiming for a continuous world, that is, a world where you can go anywhere without breaking the immersion through load times and "virtual seams". My world is broken up into regions, ...
53
votes
7answers
5k views

What are the dangers of self-teaching game development? [closed]

I am about to embark upon a journey into game development. Following answers to my last question, I will be using C# and XNA. However, I don't personally know any other game developers and I don't ...
2
votes
1answer
1k views

Getting started using C# and Physics (Resources, Tutorials, Samples, etc.) [closed]

As an application developer, I plan on now getting started in game development so I have come along to this site. I am a proficient C# developer so I guess it makes sense to start game development in ...
0
votes
1answer
1k views

XNA Calling Variables from separate Classes

I'm having some issues in XNA. I have a Player class and I would like to call a foreach function from a list which has been declared in the Game1 main class, which is below: public class Game1 : ...
2
votes
1answer
541 views

Odd offset bug in Farseer/XNA/C#

So I'm using Farseer to create an immovable object: [...] private Body body; public Immovable(World world, ContentManager c, String s, int posx, int posy, int w, int h, String user_data) { ...
5
votes
2answers
869 views

Detect Mip mapping level in the shader?

Is there a way to do this in pixel shader 2.0/3.0? I've got on or off transparency so when the mipmapping level is different the transparency can take up too much of the texture and make it ...
5
votes
2answers
3k views

Keeping the camera from going through walls in a first person game in Unity?

I'm using a modified version of the standard Unity First Person Controller. At the moment when I stand near walls, the camera clips through and lets me see through the wall. I know about camera ...
0
votes
1answer
61 views

Primitives does not show on screen [closed]

I'm trying to render terrain, everything compiles fine, but I can't see anything on screen. ( I'm moving camera around in case it was on the other side) Can't figure out whats wrong. public class ...
1
vote
3answers
4k views

MonoGame Mac installation instructions [closed]

Does anyone know how to install MonoGame on Mac. I have been looking around for a while and I can't find any guides. I have Mono and MonoDevelop up and running fine, but I cannot figure out how to ...
0
votes
2answers
5k views

Check collision between instantiated objects?

I am using a script to instantiate multiple objects having rigidbody with different velocities at different positions. I want to destroy two or more objects when they collide, but I'm not getting ...
5
votes
1answer
839 views

Infinite 2D Terrain

I was wondering how to create infinite 2D platform terrain. I've read about perlin noise and I have an idea I'd like to illustrate below. However, I have no idea how to achieve this. Are there any ...
1
vote
1answer
322 views

3D/perspective Top down shooter bullet issues

I'm developing a top-down shooter with multiple levels (ground for ground units, middle level for buildings, top level for air unity). The problem is the collision. Though I can make the collider ...
2
votes
3answers
2k views

C# 2D Game Library?

I'm looking for a C# 2D game library based on something like OpenTK which wraps OpenGL for C# Basically something like Slick2D (2D game library for Java) which is based on LWJGL which is an OpenGL ...
1
vote
1answer
593 views

3D Collision help

I'm having difficulties with my project. I'm quite new in XNA. Anyway, I'm trying to make 3D game and I'm already stuck on one basic thing. I have terrain made from a heightmap, and an avatar model. I ...
1
vote
1answer
145 views

XNA: weird collision behaviour

I'm reading the book "Learining XNA 4.0", and I'm in the object oriented disgn part. I'm having a weird problem with the collision of 2 rectangles. I have a list of automateSprite and a Player class ...
1
vote
1answer
494 views

Mouse click rectangle doesn't update to actual mouse position

I'm making a menu in XNA; and to solve clunky input via arrow keys, I thought I would use mouse input. I got everything to work perfectly, then I tried to click on something specific and nothing ...
3
votes
2answers
392 views

Tessellating/Subdividing a quad

I am creating a quad that starts as a single quad, then divides itself multiple times (from 1 -> 4 -> 16 -> 64 -> 256 etc) but I have encounted an issue. When I get to 64 sub divisions only 16 quads ...
2
votes
1answer
293 views

Scripting: Loading all scripts at runtime vs loading scripts when needed

I'm using Boo as a scripting language in my C#/.NET game via the in memory compiler with it and I really love it, however I'm having trouble deciding when I should load my scripts. This is my first ...
1
vote
3answers
650 views

Pathfinding for units of variable size

I'm using a grid map for a top-down RTS, and using a* for pathfinding. Specifically, I've found one implementation which is heavily optimised, and I've been using it for a while, but now I've realised ...
1
vote
1answer
2k views

Inventory Management concepts in XNA game

I am trying to code the inventory system in my first real game so I have very little experience in both c# and game engine development. Basically, I need some general guidance and tips with how to ...
1
vote
2answers
705 views

DirectX Flicker

I'm using DirectX 9 via SlimDX (C#). My screen flickers a lot during rendering. I dug a little deeper and see that the surface is being cleared early. Here's an example: ...
1
vote
2answers
506 views

Best practices, extending classes

I'm developing a game in XNA(C#) and I wonder what are the best practices for having different types of pads. For example I have 2 types of pads: Pad that just moves left (decreasing X coordinate) ...
4
votes
3answers
665 views

Pathfinding for a lot of units, mostly random movement

I'm using a uniform cost eight-directional grid as a map, with buildings that represent unpassable terrain - the map tries to simulate a top-down flat city. I'm trying to fill the city with randomly ...
6
votes
2answers
5k views

How do I create selectable menu options in C#/XNA?

Ok, I have my game's menu system set up. There are 3 screens (Controller Detect Screen, Title Screen, and GamePlay Screen). I wish to improve on this by having the ability for the player to select ...
2
votes
1answer
222 views

How do I stop my game from Skipping Screens?

I used the code from this - http://www.xnadevelopment.com/tutorials/thestateofthings/thestateofthings.shtml (The second method using enumerations) I modified it to add a 3rd screen for gameplay and ...
6
votes
2answers
15k views

Resolution problems when porting a Unity game to Android

So, I'm porting a game to the Android for the first time in Unity3D. And I've run in to a few problems along the way. My current problem is the resolution doesn't seem to be right, it cuts off the ...
0
votes
4answers
896 views

XNA transparent objects?

I've working on a voxel like game like Minecraft, but I'm not sure how I should handle alpha. I've got the world split into chunks and I render each chunk, I have things like leaves which have alpha ...
-2
votes
2answers
963 views

how to create a new game like pacman, snake, airplane fight game in C# with xna [closed]

I have a school project to create a game develop in c#.. I know all Basic of OOP and c#. I don't know where to start?.. Suggestion will appreciated Thank you
2
votes
3answers
815 views

How to I create a resource manager?

Currently I'm using XNA's ContentManager to load my content. For the unfamiliar the ContentManager deserializes classes from disk and keeps a reference for future requests. I'm currently facing a ...
0
votes
3answers
118 views

initialising units' properties & upgrades

I'm making a RTS in which units can get several cyber-upgrades (individual, not as a global tech-tree upgrade like in most RTS games) before they're created. Now, I'm trying to decide how to do this, ...
1
vote
1answer
414 views

Public Static vs. Instanced Classes [closed]

I've seen a lot of rhetoric over the year about not using a Public Static class to store global variables or methods that are used across an application. I understand the philosophy about code ...