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

How should I detect collisions with objects on a “timeline”?

I'd like to replicate this game's mechanic of the player smashing walls with a precise timing to a background rhythm. How should I check when each wall should be broken? Does the player animation use ...
3
votes
5answers
168 views

Can I extract Flash SWF sprite frames to bitmaps?

I want to create the 2D graphics of my game in Flash Studio, but then get all the frames from my SWF movies into C# for further work in Unity3D. I find it easier to create nice smooth animations in ...
0
votes
1answer
102 views

Angled topdown perspective camera for 2.5d game

I have a 2d tile based game created using Unity's 2d tools and orthographic camera: The tiles are created by programmatically generating a mesh, assigning a texture to each pair of triangles, and ...
2
votes
1answer
37 views

Unity refuses to open 2 popup windows

So am am making a unity program, where if you click 2 different objects, 2 different windows are supposed to pop up. To make them, I use private private bool showPopUp = false; private Rect ...
1
vote
0answers
39 views

XNA Library DrawPrimitives throwing primitiveCount error

I downloaded the project from here http://silverlight.bayprince.com/tutorials.php?tutorial=13 and tried adding a new OBJ file with a few thousand vertices listed. The classic teapot works but when I ...
1
vote
0answers
31 views

Monogame render between constraints

I have, in MonoGame, a project for which I require the game to not use the full screen depending on the resolution. The game elements etc all behave as they should (So they bounce off for example ...
0
votes
0answers
47 views

how to add a spotlight effect to my targetenemy code

The current targeting code below changes the color of the enemy with tab button: Target enemy = change color of enemy to 'green' Deselect enemy = change color of enemy to 'blue' (press tab again) ...
1
vote
0answers
51 views

Any easier way to add networking to an XNA game? [closed]

I know that the MSDN has an article on this but I'm not developing for Xbox so I'm not sure if I should use NetworkSession or LocalGamer etc etc because I think they are Xbox only. But I haven't tried ...
1
vote
1answer
116 views

Farseer: How can I create a body with a hole in the middle

I want to create a shape that looks like the black contour in this picture: The shape must be empty in the middle(white surface). The white surface must not be part of the shape, just the black ...
-1
votes
0answers
27 views

Unity 3d: the difference developping in javascript/C#? [duplicate]

What is the difference(strong or weak)? I have asked several programmers, but they told me there is a preference topic.
2
votes
1answer
111 views

Is it more efficient to use an A* algorithm or a line system drawn in pathfinding in C#?

I was recently introduced to the A* algorithm when I asked a friend about making AI/NPC's in video games move to certain points and it sounded very interesting. I am building an FPS and it has AI that ...
2
votes
2answers
136 views

Pathplanning A* Getting stuck in wall

I'm having a problem with my pathplanning. I can plan a path and make my character follow it, that's not a problem but then i plan a path around a wall it takes the shortest way as A* suggests, which ...
1
vote
1answer
93 views

Obstacle Avoidance With Walls in C#

I'm trying to do some obstacle avoidance. Yet somehow something is not going quite well. I've used the book "Programming Game AI by Example" to create a simular function in c# in combination with XNA. ...
2
votes
1answer
66 views

How to subscribe to an event fired from any Instance/Object of type X

I'm currently working on a small game-engine and i'm kinda stuck on finding the right pattern to subscribe to an event fired from any instance of type X.To understand what i'm trying to achieve, here ...
1
vote
1answer
91 views

Trigger for Melee-attack not working

I'm currently trying to add a melee-slash attack to my Sidescroller. For that I decided to to have an invisible box-colliders infront of my character. My idea is to activate it when the attack-key is ...
4
votes
2answers
77 views

What is the most efficient way to work with lip sync/facial expressions in XNA?

I've been searching for an answer forever, but I haven't found one. What options are there for lip sync/facial expressions in video games made with XNA? I have a few models for a game I'm building, ...
1
vote
3answers
111 views

Removing something on Collision?

I have my collision detection code working so how would I tell my HealthPickup to disappear when my Player collides with it? I haven't played around with it yet but I think I may have to somehow ...
1
vote
0answers
79 views

How do I save a screenshot and load it as a texture for use in game?

I have a Unity level that takes a screenshot taken in the previous level and applies it as a material to a Plane, the problem is that it will get stuck and not apply the most recent version of the ...
0
votes
1answer
61 views

Detecting Hitbox Collisions (Rectangle)

So I have some Hitboxes set up on 2 classes, HealthPickup and Player. public static Rectangle Hitbox; public override void Initialize() { Hitbox = new Rectangle(Pos.X, Pos.Y, 32, 32); } That's ...
0
votes
2answers
59 views

Load Prefab to variable

I have my code, for my weapon: using UnityEngine; using System.Collections; public class Arma : MonoBehaviour { public static int municao; GameObject bullet; GUIText texto; // Use ...
1
vote
0answers
93 views

Windows Phone 8.1 emulator for DirectX landscape

July 16, 2014 update: I have converted the SharpDX "MiniCube" sample project to a Universal 8.1 project. It is 100% self-contained. It will demonstrate this issue. There is a "READ ME.txt" file ...
-2
votes
2answers
68 views

C#Script select GameObject

I want to load the prefab instead of the gameobject that is in the screen, my code is this one: using UnityEngine; using System.Collections; public class Arma : MonoBehaviour { public static int ...
1
vote
2answers
88 views

How to Calculate Velocity in a 2D space game

I am currently using screenpos.X = (float)(screenpos.X + velocity * Math.Sin(r)); screenpos.Y = (float)(screenpos.Y - velocity * Math.Cos(r)); For my Movement with r being the Rotation in Radians. ...
1
vote
1answer
80 views

More Precise PathSmoothing

I'm reading a book about AI - Path planning and path smoothing. Yet this book is using c++ code. And i'm coding in c# with the XNA framework. I have a path smoothing working, yet the book says it can ...
0
votes
1answer
47 views

How to modify Game1.cs out of an object it contains? [closed]

Assuming I Have a List<SomeClass> myList; in my Game1-class. It also contains an object of SomeOtherClass otherClass;. How would I modify myList (Add/Remove) out of the otherClass's logic? Or in ...
0
votes
1answer
92 views

Why is my Simplex Noise appearing in four columns?

I'm trying to make a Texture out of Simplex noise, but it keeps appearing like this regardless of how big or small scale is: The following code is used to produce the image's color date: private ...
0
votes
0answers
30 views

Unity3D : Prefab Instancing Issue

I am using latest unity engine and I am having a scripting issue. I create a prefab , added a few scripts to it and I am trying to instantiate a few of those objects like this : GameObject ...
0
votes
1answer
36 views

touch in guiTexture

Before time in my game start. i want there will show a guiTexture.. if i touch this guiTexture, that will hidden and the time game will start. I try to make a script but it doesn't work. I'm a bit ...
1
vote
0answers
17 views

Is it possible to change the position of a Farseer joint tie point?

When I create a revolute joint in Farseer, then there is always a tie point in the center of each of the two bodies. Is it possible to change the position of a tie point? For example: I created a ...
0
votes
0answers
46 views

Particle friction with variable timestep in XNA

Alright, so I'm working on an engine of sorts in XNA (yes, it's deprecated, I know) and I'm implementing my own particle system. I've defined a "ParticleEffect" such that when it's supplied a GameTime ...
2
votes
0answers
56 views

How can I combine multiple bodies into one in Farseer? [closed]

I want to create a windmill in Farseer, but I don't know how to combine the 3 windmill sails bodies to one body. During gameplay, the sails could get destroyed. For example, if another body hits one ...
0
votes
0answers
41 views

hide and show many guiTexture

in the 1 scene there are many guiTexture. So how to write this code ? public class guiTanya : MonoBehaviour { public GUITexture guiA, guiB, guiC, guiD, guiE, guiF; void onMouseDown() { //if i press ...
0
votes
2answers
137 views

Problem with moving player through a secript by a set distance

I am currently trying to add a sort of "dash"-ability to my sidescroller. What I try to do, is to let the player press a key where a simple key-press causes the player to move quickly into one ...
0
votes
1answer
70 views

How can I move bodies in Farseer, using touch input?

The player should be able to move a Farseer body with it's fingers. How can I do that? What is the best way to create a Farseer body for the player's finger so that the player can move other Farseer ...
0
votes
1answer
124 views

Unity Gui from text file templates

I've been banging my head against a wall this past while over how I might create menu's and menu components in unity from text file. I would normally just build my own extended panel/label classes etc ...
1
vote
1answer
111 views

Multithreading issues - Frame skips [closed]

So I am trying to multithread a Voxel engine in C# made with Sharpdx and I am having a few issues: This is the class I have : #region using System.Collections.Concurrent; using ...
1
vote
1answer
119 views

Loading a stream/asset on Android MonoGame without ContentManager

In the game I am developing, I have created a serializable class that generates a .map file for saving and loading levels. In XNA, this works great using the following code: FileStream fileStream = ...
1
vote
1answer
24 views

How can I limit the movement angle of a Farseer joint?

How can I create rectangles in Farseer that behave like the two red rectangles in this video: https://www.youtube.com/watch?v=w0p2y4dRylQ I created an angle joint, but it behaves weird. Should I use ...
1
vote
1answer
132 views

How to compress Unity apk output?

I made a game with Unity but the size of .apk file got so large, it is about 70mb... Is there some way that I can compress my apk file?
0
votes
1answer
35 views

How do I avoid an infinite loop when testing D3D9 occlusion queries in SlimDX?

I'm creating a Managed DirectX 9 application using SlimDX. I'm trying to utilize occlusion queries in order to cull non-visible geometry found in the scene. The problem I'm having relates to SlimDX's ...
1
vote
1answer
103 views

Tile textures on 3D models. HLSL shader code maybe?

I'm making a game in C# with XNA. I'm now applying textures to models. However if I change the scale of the model, the texture stretches with it. How can I make the texture tile over the model instead ...
0
votes
1answer
73 views

Make GuiText responsive

I'm using C# code to make a responsive GuiText. I was abel to make a responsive GuiTexture, but I'm struggling with doing the same for a GuiText. Code for the responsive GuiTexture using ...
0
votes
0answers
46 views

Pixel-Perfect Collision With Rotation

I know how to implement pixel perfect collision, but how would I do this with rotations applied to my sprite?
3
votes
2answers
114 views

GameObject once walked on, gives message using C#?

I'm struggling to figure this code out by myself. I'm able to check if the objects are in the scene, and if they are print a message. I now want the GameObject of tag Zone to display a message to let ...
0
votes
1answer
62 views

Path smoothing while path following

I can't find a nice way to do path smoothing while i'm following a path. I have tried this piece of code but aparently it doesn't work as suspected. The idea of how it should work is: Edge 1 (the ...
1
vote
1answer
57 views

How can I create a seesaw with Farseer Physics Engine?

I want to create a seesaw like in this picture: I created two rectangular bodies, one for the diagonal rectangle and one for the little rectangle in the middle. But I don't know how to connect the ...
0
votes
1answer
44 views

Is it ok to destroy mesh directly from MeshFilter in Unity?

Mesh.Destroy(myGameObject.GetComponent<MeshFilter>()); May it cause any problems or undefined behaviour? (the reason I ask this is that I'm trying to destroy an exiting component which is ...
1
vote
1answer
71 views

Predicted target location [duplicate]

I'm having an issue with calculating the predicted linear angle a projectile needs to move in to intersect a moving enemy ship for my 2D game. I've tried following the document here, but what I've ...
1
vote
1answer
29 views

Predicted target location

I'm having an issue with calculating the predicted linear angle a projectile needs to move in to intersect a moving enemy ship for my 2D game. I've tried following the document here, but what I've ...
0
votes
4answers
166 views

Scripts won't affect clones - Unity3d

I made a script which swaps two game objects on click.But the script won't work because the objects are actualy clones of the original prefab. This is the script (UnityScript): #pragma strict var ...