C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.
0
votes
2answers
38 views
Speeding up sprite the second time it passes the screen [on hold]
I'm a student studying Games Development. I want a sprite to speed up on it's second passing of the screen. How do I do this?
Code I wrote so far:
public class Game1 : Microsoft.Xna.Framework.Game
{
...
1
vote
1answer
38 views
C# XNA Rectangle.Contains returns false?
I am creating a simple XNA game. My mainMenu class contains a list of strings for menu options wich I draw on the scren using spriteBatch.DrawString. I've set Vector2 variables to controll the ...
1
vote
1answer
77 views
How do I add a border to rectangles using a shader?
I want to draw some rectangles with a border. Currently I render the fill with glDrawArrays(Triangles, ...) and the border with glDrawArrays(LineLoop, ...). Is there a neater way?
I'm targeting ...
-4
votes
0answers
42 views
Please recommend any API to write bot on WIndows [on hold]
What API exist to write bots for internet games like Diablo III on windows box.
Where all data exist on remote server.
Ideally if api is written in java. But C# is also OK.
-1
votes
0answers
36 views
World of Tanks Mods [on hold]
Ok, let me just get straight to it. How do I create a World of Tanks Moderation?
I understand that this may be off-topic, but this was the closest Exchange I could for creating a World of Tanks Mods. ...
1
vote
2answers
42 views
Vertex Skinning Looks Messy on Real Android Device using Monodroid
I have no problem doing the "vertex skinning" for three-dimensional animation. All goes well when using the emulator (and genymotion). However, when run on a real device (such as Samsung and Lenovo) ...
0
votes
1answer
31 views
Moving gameobject with animation according to my script Unity3D
I am developing a game with Unity3D with an horizontal list of elements which you can move with arrows. Here you can see an example:
I have created animations in order to modify the alpha value of ...
1
vote
2answers
57 views
How can I make an object change direction?
I have a moving cube that, when it moves over an arrow, should change its direction to the direction of that arrow. What would I need to do in order to accomplish this?
0
votes
0answers
16 views
Unity - 2D - Scaling to fit between two objects
The game is a top down 2d shooter and I'm facing trouble in doing this :
- I got a player 2D ship
- The player fires laser, which is a long thin image with box collider attached.
- What I want is that ...
1
vote
0answers
73 views
Collision detection implementation suggestions
I'm working on a simple 2D game involving a rotating octagonal ring where a sphere sprite moves up/down avoiding objects as the ring rotates faster and faster. I'm having a difficult time with the ...
2
votes
3answers
80 views
Steering behavior using nodes
I've started rewriting some of my code (npcs, navigation and such) and I need some help with my new navigation system.
Basically the way it works is: the game generates a random dungeon. For example:
...
0
votes
2answers
58 views
animation control problem
I have a list of .FBX object.When I drag that .FBX into scene its corresponding inspector Animation component(fig 1) appears but when I drag some other .FBX object into the scene the Animator ...
1
vote
0answers
77 views
Enable IME in a non-windows control
I'm writing my own game in DirectX using C#. I'm at the point where I'm implementing my own textbox, written from scratch. It has the very basic functions for now, but works well. I want, however, to ...
0
votes
1answer
38 views
Shared Material
I have this simple script, so the user touch one of the cubes all cubes with same material will change color.
One of this cubes must have the name of the color on it, only one, so the user touch the ...
1
vote
1answer
48 views
control animation using animator control class
I did a sample existing code to control animation using animation.I dragged and dropped a character into the scene then I added a Animator to it and added the animator controller.Below I have given ...
0
votes
1answer
44 views
Getting a pixel of Sprite at the cursor position in Unity
Summary: I've been trying to figure out a way to use simple box colliders as a nice and efficient "first pass" collider. For the "second pass", I want to check that the area clicked has an alpha value ...
0
votes
2answers
193 views
Water Physics In top down 2D game
I have been making a game like Minecraft or Terraria in which you add blocks and such to the world, and I came across this interesting debacle, the game is in a top down 2D perspective, and I would ...
0
votes
1answer
74 views
Gun Bobbing Algorithm Math Explanation
I stumbled across this really neat algorithm which I don't fully understand. It simulates a camera's bobbing effect commonly witnessed in first person shooters while running/walking. I'm mainly unsure ...
0
votes
2answers
35 views
HLSL Shadow Mapping occurs only around player
I've recently begun playing around with Monogame (OpenSource "remake" of XNA). My current task is to write a simple shadow mapping shader. After following Riemer's XNA Tutorial I got the shadows to ...
2
votes
3answers
118 views
Persistence of Random
Sorry if this is such a simple thing, but for some reason I can't get my head around it.
Imagine you have a world, that you have "seeded" with a value. You base all your randomisations off this ...
0
votes
0answers
44 views
What to put in “Character” class of your casual rpg [closed]
When I tried to make a game project of rpg genere i started with making a Character
class because I thought that this would be the most simple task (i wasn't planning on doing any grahpics, just the ...
-1
votes
0answers
13 views
Problem with custom serializer for a dictionary with shared resources [closed]
This is the my code:
[ContentTypeSerializer]
class SharedResourceDictionarySerializer<TKey,TValue> : ContentTypeSerializer<SharedResourceDictionary<TKey,TValue>>
{
...
0
votes
2answers
79 views
Building a chunk w/ blocks: making ramps. How to detect if blocks are making “stairs” (like in a mountain) and should be turned into ramps?
My question is quite simple, but the answer may be not.
I am studying and making a voxel engine, generating block vertices around its center position with TriangleList primitive at C#/XNA.
The ...
1
vote
1answer
224 views
Unity 4.6 GUI - Dynamically change the functions called by GUI elements
Looking to dynamically change the value in the button OnClick and slider On Value Changed
.
If I had to guess on how this was done, get a reference to the button/gui element. Next get the Button ...
2
votes
2answers
81 views
Multi-colored text and kerning
Drawing multi-colored text or highlighted text in XNA/MonoGame is pretty annoying, and the standard way I've seen to do it is to just to make multiple SpriteBatch.DrawString calls, and place them ...
0
votes
1answer
51 views
Calculating distance travelled
I am working on a road fighter kind of game. The game has its tracks moving to give the effect of car movement. The car accelerates and decelerates as expected with certain keys pressed. But How do I ...
0
votes
1answer
34 views
Depth of overlap between circle and rectangle
I have a circle and a rectangle one of the two objects is moving the other is static. How can I prevent them from overlapping each other? For now there is only one thing that I don't know how to ...
0
votes
0answers
41 views
Casting every received packet as struct?
What is the best performant solution to handle received data from socket, in a MMORPG game? Is it good to have something like:
[StructLayout(LayoutKind.Explicit, Pack = 1)]
public struct LoginPacket
...
-2
votes
1answer
49 views
Not able to destroy the prefab
In the code, everything is working smoothly, only problem I am facing is that the Destroy(fuelprefabInstance) is not getting Destroyed in OnTriggerEnter Method though the print statements are clearly ...
0
votes
1answer
40 views
Destroying the instance that instantiated the prefab
What I have so far:
A fuel that has Fuel script attached to it.
The fuel prefab is first instantiated from another script in its Start() method.
problem:
The Fuel script is such that it results in ...
0
votes
1answer
39 views
The object of type GameObject has been destroyed but you are still trying to access it
I am instantiating the prefabs time to time and I want them to be destroyed with in 2 to seconds as well. But I am getting the error that says:
The object of type GameObject has been destroyed but ...
0
votes
1answer
28 views
Creating a prefab
Problem:
The prefab script is never executed.
What I did:
Created a GameObject
Created a prefab
Dragged GameObject over the prefab
Deleted the GameObject from Scene
Added the prefab script to ...
-1
votes
0answers
20 views
Instanting prefab in a random place and move it along the road
I have a track that is moving to give the effect that the player is moving. Now I want to have a fuel tank which happens to show up at random positions on the track. What I tried so far just sticks to ...
0
votes
1answer
76 views
Multiple tile drawing in monogame is slow
So I have this drawing function (which is by the way recomended as an solution here).
It draws tiles on the whole window with no problem but my game slows down to ~30fps after maximizing it to ...
-1
votes
1answer
37 views
Using multiple strings within the path to Write to Text File [closed]
In Unity3D, How would I use something like this: path = "C:\Users\Jonathan\Documents\FileData" + fileName + ".txt"; so I can make a for loop and create several text files under desired path?
The loop ...
0
votes
0answers
18 views
How to access base class from within subclass? [migrated]
I have an abstract class called BaseMonster. This "base" class holds several values, such as float dyingTime =2, that will be the same for all monster subclasses. But since there are a lot of values ...
0
votes
1answer
73 views
Unity 2D, C# - Make object move diagonally by a certain angle?
I have a sprite object which I want to move in 8 directions. Left, Right, Up, Down, Left top, Right top, Left down, Right down. The view is 2D with a isometric projection. The difficulties I am ...
0
votes
2answers
43 views
Performance Difference Between Content.Load and Texture.FromStream xna
Is there any performance difference between Texture2Ds loaded using the content pipeline and Texture2Ds loaded using Texture2D.FromStream()?
-1
votes
1answer
33 views
Moving an object continuously when left or right key is pressed
I want the object to move continuously as long as key is pressed to left when left arrow is pressed and to right when right arrow is pressed.
Instead of moving continuously it moves first time and ...
0
votes
1answer
30 views
Incosistent jump, stuttering
I've written this C# code to handle movement in my testing project. The game is supposed to be 2D, some kind of a platformer, just to get me started with Unity. However, it seems there's something odd ...
2
votes
1answer
57 views
Wall-sliding Collision Response Only Works On One Axis (2D)
"sprite" is the player object, velocity is a Vec2 that tracks movement (is set to -1, 1, or 0 at any given time), each sprite in "sprites" is a wall of the same size as the player (everyone is a block ...
1
vote
0answers
64 views
How to use an A* Pathfinding System across uneven environments?
I am developing a game in Unity3D. I want an enemy character to follow the player around. The problem is, my surface is uneven and full of mountains. I am using aarongranberg's pathfinding project. ...
-1
votes
2answers
74 views
how would I go on about making a movement system like mario party
main question
how would i go about getting a movement system similar to the one they have on mario party only minus the dice roll
things i have researched
so I have been studying the uses for ...
0
votes
2answers
34 views
Monobehaviour can not find a member OfType in Unity
This is the line where I am getting above mentioned error:
var listeners = FindObjectOfType<MonoBehaviour> ().OfType<iPlayerRespawnListener> ();
I have already imported these libraries ...
3
votes
4answers
237 views
RPG like hit points growth algorithms help
I am currently making an XNA game in C#. I want to increase health as the player level up. I am currently using this equation.
MaxHealth = Convert.ToInt32(100 * Math.Pow(1.17, level - 1));
Its ...
-1
votes
0answers
76 views
How to fasten the avatar's feet on the ground
I'm developing a Kinect Project using C# and XNA 4.0.Now facing a problem that I couldn't solve.
When the player bends to near side , the avatar's feet are leaving the ground and it is moving like ...
0
votes
1answer
28 views
How to retarget monogame solution vs2012
Im currently having a bit of trouble testing my multiplatform game. It originally started as an android project in monogame has extended to windows 8 and WP8. I'd like to test our the win 8 port, but ...
0
votes
0answers
47 views
How to block Kinect rotation
I'm developing a Kinect Project using C# and XNA 4.0. Now facing a problem that I couldn't solve. When the player turn around himself, the avatar doesn't turn, but its arms and legs are trying to ...
1
vote
3answers
154 views
How to create sprites, programatically without using prefabs?
I have different types of images for different sprites. and i am not certain that how much different sprites(images) i will have to show. So, i gotta create the sprites and apply textures ...
0
votes
1answer
126 views
What is the best type of c# timer to use with a Unity game that uses many timers simultaneously?
I am developing a stand-alone 3d game in Unity that will have anywhere from 1 to 200 timers running simultaneously. There will be a GameObject containing 1 timer. For this game timer durations will ...