C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.
2
votes
0answers
1k views
XNA Screen Manager problem with transitions
I'm having issues using the game statemanagement example in the game I am developing.
I have no issues with my first three screens transitioning between one another. I have a main menu screen, a ...
3
votes
1answer
551 views
Character jittering with this tile based collision code
I have been trying to get my collision code working for hours now but with every resource I have tried my character still jitters. First I tried using the platformer sample but my character still ...
1
vote
1answer
898 views
Orbiting a specific point - Orbiting Camera
How would I create a camera that with the mouse, it allows you to orbit around a specifc position, with the camera always facing that point? I would also like it to be able to always be at a constant ...
5
votes
2answers
1k views
Collision Detection, player correction
I am having some problems with collision detection, I have 2 types of objects excluding the player. Tiles and what I call MapObjects. The tiles are all 16x16, where the MapObjects can be any size, but ...
2
votes
1answer
198 views
2D Object 'Targeting' / 'Selecting'
I'm currently working with C# with the XNA framework.
I'm trying to create a list of objects that are individually target-able after they are created and set in a list and displayed on a tile map.
...
3
votes
1answer
362 views
Making particle bounce off a line with friction
So I'm making a game and I need a particle to bounce off a line. I've got this so far:
public static Vector2f Reflect(this Vector2f vec, Vector2f axis) //vec is velocity
{
Vector2f result ...
4
votes
3answers
953 views
Still confused about timesteps in XNA
I have been reading many different posts and articles about timesteps and while I now understand that fixed timesteps are generally considered superior, I'm having a bit of difficulty implementing one ...
1
vote
2answers
455 views
What basic windows form games should I build as a newbie in game development? [closed]
I am a complete newbie in game development. I want to know about some basic games that I can start building with simple algorithms and basic knowledge. I have already made few basic games like ...
2
votes
3answers
727 views
Stuck in an infinite recursion in Minesweeper
I am trying to build a simple minesweeper game. The game gets stuck in an infinite recursion whenever a user clicks on a tile which is not a mine...
I have used the following function code for the ...
8
votes
2answers
2k views
Why use Runge Kutta Integration over Improved Euler Integration?
I was reading these slides (very good by the way!), and if you skip all the way to the end the author compares all the different integrators presented.
In one way or another, they all fall short ...
1
vote
1answer
376 views
Collision detection not working
I realized I put this in the wrong forum, so here it is:
I made a collision detection in the Update() section, and this is the code:
if (player.playerRect.Intersects(turtleRect))
{
...
3
votes
4answers
491 views
Some advice for settling on a map format for a tile game?
I am using XNA 4.0 and am currently working on a simple tile game to pass the time. Basically, I'm using the tried and true method of having numbers refer to tile types, where in 0 would be an empty ...
0
votes
1answer
208 views
Primitive Animation
I am creating a minecraft-like clone and was wondering what is the best way to go about animating a model, for example implementing the following feature: when the player presses the arrow keys, move ...
2
votes
1answer
907 views
Loading textures with SharpDX in Metro
I have converted my C# game from OpenTK (OpenGL) to SharpDX (DirectX) and have it up and running from Visual Studio 2010. I also have it up and running from Visual Studio 11 in Metro, in the Windows 8 ...
2
votes
2answers
371 views
How to store “chunks” of tiles or How to make my implementation work
I asked a previous question about the loading and unload of chunk data and people noted that my way of storing chunks is weird and I was wondering how I would go about doing it properly. @Byte56 ...
7
votes
1answer
3k views
Microsoft XNA Platformer Example, is the Collsion Detection implemented accurately?
The example provided by Microsoft seems as if the collision detection (from what I can see) will have a small error. When the user collides with an Unpassable tile, the depth of the intersection is ...
2
votes
4answers
1k 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 ...
2
votes
3answers
874 views
Tutorials for Managed DirectX development? [closed]
Are there any good tutorials, for someone new to DirectX development? I'd like to use the SharpDX library in a project, but am completely new to this sort of graphics programming. I'm looking for a ...
2
votes
2answers
2k views
Loading and unloading “chunks” of tiles in a 2d tile engine with 2d camera
I am making a 2d tile based game in C# and XNA 4.0. I am having trouble loading and unloading "chunks" of tiles(blocks). The whole world is randomly generated and is infinate on both axis. How would I ...
1
vote
2answers
1k views
C# Console Snake Game, sort of fps problem
I have about 200 lines of code, really simple oop.
When I load the console game (snake), I don't see it running smooth, like fps problems in in games, but I don't understand why, because my files are ...
1
vote
3answers
2k views
3D XNA Tracking Camera
I'm trying to implement a camera that tracks a 3D model in my game. I've taken a look at this MSDN article on creating a 3rd person camera, as well as experimenting on my own; but I don't get the ...
0
votes
0answers
229 views
I want to make a push-up mechanic [closed]
I started to develop a game for windows phone 7. This is the video of the game
So, I want to do a push-up. In the middle of the game you will be able to tap the screen and give an additional force to ...
5
votes
1answer
365 views
XNA Vertex buffer/Index buffer high memory usage?
I've got about 120mb of vertex and indices data, but when I set the data in the vertex and indices buffer it ramps up to about 300mb of memory used, this isn't really acceptable and I don't know why ...
1
vote
2answers
597 views
Transformation order when dealing with Meshes
I have created a player model out of primitive types. To do this I have created a Model class and Component (mesh) class. Each model consists of one or more components my problems start when you have ...
0
votes
0answers
272 views
Difficulty of making a very simple Kinect game [closed]
I am working on a project with a Kinect. I can either do very simple user interaction (have them wave, jump, clap, etc.) or do something a bit more fun. The bit more fun option would be a basic game ...
8
votes
2answers
8k views
C# creating a simple snake game
I was thinking about creating a snake game with C#, so I ran ideas in my head, and some problems came up.
How can I track and output in the correct location the blocks that run after the snake's ...
0
votes
1answer
292 views
flicker when drawing 4 models for the first time
i have some models that i only draw at a certain moment in the game (after some seconds since the game has started). The problem is that in that first second when i start to draw the models, i see a ...
2
votes
1answer
200 views
Implementing IVertexType Interface
In XNA, I have created a new VertexType, called it VertexPositionTextureLight which inherts the IVertexType Interface, but apparently I need to implement the member of VertexDeclartion which I cleary ...
0
votes
0answers
210 views
What languages would be best languages for scripting in Unity? [closed]
My question is what language would be best for scripting in Unity?
I know JavaScript is simple, but powerful. But can JavaScript be used for more 'high-level' programming in Unity.
What are the ...
5
votes
1answer
233 views
Is it possible to reuse the same window in multiple games?
In particular, I'm thinking about C# and XNA, and obviously on Windows. Let's say I have the main game which is a normal XNA game, but at some point I would like to momentarily switch to a mini-game ...
4
votes
4answers
2k views
How to clip cut-off text in a textbox?
I'm writing a textbox class for my XNA game and I'm using SpriteFont to draw the text. It's only a single line textbox so when the text width exceeds the size of the rectangle box, it currently just ...
2
votes
1answer
2k views
Why isn't my sprite being drawn in the correct position in XNA?
Sorry if this has been asked before, but I can't seem to find it here. I'm trying to make an asteroids clone in XNA. I took the Game State Management project and am making new classes for things like ...
1
vote
4answers
419 views
Bad to learn XNA without an amazing foundation on C#? [closed]
I've been going though Head First C#, and enjoying it's style of teaching.
But I'm into this as a hobby for now, and I'm itching to learn more about games, so I've been diving into Learning XNA 4.0 as ...
-1
votes
1answer
950 views
3D Procedural Planet Generation - Resource [closed]
I don't know if the question fits on this site (if it doesn't I'll gladly accept any invitation to move it elsewhere), anyhow, I have found this Really great resource on 3D Procedural Planet ...
0
votes
1answer
374 views
XNA Sprites Not Drawing Correctly
I have a problem through out my current code where certain Texture2D's are not drawing correctly over each other.
For example, at the start I have sprite font being drawn over a background image and ...
1
vote
3answers
709 views
How to integrate game logic in game engines
Recently I'm working on a 2d game engine example in .Net with C#. My main problem is that I can't figure out how I should include the game logic within the game. Currently I have a base engine which ...
2
votes
1answer
393 views
Calculating torque required to turn an object to a target rotation, depending on timestep
The function below works fine, when the timesteps of the physicsengine are short enough for the function to update often. It determinates when the ship(the object) needs to start decelerating to reach ...
3
votes
3answers
1k views
How to access SpriteBatch, Input, and ContentManager from all game screens?
I'm trying to make a Game State Manager and I'm using the Microsoft Game State Management Sample as guidance. However, I want a more simplistic design (no transitions, reflection, or support for ...
4
votes
2answers
1k views
Performance/architectural implications of calling SpriteBatch.Begin/End in many different places?
I notice some code samples only call SpriteBatch.Begin and SpriteBatch.End in the game's main draw method and then draw everything within that method through direct SpriteBatch.Draw calls or indirect ...
1
vote
0answers
138 views
Farseer Physics EndContact events don't fire for all registered delegates
Here's my situation:
I have several objects that contain a body and a fixture. They are set to sensor = true;
atmosphere = BodyFactory.CreateCircle(world, atmosphereRadius / Level.METER_IN_PIXELS, ...
1
vote
1answer
489 views
Xna rotate around world axis?
I want to make it so that either the pitch yaw or roll rotates around the world axis and not the local axis, but I'm not sure how, I've got.
Vector2 mouse_change = new Vector2(mouse_previous.X - ...
1
vote
1answer
1k views
Looking at the mouse position in a top down Unity game?
I'm trying to make a simple top down game where the player looks at wherever the mouse is pointed. The player is only going to rotate on the Y axis.
Here's what I have so far but I can't seem to get ...
0
votes
0answers
758 views
XNA Gaussian blur on SlimDX
I am trying to implement the bloom effect, available in XNA http://create.msdn.com/en-US/education/catalog/sample/bloom, but with SlimDX and directX9.
My problems begin with the gaussian blur, ...
3
votes
5answers
725 views
C#/XNA multiplayer TCG game inside a browser possibe?
I wish to try and create a TCG using C#/XNA that would run inside a web browser. Some of the main game's features would be:
At least 2.5D to imitate the card flipping/shuffling and etc. effects
...
3
votes
3answers
679 views
How to refactor and improve this XNA mouse input code?
Currently I have something like this:
public bool IsLeftMouseButtonDown()
{
return currentMouseState.LeftButton == ButtonState.Pressed && previousMouseSate.LeftButton == ...
1
vote
1answer
286 views
How to prevent 2D camera rotation if it would violate the bounds of the camera?
I'm working on a Camera class and I have a rectangle field named Bounds that determines the bounds of the camera. I have it working for zooming and moving the camera so that the camera cannot exit its ...
2
votes
1answer
515 views
Building different game objects (EG Spells, Items,) for an rpg game
I believe the best way to manage item data would be to use xml?
For spells would the best option be to create a class (EG Fireball) and define all of the parameters inside of that class? Like ...
0
votes
1answer
110 views
InvalidCastException in Farseer's raycasting when trying to use the built-in explosion class?
I'm trying to create an explosion at the point that two entities collide, but whenever explosion.Activate() is called, it causes an InvalidCastException to be thrown in Raycast(), on the line that ...
1
vote
1answer
1k views
SpriteBatch Draw Using Floats with the Destination Rectangle
So I created a nice little isometric tile engine and I have it so that when you scroll with the mouse it changes a variable called scale. Scale is a float and gets passed through the ...
2
votes
1answer
250 views
Should the camera's rotation value be clamped?
I noticed that when writing a camera for my 2D game that the camera rotational value of -6 and 6 is equivalent to 0.
That is, -6 = -12 = -18 = -24 = 6 = 12 = 18 = 24.
I was wondering if it was ...