Tagged Questions
17
votes
1answer
7k views
Orienting a model to face a target
I have two objects (target and player), both have Position (Vector3) and Rotation (Quaternion). I want the target to rotate and be facing right at the player. The target, when it shoots something ...
14
votes
7answers
15k views
How do you calculate where a ball should go when it bounces off the bar?
I'm trying to wrap my head around this very Hello World-y problem in game development. I've created a TicTacToe game in XNA so I guess the next step would be a breakout clone.
Keep in mind that I ...
6
votes
3answers
3k views
XNA - Static classes from game libraries executing after content pipeline extensions, how to avoid the problem?
Alright, formulated this way I'm sure it sounds obscure, but I'll do my best to describe my problem.
First, let me explain what's wrong with my real source code.
I'm making a platformer, and here ...
8
votes
1answer
4k 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
2answers
3k 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 ...
4
votes
1answer
1k views
Turning a sprite such that it rotates in the direction that's most efficient
I have a sprite that moves from waypoint to waypoint. It turns to face its velocity vector, but not instantly (there's a rotation speed).
The problem I'm having is, from one direction to another, the ...
6
votes
3answers
2k views
Is there a simple way to group two or more sprites, so all of them will be dependent on each other?
I think that this question is very similar to this one, but I'm not sure if the answers are universal.
So, my goal is:
Place two sprites in fixed position, for example player and his eyes
Make ...
12
votes
7answers
7k views
What is a good way to store tilemap data?
I'm developing a 2D platformer with some uni friends. We've based it upon the XNA Platformer Starter Kit which uses .txt files to store the tile map. While this is simple it does not give us enough ...
10
votes
2answers
7k views
How to generate projectiles with the direction of the mouse pointer
I'm experimenting on a small top-down space shooter where the player controls a ship and he can shoot bullets toward the direction of the mouse cursor. My question is how can I shoot the bullets with ...
5
votes
2answers
3k views
How to determine collision direction between two rectangles?
I am trying to figure out how to determine the direction a collision occurs between two rectangles.
One rectangle does not move. The other rectangle has a velocity in any direction. When a collision ...
52
votes
7answers
5k views
What are the dangers of self-teaching game development? [closed]
I am about to embark upon a journey into game development. Following answers to my last question, I will be using C# and XNA.
However, I don't personally know any other game developers and I don't ...
6
votes
1answer
1k views
How to chain actions/animations together and delay their execution?
I'm trying to build a simple game with a number of screens - 'TitleScreen', 'LoadingScreen', 'PlayScreen', 'HighScoreScreen' - each of which has it's own draw & update logic methods, sprites, ...
5
votes
6answers
2k views
Making classes available to others
I'm currently working on a 2D game engine in XNA, and I am very interested in architecture, and how best to let my game objects communicate.
I know a lot of people use a Singleton design but I ...
3
votes
1answer
629 views
How do I make a jumping dolphin rotate realistically?
I want to program a dolphin that jumps and rotates like a real dolphin. Jumping is not the problem, but I don't know how to make the rotation. At the moment, my dolphin rotates a little weird. But I ...
24
votes
6answers
6k views
A way to store potentially infinite 2D map data?
I have a 2D platformer that currently can handle chunks with 100 by 100 tiles, with the chunk coordinates are stored as longs, so this is the only limit of maps (maxlong*maxlong).
All entity positions ...
20
votes
11answers
4k views
XNA development tutorials
Can anybody guide me about where can I get the basic starter tutorials for developing using XNA framework?
17
votes
7answers
16k views
What are some known 2D/3D physics engines for XNA? [closed]
I'm looking for a physics engine to use in an XNA project (2D or 3D). Because it's for XNA, it needs to fulfill some requirements:
Not necessarily free, but close to it is obviously preferred
...
12
votes
4answers
3k views
How can I acheive a smooth 2D lighting effect?
I'm making a 2D tile based game in XNA.
Currently my lightning looks like this.
How can I get it to look like this?
Instead of each block having its own tint, it has a smooth overlay.
I'm assuming ...
2
votes
3answers
2k views
How do I check collision when firing bullet?
I'm currently creating 2D game from top perspective. I'm having problems with bullets. Yes, I currently simulate their movement so user can see them (about 2x ). Moving them with
// this is static
...
11
votes
2answers
6k views
How do I disable texture filtering for sprite scaling in XNA 4.0?
I have a sprite that I'm trying to scale up in XNA, but XNA is applying some sort of texture filtering that smooths it and makes it look ugly. I'd like it to just do pixel doubling instead of ...
8
votes
1answer
6k views
Get position of point on circumference of circle, given an angle?
I would like to know how to get a specific point on the circumference of a circle, given an angle. The diameter of the circle is 1, and the center point of the circle is { X: 0.5, Y: 0.5 }.
16
votes
4answers
1k views
How to colorize certain parts of a model - like RTS games have those team colors?
I am in a need of implementing something we see in RTS games: team colors. Basically, I am looking for a way to colorize certain parts of a model. How would I achieve this? I have no idea where to ...
9
votes
2answers
2k views
Isometric Collision Detection
I am having some issues with trying to detect collision of two isometric tile.
I have tried plotting the lines between each point on the tile and then checking for line intercepts however that didn't ...
4
votes
1answer
3k views
Mouse location is off due to camera
I'm building a top down shooter but I have a little issue with my camera and mouse.
When I add the camera that I use to my game (see here) my mouse pointer seems to be in the wrong location.
When I ...
8
votes
2answers
3k views
How to decompose sprite sheet
I have a lot of spritesheets that are poorly formatted that I want to decompose, or split out into many small images, one for each sprite.
If I can do that, I can use my custom texture packer tool to ...
5
votes
2answers
451 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 ...
9
votes
5answers
4k views
45° Slopes in a Tile based 2D platformer
I want to have simple 45° slopes in my tile based platformer, however I just cant seem to get the algorithm down. Please take a look at the code and video, maybe I'm missing the obvious?
...
3
votes
1answer
2k 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 ...
2
votes
3answers
4k views
In which software do the professional game developers create 3D Model?
I am just thinking about beginning game development in xna c#. However, I don't know (and no tutorial teaches) how do professional game developers create a 3D Model/Scene. How can we create a ...
1
vote
1answer
125 views
How can I use a camera matrix with different resolutions?
I created a little jump'n'run game. The character(Mario) is always the center of the viewport. The game is running correctly if I use the resolution 800x480 pixel. But when I use another ...
1
vote
3answers
221 views
Code to generate a color gradient within a texture using a diagonal line
I want to generate a color gradient between two colors from x1,y1 to x2,y2. I'm unsure how to do this though. I can use Color.Lerp to get all of the color steps, but the problem is that I don't ...
14
votes
9answers
3k views
How should I go about learning XNA? [closed]
I want to start learning how to make games in XNA, but I have no idea where to start! If someone could advise me on what pieces of software I need and some good books or tutorials to look at, that ...
5
votes
2answers
4k views
Quad Tree with a lot of Moving Objects
I have a Quad Tree implementation that is very useful for what I am trying to do. My problem is that when my viewport has a lot of objects, the Update for the Quad Tree takes a very long time.
It ...
6
votes
2answers
2k views
Random World Generation [duplicate]
Possible Duplicate:
How are voxel terrain engines made?
I'm making a game like minecraft (although a different idea) but I need a random world generator for a 1024 block wide and 256 block ...
13
votes
2answers
5k views
How can I implement lighting in a voxel engine?
I am creating the MC like terrain engine, and I have thought that lighting would make it look a whole lot nicer.The problem is that the blocks are not being lit properly when a block which emits light ...
12
votes
6answers
4k views
How can I implement hexagonal tilemap picking in XNA?
I have a hexagon tiled map in which i need to check when a hexagon is clicked. The hexagons aren't actually touching, rather they have a slight gap in between each of them.
Does anyone know how I ...
9
votes
2answers
4k views
Scripting engine for XNA
Say I'm making this big game in C# with XNA.
What options do I have to include a scripting feature to my code base?
6
votes
2answers
4k views
C# Perlin noise - generating “endless” terrain chunks?
I'm currently writing a little side scroller in C#, to both learn C# and have fun. Right now I have a simple random number generator generating the world but it isn't exactly all that great - so with ...
9
votes
2answers
3k views
XNA 2d Camera Scrolling - why use matrix transform?
I am making a test game where I want the level to be constantly scrolling. To create this effect I have established a camera class which simply stores a vector2 position and an enum direction. It also ...
14
votes
1answer
5k views
Creating a 3D map for XNA?
Is anyone aware of a nice 3D map tutorial (how to import and use the map) using XNA without any engine but not limited to an external application (like Tiled for 2D maps) ?
I did a search arund here ...
11
votes
4answers
2k views
How can I design an effective game object interaction scheme with a component-based architecture?
This is a design question... I'm sure this could be generalized more, but I'm having a hard time with it. I am wondering about design for game object interactions - here is my example (2D ...
6
votes
4answers
2k views
Retrieving components from game objects (entities)
Using C# and XNA 4, I've made the decision to go for an entity-component based design for my game after reading such posts as this and this, but I'm now struggling to find how to retrieve components ...
6
votes
3answers
5k views
Efficient Tile-based collision detection for a lot of squares?
currently I am working on my own take of a tile-based game (think Terraria, but less fantastical (I think that's a word? Sorry if it isn't)).
Anyway, I currently have collision detection working ...
11
votes
1answer
2k views
Unit Testing a C#/XNA Game Project
I have been dabling in game development since I started programming, but never very seriously. I work as a business app developer, but I'm working on some games in my spare time.
In the business ...
8
votes
2answers
14k views
Moving a sprite in XNA/C#, using vectors
I'm currently looking into XNA game development with the C# language.
I have two classes: the main game handler and a "sprite" class. Following is some basic pseudo-code which I hope adequately ...
4
votes
2answers
4k views
How to get mouse position relative to the map?
I'm creating a game in XNA similar to Minecraft - Minecraft 2D
It looks like this
Here's how it works:
All blocks are generated once with fixed x,y coordinates and just re-drawn.
//generate ...
3
votes
4answers
2k views
How can I improve my isometric tile-picking algorithm?
I've spent the last few days researching isometric tile-picking algorithms (converting screen-coordinates to tile-coordinates), and have obviously found a lot of the math beyond my grasp.
I have ...
12
votes
3answers
836 views
Biased, conservative random walk
I have a sprite which has Velocity and Position, either stored as Vector2. At each Update cycle, velocity is added to the position.
I would like to give the sprite a third vector, Target. New targets ...
5
votes
4answers
616 views
Debugging tips? [closed]
I'm new to games programming and I'm working on a C#/XNA project.
Something I'm spending a lot of time on is debugging. Obviously as games run in a loop finding the exact iteration that a bad ...
4
votes
1answer
787 views
Rotate entity to match current velocity
I have an entity in 2D space moving around, lerping between waypoints. I would like to make the entity rotate around its own origin to face the current direction that it is going, I.E. towards the ...