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

0
votes
4answers
587 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
511 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
517 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
355 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
496 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
191 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
516 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
302 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
729 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
825 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
264 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
574 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
565 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
234 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
198 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
262 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
617 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
807 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
277 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
579 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 ...
3
votes
4answers
1k views

How to handle cutscenes in XNA?

I am making a 2D RPG in XNA, and I want to be able to have basic cutscenes, kinda like those in the handheld Pokemon games. What is the easiest way to do this? Sorry for the vagueness of my question, ...
3
votes
2answers
957 views

XNA Spritebatch sorting by texture vs depth

I am refining my 2D game engine, and I want to look in to sorting sprite batches by texture (because I'm quite often using the same textures repeatedly). However, I also want to retain a few 'layers' ...
0
votes
1answer
623 views

Moving Character in C# XNA Not working

I'm having trouble trying to get my character to move for a game I'm making in my sparetime for the Xbox. However, I can't seem to figure out what I'm doing wrong , and I'm not even sure if I'm doing ...
2
votes
3answers
751 views

Creating a new instance, C#

EDIT: I've added bits of my GameplayScreen class so that you can see how my ball and bats are initialized. This sounds like a very n00b question, but bear with me here: I'm trying to access the ...
3
votes
4answers
986 views

Higher Performance With Spritesheets Than With Rotating Using C# and XNA 4.0?

I would like to know what the performance difference is between using multiple sprites in one file (sprite sheets) to draw a game-character being able to face in 4 directions and using one sprite ...
0
votes
1answer
537 views

Vector reflect problem

I'm testing some vector reflection and I want to check what happens when a ball collides with a paddle. So if I have: Vector2 velocity = new Vector2(-5, 2); position_ball += velocity; if ...
1
vote
1answer
1k views

XNA Skinning Sample - exporting from Blender recognize only first animation clip

(and sorry for my English) I'm using animation components from XNA Skinning Sample. It works great but when I export a model from Blender, it does not recognize any other animation clips than the ...
1
vote
1answer
1k views

Interpolation between two 3D points?

I'm working with some splines which define a path a character follows (you can see a gameplay video here to get a better understanding of what's going on: http://www.youtube.com/watch?v=BndobjOiZ6g). ...
1
vote
2answers
483 views

Do I need to use the Kinect SDK to develop for Xbox?

I was wondering if I need to use the Kinect SDK from Microsoft to develop games for the Xbox 360. I know there are other libraries such as OpenNI and OpenGL, but can I develop games using Kinect for ...
0
votes
1answer
267 views

Xna performance [closed]

I'm thinking about starting to write a game and my primary concern is performance. I was thinking about writing it in xna (client), and then also writing the server in c#. Will this be fast enough for ...
2
votes
5answers
412 views

Particle System in XNA - cannot draw particle

I'm trying to implement a simple particle system in my XNA project. I'm going by RB Whitaker's tutorial, and it seems simple enough. I'm trying to draw particles within my menu screen. Below I've ...
5
votes
2answers
4k views

How to determine collision direction between two rectangles?

I am trying to figure out how to determine the direction a collision occurs between two rectangles. One rectangle does not move. The other rectangle has a velocity in any direction. When a collision ...
3
votes
1answer
1k views

Platformer Starter Kit - Collision Issues

I'm having trouble with my game that is based off the XNA Platformer starter kit. My game uses smaller tiles (16x16) then the original (32x40) which I'm thinking may be having an effect on collision ...
2
votes
3answers
710 views

Collision Detection Problems

So I'm making a 2D tile based game but I can't quite get the collisions working properly. I've taken the code from the Platformer Sample and implemented it into my game as seen below. One problem I'm ...
3
votes
1answer
938 views

Loading class instance from XML with Texture2D

I'm having trouble with XML and XNA. I want to be able to load weapon settings through XML to make my weapons easier to make and to have less code in the actual project file. So I started out making a ...
4
votes
4answers
2k views

A* algorithm very slow

I have an programming a RTS game (I use XNA with C#). The pathfinding is working fine, except that when it has a lot of node to search in, there is a lag period of one or two seconds, it happens ...
1
vote
1answer
2k views

Best way to use Raknet from C#? [closed]

I am trying to learn Raknet with C# and I found it extremely confusing. The Raknet tutorial seems to work well in C++. I have already made the chat server from the tutorial. I am looking to do ...
1
vote
2answers
306 views

Building a shape out of two rectangles

I would like to build a body with Farseer out of two rectangles so it looks like this: I am a real beginner, so please describe it carefully. Thanks in advance!