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
1answer
124 views

How can I use a Texture2D larger than 2048 x 2048?

I'm having issues working with a large image. I've read other threads on using images larger than a Texture2D supports, but found nothing that addresses my problem specifically with implementation ...
4
votes
1answer
108 views

How to debug DXGI_ERROR_INVALID_CALL errors?

I am developping an application using SharpDX and on one of my machines the call _swapChain = new SwapChain(factory, _device, desc); fails with the error message HRESULT: [0x887A0001], Module: ...
0
votes
1answer
85 views

Looking for XNA patterns [closed]

Hello mature game developers. Im just started with XNA, but i got solid expirence with C#. I wonder is there any common code patterns for XNA games? Like should i make classes wich handle draw and ...
1
vote
1answer
128 views

How can I manually control the lifetime of actor objects in C#?

I have the following Actor and Scene classes : public class Actor { string name; vec3 position; quat rotation; public void Update() { ... } public void ...
0
votes
0answers
45 views

Calculating intersection of line segment with view frustum

I want to calculate the intersection of a line segment with the view frustum. Here's what I tried so far. The code works perfectly when the look direction vector is orthogonal to the line. E.g. ...
1
vote
1answer
134 views

GameTime Replacement / Wrapper for Pausing , Slow-mo and 'Fast-mo'

I'm looking to change the way in which my game uses GameTime to run the game so that I can easily pause the game (elapsedTime = 0) or change how slow/fast the in game elements interact as a scaler of ...
3
votes
1answer
89 views

Cubic bezier for easing?

I would like to find out what Y is if X is a certain number from a cubic bezier curve to make a custom easing function, like it's done on this site: http://cubic-bezier.com/ Does anyone know a formula ...
2
votes
0answers
124 views

OpenGL drawing 500k triangles [closed]

I want to render big, izometric 2d map (using ortho projection). I am using OpenTK and aiming for OpenGL 3.3. Perfect option would be to draw 512x512 map of tiles, which is 262144 blocks -> 524288 ...
1
vote
0answers
28 views

How to impale and stack targets correctly according to the collider and its coordinate?

I'm making another simple game, a catch game, where a spawning target game object must be captured using a skewer to impale it. Here how: At the start, the falling object (in red) will fall in a ...
1
vote
0answers
79 views

How do i define array in shader's constant buffer with C#?

I am using SharpDX to render 3D graphics and i cannot get to work constant buffer in my shader since it contains an array. Currently it looks like this: cbuffer cb0 : register(b0) { matrix ...
1
vote
0answers
49 views

Precalculating timespan of bullet collision on cubic bezier curve circles?

I'm fairly new to game logics, C#/XNA (The language/library of choice) and bezier curves in general, and is stuck in my current project. I'm going to try to explain as thoroughly as I can what the ...
2
votes
1answer
244 views

How can I play an RTSP video stream in Unity3D?

I want to play an RTSP video stream on a Texture2D. The stream is coming from an IP camera and is encoded with H.264, MJPEG or MPEG4. I know about VLC's libraries, ffmpeg, direct show, media ...
2
votes
1answer
92 views

C# XNA - How to create a menu with bools and textures?

I thought I could use bools to be able to select options in my menu. But the options should be textures. To show that an optino is selected I have 2 textures like this: [----Menu Screen----] [ > ...
0
votes
1answer
151 views

How to play a video on a TV model inside a game?

I am new to Unity3D. I need to know how can I play news when I switch on a TV using any scripting language in Unity3D ?
0
votes
1answer
91 views

How do you map a texture to a sphere in Unity using script?

I am looking to map a texture to a sphere inside of Unity using c# (not in the visual editor)? dragging a jpg or other image resource onto the sphere is the effect I am looking for -- but I would ...
1
vote
1answer
57 views

XNA - Prevent Holding of Mouse Button as Part of an Input Handler Game Component

I'm using C# XNA 4.0 Refresh. I'm working to create an InputHandler Game Component for my XNA game to handle all of the keyboard and mouse input. I used SixOfElevens RPG Game Tutorial (Here - ...
1
vote
1answer
106 views

GLSL - std140 uniform block - fields(vec, float, mat4) always 0.0

Ok, First of all, if just use uniforms everthing works like it should. Switching to uniform blocks nothing goes, as all values look like 0.0. I tested this with various if-then-else stuff within the ...
2
votes
0answers
22 views

Xna 4 Model Rotation with inertia not working as expected with variable updates

I am trying to rotate a model with inertia damping with the keyboard. The code works great with a fixed time step but it doesn't behave the same with a variable update frequency. Update method: ...
0
votes
1answer
122 views

How does Raycasting work in XNA Farseer and player collision?

Wanting to know how to figure out if player's bottom is colliding with object so that I could allow the player to jump. I was trying to use OnCollision but was referred to ray-casting, I looked ...
0
votes
1answer
58 views

How to correctly handle multiple Songs in XNA?

I'm working on a (Windows-only) game in XNA, and I have multiple music tracks. I don't want to load them all into memory, but play them on demand. To properly dispose them, I have a separate ...
0
votes
0answers
33 views

How can I measure the weight in Farseer?

I have two different objects(star and rectangle) and I want to measure the entire weight that lies on the balance. How can I do that? Is it possible to know the entire weight that presses on the ...
1
vote
1answer
117 views

Rotating a camera 90 degrees around an object in Unity3D

I've attached this script to the camera and am using it to rotate the camera around an object. It's currently rotating freely but I'd like it rotate 90 degrees smoothly, over 60 frames, when the ...
0
votes
0answers
47 views

Drawing objects that visible on the screen

So I generated a terrain using list's of tiles, and I display it only if its visible on the user screen (if he move's to the right, the tiles that aren't visible wont be drawn, for performance ...
0
votes
1answer
55 views

GLSL/SFML - Only make portion of texture alpha

I'm trying to take a portion of the current texture and turn it to 50% transparent. I send in four values, signifying the rectangle I want to make transparent. It seems every time, however, that ...
2
votes
2answers
289 views

Differences between C# and Javascript for Unity

Apart from the language differences (class-based vs prototypical, strong vs weak typing), what are the differences between using Javascript and using C# when developing games in Unity3D? Is there a ...
1
vote
1answer
31 views

Proper Directional light on multiple models

I've been trying to implement a Directional light into an XNA game I'm working on, but for what ever reason, I cannot seem to get the directional light to be a true directional light. Instead, I am ...
-1
votes
1answer
69 views

Creating an array to manage terrain

I want to create random terrain for my game in XNA but i have a problem: Lets say my game window size is 500X500, so potentially I want an 500 by 500 array right? But here is the problem, my terrain ...
0
votes
3answers
353 views

Lerp problem object teleporting not moving

Hi i just wanna move my object smoothly from one position to another but object disappear and immediately teleport to position where i clicking anyone know whats happen ? if ...
1
vote
1answer
103 views

Where is the error in my perspective projection implementation?

My question is not really a game development question, but since it's based on 3D programming, I thought it would fit best here. I've got a line made out of Point3D objects where the value of x, y, ...
1
vote
2answers
199 views

2D AABBs and resolving multiple collisions

Okay, so this is a problem I've been trying to figure out for quite some time. Mine is a 2D platformer game with a world made up of (usually) immobile tiles and mobile sprites, both of which use AABBs ...
1
vote
3answers
3k views

How to import or “using” a custom class in Unity script?

I have downloaded the JSONObject plugin for parsing JSON in Unity but when I use it in a script I get an error indicating JSONObject cannot be found. My question is how do I use a custom object class ...
0
votes
0answers
179 views

Unity working on wall jump

I have a 2D platformer game and in it I have recently implemented wall jumping, and the way I have it works great. However when one jumps with the character and moves towards the wall one can hold ...
1
vote
2answers
152 views

How can I project a vector on another vector?

I have a generic not normalized Vector3 v1 and I want to calculate its component along another Vector3 v2. I used to normalize the vector I want to be the direction and then multiplying the other ...
0
votes
0answers
68 views

Farseer Player Movement and Collision

I have added a video link for any one who whats to see what the problems are by watching the game. I am trying to create a player movement system and there are small problems that I am running into. ...
2
votes
1answer
86 views

XNA: Non-overlapping shadows

I want to create an effect similar to the following in XNA / MonoGame: There's a background and a semi-transparent shadow consisting of several objects (two circles in this example). However, the ...
4
votes
1answer
253 views

How to store and parse story actions in XML

I been working on a game in Unity that reads its story (Actions, scene descriptions, NPC's, ect...) from an XML and have been wondering there was a better way to store actions based on player data ...
0
votes
1answer
184 views

Problems implementing a 3rd person static camera in Unity3d

I am building a space game that I would like to be controlled in third person. Basically I would like the camera and the ship to remain tied together and remain the same distance from each other but ...
0
votes
1answer
133 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 ...
7
votes
3answers
257 views

How can I handle versioning changes when saving assets?

I've been working on an RPG now for a while and I use two of different serialization techniques. Enemies, Weapons, items are as saved as XML. Maps and events are saved as "controlled binary" (every ...
-1
votes
1answer
53 views

How do I check in which region of a map an object is located?

For example I have a character and two areas A and B, I want to test which area, A or B, my character is on.
0
votes
1answer
139 views

How do I get the mouse position relative to the window, not the whole screen?

I am developing an XNA game. I run it in window mode. I need to handle mouse events, but when I use the Mouse class from Xna.Framework.Input.Mouse, I get the the mouse position on the whole screen. ...
0
votes
1answer
64 views

Optimising a bool spread on a 2D Grid/List

I'm trying to work out a more efficient way of spreading a bool flag across a 2D tilemap, as the way I currently have it setup works, but has to run far too many times to work properly. This isn't a ...
0
votes
1answer
61 views

XNA and HLSL shaders - Instancing using World Matrix array

I have posted this question on StackOverflow and was directed here, so I'll just copy the question: I am attempting to improvise some sort of hardware instancing in my game. I wish to draw multiple ...
2
votes
5answers
2k views

How to make something rotate a certain amount over an exact amount of time

I'm trying to make a plane rotate down a certain amount and 180 degrees horizontally over 2 seconds. Basically I want it to take the plane 1 second to rotate to a horizontal-facing angle, then take ...
0
votes
0answers
63 views

Non-rectangular hitbox methods in XNA

I'm creating a 2D top-down RPG, and many of my buildings/scenery have non-rectangular corners to the textures. Does anyone know a good way to create circular/triangular/polygonal hitboxes, or is too ...
1
vote
1answer
46 views

XNA Textures dissappear when game window is resized

[SOLVED] - See linked post in the P.S. I have a set of Texture2Ds generated in the Load method with this function: Texture Generation: private Texture2D[,] createTextureSet(TileInfo[,] map) { ...
0
votes
1answer
146 views

XNA 2D Camera, zoom into player

My 2D camera follows the character fine without any zooming. However, when I tried adding a zoom feature using the Matrix.CreateScale(), the camera no longer follows the character properly. public ...
1
vote
1answer
179 views

Player Movement Systems

I am working on a project were in class my group of students help produce a video game. We are creating a 2D platformer and was trying to make a pixel based system collision witch fell through. Now I ...
1
vote
1answer
80 views

Scale adaption based on distance to object

I have situation illustrated on image above, name displayed over the player. Text is rendered as 3d rectangle and rotated to face camera as billboard. (I am using this article ...
3
votes
2answers
357 views

How should I design my classes in a game?

I'm stuck for ideas on classes in game programming. This is probably more of an opinion based question. I'm looking for information that is proving hard to find on the internet. Say I have a class ...