GameCore

Getting Started

  • Installation
  • External-Tools
  • Basics
  • How to use GameCore

Tutorials

  • Coroutine
  • Drawing System with Animations
  • NavAgent
  • StateMachine
  • Tilemap 2D

Reference

  • Changelog
  • Code-Reference
GameCore
  • NavAgent
  • View page source

NavAgent

The NavAgent class is used for controlled approximation from one position to another. Ideal for players, enemies and everything that should move.

self.random_destination_position = (random.randint(0, self.core.window_size[0]), random.randint(0, self.core.window_size[1]))
self.agent = NavAgent(
        position=random_position,
        speed=.75
    )
def update(self):
    self.agent.move(destination=self.random_destination_position)
    if self.agent.distance <= 1:
        # destination reached
Previous Next

© Copyright 2024, Niklas Wockenfuß.

Built with Sphinx using a theme provided by Read the Docs.