Skip to content

Shooting Enemy

NebSeniah edited this page Jul 23, 2026 · 6 revisions

System Summary

The Shooting Enemy fires a projectile in a given direction consistently while in play mode, the projectiles fired damage the player if touched.


Connected Systems

Connecting Systems:


Bugs

  • None

Feature List / Breakdown of Features

Shooting:

  • The enemy fires a projectile in the direction indicated.
  • The enemy can also fire a projectile in a random direction if desired.
  • If the projectile makes contact with the player, it harms them.
  • If the projectile makes contact with a tile, it gets deleted.
  • If the projectile leaves the screen, it gets deleted.
  • If enabled, the player can bounce on projectiles.
  • If enabled, the shooting enemy will have gravity.

Important Variables

  • direction: float = What direction the enemy fires in in degrees, starting on the positive x-axis and moving clockwise.
  • randomDirection: bool = If true, the enemy fires randomly.
  • shotSpeed: float = How fast the projectiles travel.
  • fireRate: float = How fast the enemy fires.
  • gravityOn: bool = If gravity applies to the enemy.
  • projBounce: bool = Whether the projectiles can be bounced on by the player.
  • persistence: bool = If true, the projectiles won't disappear when off screen.
  • alwaysActive: bool = If true, the shooting enemy is always processing to fire and has physics.

Important Functions

  • func shooting_behavior() -> void: Fires the projectile on an interval.
  • func adjust_arrow(angle: float, random: bool) -> void: Changes the enemy's arrow to display to the user how it's firing, also turns the arrow into the question mark icon if random direction is enabled.

Future Work / Risks

Future Work:

  1. Option for toggleable invulnerability on these enemies
  2. Tracking property to have the enemy aim at the player (IN BRANCH TO BE MERGED)
  3. Property to change where the shooting enemy is standing (IN BRANCH TO BE MERGED)

Miscellaneous Notes

  • None

Clone this wiki locally