Tag Info

New answers tagged

1

You can always just do a naive approach. Just iterate through all pieces and see if there's a match in any direction, and if you get to the end before any matches are detected, then you have no matches.


1

Have different spritesheets for every weapon-component you load as separate image resources. When you want to draw a character, you first draw the character-sprite, and then the sprites of each weapon-component, one after another. Keep in mind that in some cases it might be necessary for some parts to change the drawing offsets of other parts. You might, ...


2

Here's a technique I experimented with recently. My RenderMonkey prototype shows a section of badlands-style canyon, but the same principle should work in caves. The idea is to start with tiles that are generic, downright boring, with simple predictable edges so they're easy to line up without seams or gaps: These starting tiles could be shapes you've ...


2

Here's another approach to procedural generation that hasn't been explicitly mentioned yet: spline skinning. You can use a version of Hermite Splines (which provide a curve interpolating positions and tangents) to define the curves: when it's time to generate a new segment, just choose a position (roughly in the direction of the previous segment, as bcrist ...


6

There is rarely a "right way" or "wrong way" when it comes to game design. There are many, many ways to solve this problem, but here are a few possible approaches to explore: Constrain the tunnel pieces to both start and end only in certain directions; for instance only along the axes. Then you just have to keep track of the offset from the beginning to ...


2

You could model your cave as a sequence of points, each with an associated size, with lines connecting them. Then treat each point and line as metaballs and metacylinders. This gives you a basic shape for your cave, to which you might want to start adding variation, such as by randomly offsetting vertices.


2

Your question is quite broad and underspecified, so in this answer I'll focus on finding river flows. Within the field of computational geometry there is quite a bit of research on the topic of drainage networks on a terrain. An overview can be found in section 3.5 of this article: Digital Elevation Models: overview and selected algorithms. A useful ...


0

Please note that I'm only giving a rough starting point for an algorithm here. I can't say for sure if it will work, and you'll have to do a bit of legwork to implement this. First, a few quick things: What do you define as "lots of iterations"? The TinyKeep demo you linked does it in around 40-50. Also, given that you are working with something 2D grid ...



Top 50 recent answers are included