Skip to content

Part 6: Clarification on Player AI #42

Description

@00willo

In the tutorial text, you say:

We’ve changed each entity to make use of the Actor class, and used the HostileEnemy AI class for the Orc and the Troll types, while using the BaseAI for our player.

However, the diff and the code currently in the repo has:

player = Actor(
    char="@", color=WHITE, name="Player", ai_cls=HostileEnemy, fighter=Fighter(hp=30, defence=2, power=5)
)

Just confirming, that the ai_cls for the player actor should indeed be set to BaseAI.

But, I was wonder if the ai_cls component should in fact be Optional, as my first though was I'm the AI, and so the AI component should be set to None for the player actor. Though this would also require changing the implementation of the is_alive property on the Actor class.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions