Hot answers tagged

3

To start with, we need to break down what is meant by room or cave. With respect to the 2D array in the problem description, a room is a collection of elements that are 'connected'. For any given starting point, we can identify all the elements of a connected region using a flood fill algorithm. The flood fill algorithm presented below works as follows: tag ...


2

I have been dealing with this problem too. Unfortunately, the Skeleton2D and Bone2D seems to be tools for animators only (it is not a physics object). There is support for 3D ragdoll with PhysicalBone but Godot is lacking in terms of 2D. I had to switch to Unity for my 2D ragdolls. There is a built-in tool for 2D Skeletons and you can make them physical ...


1

You need some kind of coherent noise function, I would recommend go with Perlin or OpenSimplex noise, it is well known algorithm and there many implementation of same functions for different languages: C/C++, C#, Python, Java, JS etc... Basically you just need to use noise function to generate value for x/y coordinate and apply math function on top of that ...


1

Check out the PolygonCollider2D. It allows you to create a collider with any shape you want. Another option which is less flexible but might be more performant in your particular case could be to create a CompositeCollider2D and a Rigidbody2D and then create three child game-objects, each one with a BoxCollider with "Used by Composite" enabled. ...


1

Did you try checking whether you're grounded before applying the horizontal input to the velocity? (You should also be applying your jump hold logic at the same time, not in Update, so held jumps are handled consistently regardless of framerate) void FixedUpdate() { Vector2 newVelocity = rb.velocity; isGrounded = Physics2D.OverlapCircle(feetPos....


1

For this answer, I'm going to assume that the inputs to your biome-selection process are just the elevations (or other measures like temperature/moisture) output from your Perlin noise function. If you're generating your biomes in a different way, be sure to edit your question to walk us through your current generation rules. Perlin noise and similar ...


1

From the content of NextSentence the value of the index will never be over sentences.Length - 1. you have to check that index is equal to sentences.Length - 1 not sentences.Length inside the Update method


1

Let's start with some basics: in this case linear interpolation (and its limitations), using pure colours. Once you're on the right track, you can figure things out from there. First, try to recreate the below image using Mathf.Lerp(), to create a controlled 1D interpolation between two adjacent colours: (expanded vertically so you can see it more clearly) ...


1

I'm thinking of giving the detection method to the player and not the enemy.So instead of allowing 30 enemies to always detect 1 player, I'm thinking of letting one player find 30 enemies that are close to him and call a function to have the enemy chase them depending on the distance from the enemy to the player, i think of using: void EnemyDetection() { ...


Only top voted, non community-wiki answers of a minimum length are eligible