C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.
0
votes
0answers
23 views
Cube chunk via list ToArray()
I've created a list of vertices that I call for each cube made in my array "cubes". When each cube is create, SetUpVertices is called which is a method that stores the 8 vertices of my cube. At the ...
-1
votes
0answers
23 views
Why doesn't my cube hold a position?
I gave up a previous method of creating cubes so I went with a list to hold my cube objects. The list is being populated from an array like so:
#region MAP
float[,] map =
{
...
1
vote
1answer
65 views
Gap in parallaxing background loop
The bug here is that my background kind of offset a bit itself from where it should draw and so I have this line. I have some troubles understanding why I get this bug when I set a speed that is ...
2
votes
1answer
157 views
How can I determine if a cube is adjacent to another cube, and optimize its buffers if so?
I'm trying to optimize the rendering of a collection of cubes, (based on an answer I was given to another question I asked). I understand the logic behind occlusion culling, but I'm having trouble ...
2
votes
1answer
80 views
Frustum culling with third person camera
I have a third person camera that contains two matrices: view and projection, and two Vector3's: camPosition and camTarget. I've read up on frustum culling and it makes it seem easy enough for a first ...
2
votes
0answers
43 views
Export a .FBX file in Unity3D at runtime
What I'm looking to do is be able to export an object as a .FBX at runtime in Unity3D.
I've made a C# script which can export a mesh filter or skinned mesh renderer to a .OBJ file at runtime, but ...
1
vote
1answer
66 views
How do I have an arrow follow different height parabolas depending on how long the player holds down a key?
i'm trying to throw an arrow in my game, but i'm having a hard time trying to realize how to make a good parabola.
What I need:
The more you hold "enter" stronger the arrow goes.
The arrow angle will ...
4
votes
2answers
135 views
Game physics presentation by Richard Lord, some questions
I been implementing (in XNA) the examples in this physics presentation by Richard Lord where he discusses various integration techniques. Bearing in mind that I am a newcomer to game physics (and ...
4
votes
3answers
88 views
Matrix multiplication - Scene Graphs
I wrote a MatrixStack class in C# to use in a SceneGraph. So, to get the world matrix for an object I am suposed to use:
WorldMatrix = ParentWorld * LocalTransform
But, in fact, it only works as ...
-2
votes
0answers
38 views
Leg animation not working
I am making a simple animation in XNA C# of a leg moving. This is the logic code for the thigh. It is meant to swing from 25' to 335'. However instead, it hits a point and then keeps on spinning in ...
4
votes
0answers
141 views
Material System
I'm designing Material/Shader System (target API DX10+ and may be OpenGL3+, now only DX10). I know, there was a lot of topics about this, but i can't find what i need.
I don't want to do some kind of ...
2
votes
2answers
202 views
C# and Unity - Learning to Develop a game by developing the game I want to develop [on hold]
So I am pretty new to C#, I have some python and javascript experience, but nothing substantial.
I have read a lot about C# and Unity and I know they are the tools I want to use.
My question is: ...
-1
votes
3answers
140 views
Optimizing drawing of cubes
After googling for hours I've come to a few conclusions, I need to either rewrite my whole cube class, or figure out how to use hardware instancing. I can draw up to 2500 cubes with little lag, but ...
0
votes
1answer
63 views
Grid Based Lighting in XNA/Monogame
I know that questions like this have been asked many times, but I have not found one exactly like this yes. I have implemented a top-down grid based world in Monogame, and am starting on the lighting ...
0
votes
2answers
30 views
creating bounding box list
I'm trying to create a list of bounding boxes for each cube drawn, so I can use the boxes to intersect with a ray that my mouse position is casting, but I have no idea how. I've created a list that ...
-2
votes
0answers
71 views
How should I make my game? [on hold]
It's probably a quite silly question but how should I make my game? I mean using which tools? I haven't made any game bigger than Sudoku, I was just modding bigger games.
I know Java and I started ...
0
votes
1answer
52 views
How can I load 24-bit audio as SoundEffect?
When I try to load .wav file I get an error:
Audio file *.wav contains 24-bit audio. Only 8-bit and 16-bit audio
data is supported.
Here is my code:
SoundEffect menuSelectionChange = ...
-1
votes
0answers
45 views
Using DayNightController with skyboxes
I've attached the script to a light, and the light behaves properly and everything works well. However, the skybox doesn't change, even though it is supposed to. I've done everything according to the ...
1
vote
3answers
64 views
Creating Multiple Instances of a camera at run time
I'm trying to create a bunch of different game objects from a settings file I'm passing in at run time. I've checked and my game is reading in settings fine. But when I run the program, I get the ...
3
votes
2answers
264 views
How do I take a screenshot and blur it?
I want to take a screenshot of the game when it's running, blur it and draw it on the screen. Could you help me with taking a screenshot and blurring it?
0
votes
1answer
70 views
Move-Cycle generates unintended numbers
I have an image I want to move like it's hovering up and own in a cycle.
For that image I have the Y
float _sMY = 10;
My cycle is this:
if (!_hoveredDown)
{
_sMY -= 0.1f;
}
else
{
_sMY += ...
3
votes
1answer
127 views
Why would a Bounding Sphere and BoundingBox not intersect (when they should)?
I have a bounding sphere and a bounding box that should be intersecting, however, Intersects(...) is returning false. For example, the following returns false:
new BoundingSphere(new Vector3(500, ...
-1
votes
0answers
78 views
Holes on marching cube algorithm (C#) [closed]
I usually don't throw all my code over the internet to say "find the problem please", but since I'm stuck on these 10 lines for 3 full days I thought i'd give it a try.
I'm implementing the marching ...
0
votes
1answer
174 views
+50
Why is Farseer not working in Windows Phone 7/8?
I created a new Windows Phone Game (4.0) project in Visual Studio Express 2012 and added the Farseer project to the solution explorer. But adding a reference to the Farseer project is not working. I ...
0
votes
0answers
32 views
C# Client to PHP server authentication [migrated]
My XNA game needs to connect to my website with a WebRequest to a PHP page that checks the database for the user and checks to see if the password is correct.
I already have a login script that will ...
2
votes
2answers
158 views
Something other than Vertex Welding with Texture Atlas?
What options (in C# with XNA) would there be for texture usage in a procedural generated 3D world made of cubes to increase performance? Yes, it's like Minecraft.
I've been doing a texture atlas and ...
0
votes
1answer
63 views
Getting a 3d mouse position
I've looked at a few tutorials about picking and the method Unproject, so I have an idea of how getting the mouse in 3d space is done. The code I have does display a mouse position, but it is way off ...
2
votes
1answer
50 views
How to determine depth of a pixel perfect collision
I am trying to figure out how to determine the depth of a pixel perfect collision in XNA. I want to know the depth in order to be able to use it in my collision response.
At the moment I have the ...
0
votes
1answer
132 views
Is There an Easy Way to Convert Python/Pygame code into C#?
I am working on a game, sort of like this and I want to convert it to C#, as it is currently written in Python. The reason of this is because I can add features more easily and with less writing in ...
0
votes
0answers
27 views
Error in Pixel-Pixel-Collision [closed]
I have got this pixel-pixel-collision code, but unfortunately, it gives me an error: Index outside range of the array on if (((t1[i] & 0xff000000) > 0) && (t2[i] == 0xffC3C3C3)) inside ...
0
votes
1answer
202 views
What is the status of Monogame now that XNA has been discontinued?
XNA has officially been discontinued, with support no longer being offered by Microsoft. Does this mean that Monogame has died also? I see that the site still says it is based upon XNA 4. What is the ...
-1
votes
0answers
48 views
Constructors and inheritance [closed]
I have a cube class that contains one constuctor.
Public cube(GraphicsDevice gDevice)
I'm trying to inherit the cube class for my class CubeTypes, but I'm getting the error "cube does not contain a ...
-1
votes
1answer
112 views
Loop through arrays to create a map
I have a 2D array called map which holds the coordinates to my level like this:
float[,] map =
{
{1, 0, 1, 0, 1},
{0, 1, 0, 1, 0},
{1, 0, 1, 0, 1},
{0, 1, 0, 1, 0},
{1, 0, 1, ...
2
votes
1answer
69 views
How I support different display resolutions?
I'm developing a 2D windows phone game. The game should look the same on every windows phone device. But I have no idea what to do so that my game looks great on every display resolution. How can I do ...
0
votes
1answer
56 views
Formula throwing a ball to destination [duplicate]
I am throwing a ball using this:
double v, vx, vy, alpha, t2 = 0;
if (Keyboard.GetState().IsKeyDown(Keys.Up))
{
alpha = MathHelper.ToRadians(60f);
v = ...
-2
votes
0answers
37 views
I cannot find a way to make spawn random? [closed]
Here is my code:
namespace Zombie_Hellfire
{
public class EnemyManager
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
ContentManager Content;
Game1 ...
-1
votes
1answer
139 views
Is this a efficient implementation of a pool?
This is how I realized a pool, to prevent stutters during gameplay.
I load everything I will probably need during runtime upfront, and take each model
I need from the pool during runtime. Now, my ...
1
vote
1answer
51 views
MonoGame WP custom vertex decleration
How do I go about implementing and using a custom vertex deceleration in monogame for windows phone 8. I want to be able to store a position, a colour and a normal?
-2
votes
1answer
73 views
System.Random giving duplicates in runtime [closed]
Normally, when I call this method of mine
public static int Randomize(int min, int max)
{
Random r = new Random();
return r.Next(min, max);
}
I get a completely ...
1
vote
2answers
92 views
Third person camera xna
I'm trying to create a third person camera in my XNA game. I'm able to move the model I have and the camera at the same time, although the camera is not "following" the model. The model moves faster ...
-1
votes
1answer
56 views
Problems when randomizing x and y position of a picturebox [closed]
So, I'm making a simple game. It's like snake but the picturebox doesn't grow. In the game, you have to get fruits and other objects.
Look at berry's code:
public class Berry : PictureBox
{
...
2
votes
1answer
93 views
Shadowmapping theory question
I think im on good way to grasp the complete concept of simple hard-edged shadowmapping!
The thing i find the hardest to grasp though is about the individual shadow-render for each light...
Since the ...
0
votes
0answers
49 views
Drawing one texture with different Color fps issue
I'm trying to change texture color by aplying mask, which is exactly the same texture but with changed color and alpha < 150.
I'm doing smth like this:
spriteBatch.Begin();
spriteBatch.Draw(pic, ...
1
vote
2answers
64 views
SpriteBatch does not draw on graphicDevice
I'm using a control which is using XNA inside.
But when I try to draw something, it doesn't appear.
I already did a lot of tests but can't figure out what's wrong.
Here is the test I set up:
...
0
votes
1answer
87 views
Collision Resolution: Objects “swap” places
I am working on making my own simple collision resolution class so I can learn a bit about how it works, while also improving my entity-component model framework. For those of you unfamiliar with a ...
1
vote
2answers
71 views
XNA Using velocity
Previously when making games I have just been using a Vector2 as the sprites position and altering that for movement, i.e.:
if(right key pressed)
Position.X += movementspeed * gametime...;
...
2
votes
1answer
36 views
How to get max viewable X-Value in Viewport
How can I calculate or get the farthest X-Value of a Viewport during gameplay?
Say a model is moving in from the right-hand side (beyond Viewport) and starting from a certain X-Value it is visible on ...
1
vote
1answer
57 views
Ignore specific key press in textbox
there is a text box on GUI in my application created using Unity3D. in the textbox user can input only the keys of "A-Z", "0-9" , "enter key" , "." and "," other key press should be ignored (not ...
1
vote
1answer
54 views
Change animation speed of a 3D model
I am working on a small simulator. There is a 3D character on the screen and it randomly plays an animation (I used animation.PlayQueued(...) command inside a for loop).
Now I have added a slider ( ...
1
vote
1answer
94 views
Enter Key press event detect from textbox - Unity3D - C#
i am doing a project with Unity3D . in the interface there is a textbox. once user input some text and and press enter key then i want to read the text in text box. so please tell me how to ...