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
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
301 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
350 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
1k 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
152 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
699 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
680 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
312 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
607 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
524 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
369 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
498 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) ...
5
votes
2answers
3k views

Best algorithm for recursive adjacent tiles?

In my game I have a set of tiles placed in a 2D array marked by their Xs and Zs ([1,1],[1,2], etc). Now, I want a sort of "Paint Bucket" mechanism: Selecting a tile will destroy all adjacent tiles ...
2
votes
1answer
192 views

How can I resolve collisions at different speeds, depending on the direction?

I have, for all intents and purposes, a Triangle class that objects in my scene can collide with (In actuality, the right side of a parallelogram). My collision detection and resolution code works ...
3
votes
1answer
532 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 ...
2
votes
1answer
303 views

Distance between two 3D objects' faces

I'm really newbie on programming and I'm making some tests. I couldn't find nowhere on Internet how could I calculate the distance between two 3D objects' faces. Is there anyway? Detailing, as an ...
1
vote
1answer
739 views

Drawing 2D Grid in 3D View - Need help with method

I'm trying to draw a simple 2D grid for an editor, to able to navigate more clearly around the 3D space, but I can't render it: Grid2D class, creates a grid of a certain size at a location and should ...
2
votes
1answer
848 views

Controlling a GameObject from another GameObject's script component

I'm creating a game where when starting the game, a Cube is duplicated GridSize * GridSize times when the game starts. Now, after the cubes are duplicated I want to attach a variable to them, say ...
1
vote
4answers
2k views

Using Lerp to create a hovering effect for a GameObject

I want to have a GameObject that has a "hovering" effect when the mouse is over it. What I'm having trouble with is actually having a color that gradually goes from one color to the next. I'm ...
0
votes
1answer
265 views

Weird appearance for a 3D XNA ground

I wanted to add a ground so I can know the position of a helicopter in the world. But the ground appeared in a weird way: http://i.stack.imgur.com/yTSuW.jpg The ground had the following texture: ...
2
votes
1answer
584 views

Using SurfaceFormat.Single and HLSL for GPGPU with XNA

I'm trying to implement a so-called ping-pong technique in XNA; you basically have two RenderTarget2D A and B and at each iteration you use one as texture and the other as target - and vice versa - ...
2
votes
1answer
570 views

Why use 3d matrix and camera in 2D world for 2d geometric figures?

I'm working in XNA on a 2d isometric world/game and I'm using DrawUserPrimitives to draw some geometric figures... I saw some tutorials about creating dynamic shadows but I didn't understood why they ...
1
vote
2answers
236 views

Resources to learn XNA for a professional c# developer

I'm a .net consultant (mainly c#) for my job, but for a while now, I've been interested in making a game in XNA (as a hobby project). I've had a "beginner" course in XNA when I was still a student, ...
0
votes
1answer
200 views

Syncing properties across a game server

I'm beginning to implement a simple scripting system into my networked server, and I've hit a snag. Before, I've been wrapping my calls into functions on objects that manipulate objects, but lately ...
5
votes
1answer
263 views

Split Texture2D Across Line

Background I'm using a texture as a damage map represented by an array of floats for displaying damage effects on a space ship in a process. An upside of this is being able to 'slice' ships in ...
2
votes
1answer
2k views

Drawing simple geometric figures with DrawUserPrimitives?

I'm trying to draw a simple triangle based on an array of vertex. I've been searching for a tutorial and I found a simple example on riemers but I couldn't get it to work. I think it was made for XNA ...
7
votes
4answers
1k views

Game Editor - When screen is clicked, how do you identify which object that is clicked?

I'm trying to create a Game Editor, currently just placing different types of Shapes and such. I'm doing this in Windows Forms while drawing the 3D with XNA. So, if I have a couple of Shapes on the ...
3
votes
0answers
620 views

Any recommended books/resources on component-based design? [closed]

I come from a background with heavy use of the classical object-oriented paradigm for software development. The company I am a part of switched to Unity not too long ago, and we're all very excited ...
3
votes
3answers
2k views

How many BasicEffects do you have in a Game? What is the best way to render multiple objects/shapes at once?

I'm trying to understand 3D rendering and it seems that everytime you render a new object (A 3D Cube or something) you need to have a new BasicEffect for each Box you render unless you want the exact ...
1
vote
1answer
270 views

JigLibX collision detection only once

I try to implement collision detection in latest JiglibX using this example http://jiglibx.wikidot.com/catch-collisionevents . I choose creating callback. I try to detect collision only once. When ...
3
votes
4answers
2k views

How can I improve my isometric tile-picking algorithm?

I've spent the last few days researching isometric tile-picking algorithms (converting screen-coordinates to tile-coordinates), and have obviously found a lot of the math beyond my grasp. I have ...
1
vote
4answers
814 views

Using elapsed time for SlowMo in XNA

UPDATE 2: I've tried to pass in GameTime to my Update method, just as I did for the bats, but I'm not seeing any change to the ball's speed. I've also changed my moveSpeed to: *moveSpeed += (15f * ...
-3
votes
2answers
278 views

Simple game in Android [closed]

In C# is there something like XNA which gives update or draw or other classes and methods for operating on vectors and matrices that works for Android? I want to make a very simple 2D game for ...
0
votes
2answers
3k views

How do I draw a single Triangle with XNA and fill it with a Texture?

I'm trying to wrap my head around: http://msdn.microsoft.com/en-us/library/bb196409.aspx I'm trying to create a method in XNA that renders a single Triangle, then later make a method that takes a ...
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 ...
-4
votes
1answer
180 views

Amazing Jutsu (Technique)

Hy..I'm newbie here.. Please does anyone knows, how to create such a character(sprites) to have a different Style Technique and different kind of movement, so he/she can alternate many technique to ...
3
votes
1answer
1k views

What is a normalized Vector?

Can someone explain the following code? I need to learn what each part means so I can turn it into enemy movement in a space shoot-em-up Vec2d playerPos; Vec2d direction; // always normalized float ...
1
vote
1answer
583 views

Trouble with SAT style vector projection in C#/XNA

Simply put I'm having a hard time working out how to work with XNA's Vector2 types while maintaining spatial considerations. I'm working with separating axis theorem and trying to project vectors onto ...