Hi all,
Quick update,
Let starts from the issue described last time:
If you are super shape you might notice 19 is not to be found here, so what can we do with this number?
Well we need to create a simple function to handle this, something that will take this 19 and turn it to - 20 for example
But!, how do you know what to do with the number 22? I mean its really close to “down”, 24, but also really close to “diagonal_left_down” that will be 20!
So 20? 24? what should I do?
So we fix this by introducing clusters dictionary:
# Define the clusters of 8 main directions (using the numbers)
var clusters = [
{ "cluster": [31, 0, 1], "main_direction": 0 }, # Cluster for direction 0
{ "cluster": [2, 3, 4, 5], "main_direction": 4 }, # Cluster for direction 45
{ "cluster": [6, 7, 8, 9], "main_direction": 8 }, # Cluster for direction 90
{ "cluster": [10, 11, 12, 13], "main_direction": 12 }, # Cluster for direction 135
{ "cluster": [14, 15, 16, 17], "main_direction": 16 }, # Cluster for direction 180
{ "cluster": [18, 19, 20, 21], "main_direction": 20 }, # Cluster for direction -135
{ "cluster": [22, 23, 24, 25], "main_direction": 24 }, # Cluster for direction -90
{ "cluster": [26, 27, 28, 29], "main_direction": 28 } # Cluster for direction -45
]
Now we have a deterministic solution for this problem.
I’ve also started working on the Enemy AI. As mentioned before, it’s based on a few random numbers to determine if the enemy will start, stop, rotate, attack, etc. It’s shaping up nicely, and I’ll share more details in future blog posts.
I paused the work on the Active Object, for a little POC, an online connection, I wanted to test the online multiplayer Godot offers
It works overall, but it’s still pretty unstable even when doing the test with opening the game in the same PC twice
Stay tuned for more updates!