[ad_1]
I’m trying to learn to create a 2D RPG multiplayer game. I try to learn godot by creating a single player game first. However, there’s not much tutorial on creating enemies for multiplayer. The enemy I try to create include three properties:
- Can chase player if any player is in certain range.
- Attack the player if the player is even closer
- Otherwise just roaming around
I’ve try to turn my single player tutorial game by myself to a multiplayer game. The tutorial I follow is:
https://dev.to/christinec_dev/lets-learn-godot-4-by-making-an-rpg-part-11-spawning-enemy-ai-50e
I set a Game Manager(var Players{}) to store my player information and also set a group for my players
What I’ve try is to calculate the closest player and check the distance to decide how the enemy will perform, but it’s doesn’t work for all the enemies I spawned, it’s only work for 1 enemy.
Thank you for understanding my questions and I’m looking forward for any enemy structure suggestions or any tutorial I can follow. Also I’ll provide more information if needed.
[ad_2]