Skip to content

Patrolling Enemy

NebSeniah edited this page Jun 22, 2026 · 6 revisions

System Summary

The patrolling enemy moves back and forth, it harms the player if it makes contact with them.


Connected Systems

Connecting Systems:


Bugs

List of known bugs. Be descriptive but keep it brief!

  • None

Feature List / Breakdown of Features

List of features and descriptions within system.

Feature Name:

  • Enemy moves right and left wherever it spawns in.
  • Property to restrict enemy movement to disable falling, property to increase move speed, property to determine initial direction.

Important Variables

  • moveSpeed: float = Changes the move speed of the enemy.
  • restricted: bool = If it's true, the enemy cannot move onto empty air and will turn around when it would.
  • direction: bool = The initial direction that the enemy moves in, an arrow indicates this for the player to understand.

Important Functions

  • func patrol_behavior() -> void: Moves around the patrolling enemy, changes direction when it hits a wall, additionally if restricted is enabled turns around when it would run off of solid ground. Also checks for collisions with other enemies and bounces back if it hits one.

Future Work / Risks

Future Work:

  1. Raycasts so they interact with slow and bounce tiles

Risks:

  • None

Miscellaneous Notes

A place for miscellaneous notes pertaining to this system.

  • None

Clone this wiki locally