Tagged Questions

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
4 views

Yield and loading textures

I have a need to dynamically load textures from the player's filesystem. WWW provides the functionality I need, but I can't get the example code to compile. "yield www" causes my code to not compile. ...
0
votes
1answer
23 views

Loading Song in MonoGame Windows

I cannot load the song into my game. I got error in both templates WindowsDX and WindowsGL. Monogame Develop Build 1252 Both files .wma and .xnb are exist in Content folder and Build Actions are sets ...
0
votes
1answer
40 views

How to cleanly serialize/de serialize a Dictionary whose values are of a derived class using c# newtonsoft json

I am working on and entity component system and I am storing entities as a JSON file. Components are stored in an entity as a Dictionary of components. I am using newtonsoft's JSON library. After ...
0
votes
0answers
19 views

Developing games using Monogame on Windows Phone 8.1 (Visual Studio 2013) [on hold]

I'm new in game programming, as i have never programmed a game before. I want to start developing 2D games on Windows Phone. As i have seen MonoGame is the perfect tool to do this. I also know that ...
0
votes
1answer
24 views

Using RPC's for movement of an object across a network [on hold]

I've been building upon http://www.gamasutra.com/blogs/DarrelCusey/20130221/187128/Unity_Networking_Sample_Using_One_NetworkView.php At the moment when I spawn a sphere on the server it spawns on the ...
0
votes
0answers
48 views

Cards game - Save and reload state

I have developed a card game in c#. When the user left the application, I serialize into a XML file the state of the current game (current playing player, cards of each players, scores...). But, I ...
-1
votes
0answers
35 views

Problem with shooting projectiles at mouse cursor [duplicate]

I'm shooting projectiles from one point to another, first point is near entity, another is mouse position. Problem is I can't make projectile to be shot directly at position where mouse is pointing, ...
0
votes
0answers
23 views

Why am I getting an object reference error trying to use a Texture2D? [on hold]

I am new to programming and trying to make a Rectangle-based strategy game, but I have trouble using Texture2D entities in my classes: class AreaType { public Texture2D Texture; public string ...
1
vote
1answer
51 views

Draw Primitives with Unity 2D

I would like to be able to draw primitives in unity 2d to define my game objects. I have tried the following example: using UnityEngine; using System.Collections; public class ExampleClass : ...
0
votes
0answers
69 views

Programmer/Game Designer [on hold]

So I want to be a programmer but I dont know where to start first. What skills I need. I also was thinking about game design can some one give me some info on that. Thanks!
0
votes
1answer
50 views

Spawning a Sphere and trying to move it [on hold]

I've been trying to build upon a blog post on Gamasutra http://www.gamasutra.com/blogs/DarrelCusey/20130221/187128/Unity_Networking_Sample_Using_One_NetworkView.php In this I would like to spawn a ...
0
votes
0answers
10 views

Monogame. Xml files not included on deployment

We are making a XNA game and porting it with MonoGame. The game works fine on deployment, it finds without a hitch the xml files we need for the content. On publishing however, the files are never ...
0
votes
0answers
46 views

Appropriate AI scripting language for turn based game [on hold]

I am currently making a game based on the mechanics of turn based games such as GamesWorkshop's Warhammer. I have created my game logic for turns and unit types, but I am considering how I should ...
3
votes
1answer
85 views

How do you make specific collisions in Unity?

So I have created a "game" where you are automatically running across platforms and you can jump and land on the top of them. I want to set it where if you collide with the the left and right side of ...
-1
votes
0answers
42 views

How to get into game programming? [on hold]

Ok I know this question is generic but I will narrow it down a bit. So I am a 15 year old and have been wanting to make a game for a long time, and over the last 2 weeks I have really started to learn ...
0
votes
1answer
31 views

Issue implementing proper collision in XNA Game Studio 4.0

I am building a game in XNA 4.0, where a player moves about a 2 dimensional (vertical perspective) map consisting of blocks. My issue is creating proper collision between the payer and the blocks ...
-1
votes
0answers
66 views

3D Game development in Java [closed]

I've searched for 3D Game development in Java and I've came across a few libraries but they don't seem to have good tutorials. I've came across: Java 3D(Good tutorials but I've been told that it ...
0
votes
2answers
45 views

Collisions are not working in Unity [on hold]

For some reason my collisions are not working. This is what the code I have. void OnCollisionEnter2D(Collision2D coll) { if (coll.gameObject.tag == "wall") Debug.Log ("It worked"); } When my ...
-1
votes
1answer
42 views

How to temporarily disable input?

I have made a jump script and I want all input to be ignored when you are in mid air (so that way you don't have infinate jumps). How to do this?
0
votes
2answers
66 views

How do I have a camera follow my object in Unity?

I have an object that automatically moves by itself and I want the main camera to automatically follow it.(Like in games such as geometry dash and jetpack joyride) This is the code for the automatic ...
0
votes
0answers
25 views

Unity 2d make character move perpendicular to ground [closed]

I am trying to make my 2D character move perpendicular to the ground but I am having no luck I need him to be able to jump freely but stay perpendicular to the ground when grounded only.
0
votes
0answers
25 views

C# XNA Weird black line behaviour of sprite animation spriteBatch.Draw()

So I've been making a Space Invaders game in XNA. I have my ship spritesheet (sprites are left-to-right - horizontal). The spritesheet has 6 sprites. Here's my class: playerShip.cs using System; ...
0
votes
2answers
51 views

c# Unity - Matrix output incorrect on vector rotation

I have a input Vector (1,1,0) when I run it through a Unity Matrix4x4 class with a rotation of 90 degrees around the Z axis the output is (-0.9999999,1,0) which is nearly correct but strange. But ...
0
votes
1answer
75 views

How can I allow players to draw decals for their avatar and items?

I want the player to be able to draw a simple symbol, even if it's pixelated black or white, that their character can have on their weapons, armour, forehead or even markers and monuments. How would I ...
0
votes
1answer
30 views

Trigger scene loading in one device from another device using Unity WWW class

I have a master device and client device. I want to load a scene in the client device by pressing a button in the master. My method is, when the button is pressed in the master device, a data is ...
0
votes
0answers
32 views

bool keys 2 players with c# [closed]

I'm working on my project and have a question. I have to make a multiplayer race game. I have to cars that have to race vs eachother, the only problem is that it have to work on one keboard. I can ...
-1
votes
0answers
57 views

Creating a large game over time. need help understanding something [closed]

I don't want to explain the whole thing but I've been wanting to create a game that will grow into something very large meaning it will hold a large amount of game content. The way I can explain it is ...
0
votes
0answers
38 views

Choppy Character Movement Unity 2D [closed]

I am new to game development and have been following a tutorial to get started, it is a flappy bird style game. My main issue at the moment is when tapping the screen to move my character it is ...
2
votes
0answers
38 views

Why is OnCollisionEnter2D called when it's layer's collisions are being ignored?

I'm sure this is down to my lack of understanding of the unity physics system. I'm trying to implement a simple one-way platform for a 2d game and have got stuck on creating a reliable way to let the ...
0
votes
1answer
34 views

Copying a texture's colors to a new texture to create a new sprite

Let mySprite be some .PNG sprite: Texture2D tex = mySprite.texture; Sprite sprite = Sprite.Create(tex, new Rect(0,0,tex.width,tex.height),new Vector2(0.0f,0.0f),1.0f); The resulting sprite can be ...
3
votes
2answers
132 views

Find a position within one radius, but outside other radii

I have an Object A which will attempt to stay within a certain distance of another Object B. I would like Object A to also try to stay outside a certain distance of one or more other Objects R. The ...
0
votes
0answers
31 views

XNA C# - Get original rotation from parent bone transform

I have a 3DS Max made model, exported into FBX and imported into XNA project. The parts I am working with have NOT been rotated in Max (specifically, collision mesh is made of Axiz-Aligned boxes). ...
0
votes
0answers
42 views

How to move vertices of matrix in order to cast a 2d shadow?

I am trying to add shadows to my 2D xna game. Currently I have created a "shadow" using the texture of the caster with a transparent gray color, rotated, and stretched using a matrix. This, though, ...
0
votes
1answer
73 views

Alternative to Update()

Here is my noobish scenario I'm trying to understand: Some class, Terrain: void Start() { ... switch (Type) { case TerrainType.StartPoint: ...
0
votes
1answer
77 views

Why does GameComponent have an Initialize() method?

I'm not sure if this exact question has been asked before, but all I could find were questions about how to work with GameComponent, or why something wasn't working. I understand that you overload ...
0
votes
2answers
68 views

How to write an adjacency algorithm that compares position data?

I have a list of indexed triangles for which I need to generate adjacency data. I've already written a brute force algorithm that creates 3 edge data structures for each triangle and then compares the ...
0
votes
0answers
19 views

XNA: Does the position of mouseState matter? [migrated]

In order to get a single click response from MouseState, I use this line. currentMouseState.LeftButton == ButtonState.Pressed && oldMouseState.LeftButton == ButtonState.Released) And at the ...
0
votes
1answer
50 views

Xna 2d tile culling

I'm trying to make a simple 2d tile engine here, and I've got a problem with getting a proper cells from a tile grid map when I'm trying to cull off tiles which aren't needed to be drawn. I've got a ...
0
votes
1answer
42 views

C# - How to properly play background songs in XNA

So I'm using the game states (enum) to change my game screens. I have 2 songs for main menu and game playing states, respectively. To play songs, I'm using an old code example I saw at MSDN, like ...
-4
votes
1answer
66 views

Move an object based on XML/TXT file [closed]

Let's think I have an file which looks like this: 0 1 2 3 4 5 6 7 8 9 10 11 I want to create a move from this file. For every 1s(mentioned in the file) I want to move the object. Is this ...
1
vote
3answers
196 views

Issues with ECS performance

I'm currently implementing ECS in "classic" sense, as defined by this wonderful post, where we have Entities, Components and Systems. And I'm having a serious (for me) performance issues. They come ...
0
votes
0answers
39 views

How to move rigidbody player to its facing direction with AddForce?

How can I move a rigidbody to its facing direction? I've already tried this: rigidbody.AddForce (transform.forward * v, ForceMode.Acceleration); // v is a public float which gets a new value in ...
0
votes
2answers
73 views

How to make a wait timer?

I am making a mining styled game and am looking to make variables that effect how fast you are able to mine the block. This is the idea I have currently got but it does not wait for the timer to ...
0
votes
2answers
61 views

Incrase framerate in XNA [duplicate]

I'm trying to increase the frame rate of my game from 60FPS to 100 FPS because of reasons. But i can't seem to get it higher than 60 frames. This is the count I'm using. I can slow down the frame rate ...
2
votes
1answer
107 views

Should I bother merging faces in my 3D block-based game?

Okay, so I have a bunch of cubes in a 3d-world. I already implemented face culling, so that when a cube is next to another cube, their touching faces won't be drawn, or even sent to the buffer. ...
2
votes
2answers
609 views

Slow dictionary access with coordinates as keys

I am making a game server and currently I am experiencing a huge performance hit. I have a class Map which holds a Dictionary of the class Tile with each tile having X, Y, and Z coords, some lists, ...
-3
votes
1answer
39 views

Move the Object in y-axis when the timer increases [closed]

I have a model(.Fbx object),I have placed a timer.When the timer starts increasing the model/object should move down(along y axis).
1
vote
1answer
61 views

How to find the 3D object the camera is pointed at

I'm currently developing a 3-dimensional game (the first I've ever done and it's not as hard as I thought it would be!), but I've run into a little bit of a snag. I want to find the current block the ...
3
votes
2answers
185 views

How to calculate left/right oriented angle between two 2D vectors? [duplicate]

I would like to calculate angle between two 2D vectors. Here's a picture of what I'm trying to achieve: I have an obstacle line segment AB and incoming moving PC. If I'm coming from one side C¹D¹ ...
0
votes
1answer
50 views

Calculate needed speed and object's position in Unity3d

So i'm trying to calculate object's future position so my enemy can land to it safely. Idea is that using future postion I can calculate angle and convert it to direction vector and also using ...