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
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 ...
0
votes
2answers
141 views

X and Y value to Vector2

In the first code I get a Vector2 random position and create an object with that, but in the second code I want to use the same constructor to create an object, but I want to pass a X and Y value to ...
0
votes
2answers
228 views

Implementing a multishot powerup for a top down shooter

I have a top down shooter wherein I generate a projectile on each mouse click at the player's position and translate it in a straight line until it reaches the edge of the screen. I also have ...
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 ...
8
votes
3answers
943 views

Is there any Card Game Framework? [closed]

Please let's avoid the discussion of creating/using a game framework or not. I would like to create a small framework for card games or use one if it exists. Does anyone knows one? Preferably ...
4
votes
1answer
249 views

Create shape from points / lines in editor and mathematically calculate nearest points within shape

If I want an editor that accepts "points" of a minimum of three (a triangle) and I just add some points first, like this: how can I mathematically connect these corners (points) into an object of ...
2
votes
1answer
290 views

Texturing voxel faces separately

I am creating a 3D level editor which should be used to generate the very basic layout (level geometry) and a few basic game-logic entities of maps used in my game. So far, I decided to use voxels (i ...
0
votes
1answer
170 views

Can someone explain this occurrence with a fbx model in xna?

Because this is kind of weird to explain, let's show you what I mean. This is in my game. When I import this base ship model, it should be at (1000,1000,1000), but the model acts like it's at ...
0
votes
1answer
335 views

3d world vertex translation to go to 2d screen coords

My technical english is a little rusty so to avoid misunderstands please be patient with me :) I will try to be brief and clear Situation: - I have a 2d sprite character on the screen - I've just ...
5
votes
1answer
788 views

What is the best way to implement dialogs in an xna game?

I want to implement some startup dialogs, for selecting game parameters, etc. The obvious (and I suppose naive) choice is to just use windows forms (I'm not really planning on porting this game to ...
0
votes
2answers
441 views

using per pixel collision for an elastic response

I realize this might be open ended ended but curious if I just did some over kill... I had this http://xbox.create.msdn.com/en-US/education/catalog/tutorial/collision_2d_perpixel and i reworked it ...
1
vote
1answer
210 views

How would a sprite spawn more sprites under themself every second?

I am making a snake game and am having trouble to make the snake go longer, at the moment when I run the program, I just have the snake head eating apples. But I want the snake head(30x30) to spawn ...
-3
votes
1answer
121 views

I need to make a create-a-class system like in COD

I need to make a create-a-class system like in COD but I don't know what code I need. I am also wondering if I have to make a photoshop image for every way it could look or do I type in the code to ...
0
votes
2answers
318 views

Compare new Vector2 position with previous Vector2 position

I'm trying to place different objects in the game area like a grid, but I have some problem with my method that creates this objects and there positions. I'm trying to store each new positions in a ...
6
votes
6answers
347 views

What can I do with an old XNA game?

I have this little amusing game that I made in my second year of high school, and I'm rather impressed with it. It isn't anything that I could present in any style of major game conference or ...
3
votes
3answers
468 views

How can multiple clients be out of sync if they use the same RNG seed?

I have been working on a client-server architecture to enable LAN play for my open source game, Aigilas. In its current state, players stay synced in all running instances of the game but enemies and ...
2
votes
2answers
189 views

Handling of data sharing between framework module

I am currently developping a 3D game using C# / XNA 4.0 and i am currently thinking about how i should structure my game. The actual game is in fact not really important as the framework i am working ...
2
votes
0answers
1k views

Why is my deferred lighting implementation so expensive?

I've implemented deferred lighting and I tried to put about 20-26 lights on the viewable space of my map, and it brings down the FPS from 61 to 28-31. It also makes my VGA temperature to go from 68°C ...
2
votes
1answer
443 views

How to handle input for both UI and game

So I originally had my input system set up with only the game part in mind. It listens to keyup/down events, marks the key as pressed/unpressed and then when the next update comes around, it sends ...
1
vote
2answers
266 views

Help retrieving/sending data to/from a server on iOS (C#, Mono, .Net)

I'm sorry in advance if this is a silly question. I'm currently working on getting something running where I can grab information from a server. My goal is to make the data I'm retrieving (or ...
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 ...
0
votes
1answer
435 views

Setting Krypton Light to Screen Pixels

So a few days back, I started playing around with Krypton XNA for 2D lighting in my game. I noticed in general, that spawning a light at (0,0) with Krypton causes the light to appear in, pretty much, ...
4
votes
4answers
1k views

Why use this equation to get a percentage?

In an XNA book I read that this code does an action with a 0.2% of probability but I don't' understand why: float chance = 0.2f; if((float)rand.Next(0,1000) / 10 <= chance) { ... } I understand ...
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 ...
2
votes
2answers
299 views

Avoid the same code several times in game state enum

I use a switch with enums to divide my game in different parts. In the code below, that is simplified, I have a problem, becasue I need to show the same text in two or perhaps more parts and I wonder ...
2
votes
1answer
401 views

My transparent objects overwrite opaque objects depth and always draw on top?

I have set up an 'Order Independent Transparency' method for drawing my transparent objects. The algorithm can be simplified as follows: DrawOpaqueObjects() DrawTransparentObjects() Drawing the ...
1
vote
0answers
253 views

Map terrain generation to texture instead of color

I have some terrain being generated using the following algorithm double rand1 = rand.NextDouble() + 1; double rand2 = rand.NextDouble() + 2; double rand3 = rand.NextDouble() + 3; float offset = ...
2
votes
1answer
303 views

Implementing Circular Sprite Masks

So I've been scouring the interwebs for a couple of days with regards to how to implement sprite masking in XNA 4 and C#. Coming from a pet project I did in Flash, this was pretty easy as masks are ...
1
vote
2answers
118 views

Unable to generate standalone noise

I've been stuck this evening on getting a Perlin Noise function to generate by itself. Every time I run the program without adding to different types of noise together it calls an ArgumentException ...
0
votes
1answer
353 views

Problem with monogame reference in monodevelop MAC

I've downloaded monogame, monotouch (test version) and monodevelop for MAC and I created a monotouch IOS project, I included the Lidgren and Monogame csproject inside my monodevelop project and I ...
14
votes
5answers
12k views

SharpDX and game engines, back to zero?

I'm a desktop developer (I mainly do WPF for a living) but I want to make games as a hobby. So a few months ago, I started reading blogs, gamedevSE, you name it. I understand in the C++ DirectX ...
-1
votes
2answers
2k views

Using XNA GameComponents simply

looking for a quick code example (im a visual guy) and this is getting a little confusing/frustrating. Because im a very "modular" kind of guy, I like to split my code up into logical files as often ...
2
votes
1answer
2k views

Unity RTS Movement

I am trying Unity out and I want to try and write an RTS. What would be the best way to go about getting the basic, right click to set a destination working within Unity? I know how to get the ...
4
votes
2answers
1k views

How to create biomes

I am creating an 2D XNA Tile Based Platformer. I have a tile engine and a world/terrain generator. However, I am trying to create biomes or areas, For example, Desert in one part of the world, ocean ...
1
vote
1answer
95 views

Content loading, Content processing and add processed file to a DataContainer?

I'm trying to create some kind of editor in Windows Forms for XNA and I was wondering if there's anyway to do this: Load content (known types, like Model/SpriteFont/Effect/Texture) through ...
0
votes
1answer
153 views

Why are my triangles not being drawn in the color I define?

I render a simple mash structure with Tao (don't think this is relevant) using DisplayList. Following code appears between int displayList = Gl.glGenLists(1); Gl.glNewList(displayList, ...
0
votes
1answer
2k views

Random terrain generation with caves

I am currently working on a small game that will generate a world with caves and entrances to the caves, something like Terraria if you will. Today I reached some trouble on the world/cave generation ...
1
vote
1answer
146 views

Vertex data from a buffer

I'm using a geometry shader to generate polygons for my voxel terrain (marching cubes). The data is output into a buffer using the method shown in the article I link to below. ...
2
votes
1answer
706 views

Xna winform scaling and mouse position

I am attempting to create a simple 2d level editor using xna and winforms. I have used the app hub win form samples as a starting point. At first I was having trouble with the mouse coordinates but ...
7
votes
2answers
1k views

How to deal with variable size font in XNA 4.0

After searching for a while, I found no way to draw vector/scalable fonts in XNA 4.0 (which would be perfect...) and I am currently in a bind about how to render fonts for my game. In the game I use ...
5
votes
4answers
683 views

Console-type interface in game

I am currently programming a very simple 2d game in C# with XNA. I was wondering how to implement a console-type interface in a game or graphical software like there is in Skyrim or Counter-strike or ...
1
vote
0answers
315 views

State Machine with State per Entity [closed]

I have a generic state machine implementation like this: public abstract class State<TOwner> { public virtual void OnEnter(TOwner owner) { ... } public virtual void OnExit(TOwner ...
4
votes
2answers
2k views

Do I require a game engine when I want to make a game?

I started making a 2D game in C# and realized that I could also use a game engine or XNA. For the moment everything works fine but I'm afraid I will have problems in the future. So do I actually need ...
6
votes
3answers
317 views

What is the “pricing standard” on Windows Phone?

On iOS, I find it is more usual to see light versions of a game for free (with ads and less features) and a full version for a cost and all the features. On Android, I see more games that have both a ...
0
votes
4answers
621 views

Missing triangles in model

I am having an issue where triangles in a model aren't being shown. The left is wireframe, the right is the finished image. For some reason a bunch of the triangles aren't being shown. The project ...
0
votes
3answers
530 views

Code Problem Involving Vertical Movement of Platforms

I am trying to create vertical moving tiles with the Microsoft Platformer Starter Kit. My platforms can move in one direction; however, they fail to switch direction. If my platform starts at the ...
0
votes
1answer
520 views

3D Texture Mapping (Atlas)

This is a pretty simple question. If I was to use multiple images in a single texture for a 3D cube, how would I go about re-using each vertex (having 8 total vs 24)? With a single buffer of 8 ...
0
votes
1answer
1k views

Turn Based Event Algorithm

I'm currently working on a small roguelike in XNA, which sees the player in a randomly generated series of dungeons fending off creeps, as you might expect. As with most roguelikes, the player makes a ...
3
votes
1answer
372 views

2D mouse coordinates from 3d object projection

Not entirely certain of the nomenclature here -- basically, after placing a model in world coordinates and setting up a 3D camera to look at it the model has been projected onto the screen in a 2D ...
1
vote
1answer
503 views

xna orbit camera troubles

I have a Model named cube to which I load in LoadContent(): cube = Content.Load<Model>("untitled");. In the Draw Method I call DrawModel: private void DrawModel(Model m, Matrix world) ...