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
0answers
6 views

How to open prerequisite retrieval application

I have an application that cannot use OneClick publishing. I still want to access those nice prerequisite (applications?) that install .NET and XNA for you when you create a OneClick publisher. I ...
0
votes
0answers
56 views

Why use '@' when loading content? [on hold]

When I've looked at xna code, people always seem use '@' before loading content. E.g: playerImg = Content.Load<Texture2D>(@"player"); What does it actually do, does it speed up of loading ...
0
votes
1answer
16 views

Rectangle collision doesn't work on WP 8

Collision detection is not working correctly when my 64x64 pixel block touches a bigger block. The big(rect2big) block measures 128x128 pixel. The falling block should change it's color to black when ...
-1
votes
0answers
23 views

Items failing to cast as Image Items in GLEED2D

When I try to cast an Item as an ImageItem in fails to convert and returns null, hence skipping the code I want to use to extract the texture data. I have already down cast my Item to an ImageItem, ...
0
votes
1answer
73 views

Rotate an object smoothly on the Y axis in Unity

I am attempting a simple script to swing a door open in Unity. This requires a smooth rotation of 90 degrees around the Y axis. I have seen that one way to do this is using Unity's Quanternion ...
0
votes
1answer
44 views

How can I make a clickable menu in WP 7/8?

I'm trying to make a clickable menu for my XNA Windows Phone game. If the player makes a tap gesture on a button(rectangle), something will happen. For example, the game will start if you touch the ...
0
votes
1answer
49 views

Texture2D can't find my sprite - how to setup the content directory in XNA

So I keep getting told that spr_lives can't be found. I'm working out of a book and using the samples given to me (have not changed the code or folder structure, so it /should/ work) but nothing's ...
-1
votes
2answers
127 views

Move a player in the opposite direction they are looking

I'm looking to move the player in the opposite direction they are facing with a specified force. Rather than try to explain that better I created an image showing what I mean, I've tried reversing ...
-5
votes
0answers
55 views

Exit() won't be called in my XNA game? [closed]

My variables: //Game States enum gameState { gameLoading, mainMenu, gameOptions, levelSelect, gamePlaying, gameOver } gameState ...
1
vote
0answers
43 views

How to implement delta compression of an object in C#? [migrated]

I'm working on a server-based multiplayer game written in C#. The server and the client shares code and each object has the same int ID. I want to make the networking to be light as possible, by ...
0
votes
2answers
67 views

Why does my ball stay at the end corner of my screen(XNA)? [closed]

Why does my ball stay at the end corner of my screen. Here is my code: ballmov(Texture2D ballimage, Rectangle paddle, Rectangle ball, Rectangle enemy, SpriteBatch spriteBatch, GraphicsDeviceManager ...
1
vote
1answer
83 views

How could I figure out the shortest way to turn, and whats the angle? [duplicate]

I'm creating some robots for my tank game. I want them to find each other and shoot each other down, so I'm trying to implement a way for them to turn towards each other, and turn the shortest way. ...
-1
votes
1answer
66 views

Xna tile map collision

I finally found a tutorial on tile maps and loading them in from a file that I understand (http://circlessuck.blogspot.co.uk/2012/09/xna-tutorial-basic-tile-engine-part-2.html), however the tutorial ...
-4
votes
2answers
138 views

If XNA goes away does that mean C# can't be used to create games? [duplicate]

I read that XNA is going away even though it may be "somewhat" supported. If that goes away, how is game programming to be done on a PC (or for the console)? I did search and found this on SO, ...
1
vote
1answer
86 views

How to tile multiple procedurally generated textures?

I'm trying to develop a procedural tile generator for a game, mostly for the ground tiles, instead of using "hand-drawn" tiles. To achieve this I'm using Perlin noise and a sine wave with multiple ...
-1
votes
0answers
40 views

2D Per pixel collision detection not working

I would like to say sorry in advance for the amount of code I will post, but I can't seem to get my collision detection to work, the player and the objects pass through each other with no effect when ...
0
votes
1answer
83 views

Rotate around the centre of the screen

I want my camera to rotate around the centre of screen and I'm not sure how to achieve that. I have a rotation in the camera but I'm not sure what its rotating around. (I think it might be rotating ...
0
votes
0answers
107 views

How to make custom shaped holes in terrain

So I'm trying to create a game where you fit certain shaped objects into the hole that fits them (similar to the young children's game with different shaped blocks) in Unity 3D. I've encountered a ...
0
votes
1answer
61 views

XNA & HLSL - rendering a model with its original materials (colors)

I am currently trying to code my own HLSL effect file, in order to render an FBX model I made with Autodesk maya, and to which I have applied some materials (colors). before trying to write an effect ...
1
vote
2answers
118 views

Rotating sprite 180 deg

I should say first, that I have the rotation down. Its just that I want my square to rotate exactly 180 degrees. Currently, it will rotate but it will rotate but by less each jump. So after several ...
-1
votes
0answers
109 views

Events system structure

I have a sub-system that manages specific events for actors, quests, world space and so on. For example an actor dies. This event sends a message that's important to quests, game world and so on. Is ...
1
vote
0answers
43 views

Using multiple passes in OpenCL .net

I'm new to opencl but I have some experience using HLSL. In HLSL multiple passes are used when you need to finish a computation before moving on to the next step. I would like to know how this sort ...
-1
votes
1answer
70 views

3d Wall sliding collision

I'm working on collision for walls in my game and the way I currently have it I get stuck walking into a wall. I'm trying to make my character slide on the walls but still collide. My character moves ...
0
votes
1answer
39 views

Monogame/SharpDX Texture2D doesn't hold value

The problem I have discovered is most likely between classes, so I dont really have much option but to post the whole code here: https://www.dropbox.com/sh/smyw9t1ap3by2vd/pBX-aJJ-Qx I have been ...
2
votes
2answers
107 views

How do I rotate a single object in HLSL?

I have a World with a 3D model of a head in it and that World rotates, like such: protected override void Update(GameTime gameTime) { //other stuff angle += 0.00005f; //more other stuff ...
0
votes
2answers
113 views

Pause and Re-Enter Game Component Update (XNA)

I'm currently working on a (trading) card game in XNA and I'm having some trouble with returning results from a popup and immediately using them. I'm able to make a popup screen (see this tutorial) ...
0
votes
1answer
164 views

ASP.NET MVC & SQL Server vs. PHP & MySql

I'm going to develop a strategy browser-based game with ASP.NET MVC and SQL Server. However, as I explored the web to get some ideas and patterns from existing games, I found out that none of them ...
1
vote
0answers
59 views

Windows 8 C# Compile spritefonts for MonoGame without XNA

Hello Stack Exchange community. Recently, I've been attempting to in some way generate sprite-fonts into XNB files for use with MonoGame. The issue is however, as you may be aware, XNA is very ...
0
votes
0answers
64 views

How to move a field left and right without user input, using ints in xna [migrated]

Well I have this code: Variables: int x; int maxX = 284; //Rectangle Rectangle sourceRect; //Texture Texture2D texture; In the Update() method: if (x++ >= maxX) { x--; //To fix this x -= ...
3
votes
1answer
125 views

Automatic shadow for isometric objects

I have like hunderd of isometric objects. One example: I'm trying to find a way to automate creation of shadow they're casting. I ended up with following transformation: matrix.Shear(-0.25f, ...
0
votes
1answer
160 views

What's wrong with reversing an action like this?

I'm working on an undo and redo system map editor and have come across a major issue. If I place a tile down, move right a tile, and then move back to that tile I previously placed everything works ...
-1
votes
1answer
58 views

Difficulties with zoom point

I want to zoom about an arbitrary zoom point. For example, if the player tabs on a place on his windows phone display, this place(position) should get the new center of his viewport. In addition, the ...
0
votes
1answer
125 views

Correct way to use a GameObject.Find method in Unity C#

I have been following along with a Lynda.com video course to familiarize with Unity. I am currently attempting to grab a reference to a scene's First Person Controller's transform as follows: ...
3
votes
2answers
137 views

Target a specific Entity in a Component-Entity design

I'm starting to work on a game with Entity-Component Model Architecture (Artemis in C#). I'm beginning with something pretty simple, entities which are living things, with HealthComponent, ...
2
votes
1answer
136 views

Monogame crashes without any change

I've written a game in MonoGame, which works great on my desktop computer. It's running Windows 8, has a good graphics card and can be assumed to be up to date with everything. However, when I run on ...
-1
votes
1answer
65 views

Recommended aspect ratio for android / smartphones?

I'm making a game for android and would do it in 720p, but the phones got all different aspect ratios. Also thinking about a ios and windows phone port later. When the aspect ratio does not match, ...
0
votes
2answers
70 views

XNA Multiple Key Input

I'm using the KeyboardState state way (if there are any others) of handling key presses for a PC game. It has been working fine for single key presses but now I am trying to handle multiple key ...
5
votes
2answers
172 views

Where to put Entity Death Events in a Component/System Design

Entities in my game are nothing more than a collection of components, tied together with an entityID. I have (near) data-only components, and systems that work on the data. One of these components is ...
0
votes
1answer
94 views

Large resolution differences

I want to develop a game on multiple devices such as PC, Android or IOS. Want it to be in 1080p, but that means a massive scale down for the smartphones. I know how to do that, just render everything ...
-2
votes
1answer
120 views

Optimization Question about Singleton [closed]

I am using Unity with c#. I have two objects and one needs to call a function from the other which is a Singleton. For this I have two solutions. But what's the best thing to do : - Call for : ...
0
votes
1answer
45 views

2D Collision detection and reaction: Rect to Line

I'm working on a little 2D side scrolling platformer with a couple of friends. The issue I'm having is the level is completely defined by points. They are just a bunch of points which when I read in I ...
4
votes
1answer
79 views

Masking an area inside/outside a line strip

I have some point lights in my game which are just sprites implemented with help of HLSL. Currently I'm trying to implement dynamic shadows and I managed to make the program calculate the area in ...
0
votes
1answer
110 views

Is my social game technical solution viable?

I'm currently working on a board social game using HTML5 (canvas) & Asp.net MVC 4, Azure, Sql server, EF. I'd like to do a server side realtime validation (using Ajax) of a player moves (not more ...
4
votes
4answers
493 views

Face-Click Detection ( like in Minecraft )

I am working on a box-based game engine like minecraft and I was wondering how to detect the "clicked face" when placing blocks. I have created this engine in C++ ( DirectX / D3D ), C# ( XNA ) and ...
1
vote
1answer
66 views

What are some effective methods of documenting packet protocols?

I'm working with a few developers on a hobby project and we have a lot of different APIs. What are some popular methods of creating documentation on the potential requests, and what can be expected to ...
3
votes
2answers
235 views

C# Item system design approach, should I use abstract classes, interfaces or virutals?

I'm working on a Resident Evil 1/2/3/0/Remake type of game. Currently I've done a big part of the inventory system (here's a link if you wanna see my inventory, pretty outdated, added a lot of ...
2
votes
2answers
204 views

How to implement an event system

Im trying to implement an Event System for a game, where there are classes that can fire or handle an event wheter or not they implement these interfaces: public interface IGameEvent<T> where T ...
0
votes
1answer
70 views

How to control in the vertex shader where pixel ends up in the renderTarget?

What if I have an arbitrary renderTarget, that is smaller than the screen (say it is 1x1 pixel) and I want to make sure in the VertexShaderFunction that all my pixels end up exactly in that 1 pixel ...
1
vote
2answers
164 views

Tile Collision & Sliding against tiles

I have a tile based map with a top down camera. My sprite stops moving when he collides with a wall in any of the four directions however I am trying to get the sprite to slide along the wall if more ...
1
vote
1answer
63 views

Jittery Movement, Uncontrollably Rotating + Front of Sprite?

So I've been looking around to try and figure out how I make my sprite face my mouse. So far the sprite moves to where my mouse is by some vector math. Now I'd like it to rotate and face the mouse as ...

1 2 3 4 5 30