-
Notifications
You must be signed in to change notification settings - Fork 0
Enemies
Different types of enemies
There are four different types of enemies that are children of the BaseEnemyClass, EnemyPatrol, EnemyFly, EnemyStationary and EnemyShooting. These four enemies pose threat to the player and should be avoided or stomped on during gameplay. Additionally the MovingPlatform is also a child of this class, although it doesn't pose any threat to the player.
Connecting Systems:
Subsystems:
- None
Base Enemy:
- When landed on, the player defeats them and gets a bounce, larger if they're holding jump.
- When run into from another direction, the player takes damage.
- All enemy types have properties that can be adjusted.
- Enemies can have tile interactions toggled typically.
Patrolling Enemy:
- Property Ground Speed: Controls how fast the enemy moves on the ground.
- Property Restricted: Controls if the enemy turns or falls when it would pass over an empty tile.
- Property Facing: Controls which direction the enemy is initially facing.
Shooting Enemy:
- Property Direction: Controls the direction that the enemy is shooting.
- Property Random Direction: Disables direction and makes the enemy fire randomly instead.
- Property Fire Rate: Controls how fast the enemy fires.
- Property Shot Speed: Controls the speed of the projectiles the enemy fires.
- Projectile Bounce: Toggle for allowing the player to jump on projectiles.
- Gravity: Toggle for giving the shooting enemy gravity and allowing for vertical tile interaction.
Flying Enemy:
- Property Flying Speed: Controls the speed the enemy is flying at.
- Property Endpoint: Sets the second point the enemy will fly to and from.
Stationary Enemy:
- Property Gravity: Controls if the enemy has gravity applied or if it hovers, also enabled vertical tile collisions.
- Property Facing: Controls which way the enemy is facing.
Animations:
- All enemies are animated, each with different animations.
- Every enemy has a death animation.
- Stationary enemy has an idle animation.
- Patrolling enemy has a walking animation.
- Shooting enemy has an idle and a shoot animation.
- Flying enemy has a flying animation.
PropertyFile: Resource = The property file that the enemy is drawing it's properties from..
animatedSprites : AnimatedSprite2D = The animated sprite component of the enemy for transitioning between animations.
-
func assign_script(id: String, position: Vector2i) -> void: Assigns the script of the given ID (located in the Resources/Enemies folder) to an enemy at the given position. -
func apply_script(file: Resource) -> void: Applies the effects of the given properties in the file to the enemy, this function is used by finding the enemy at the location specified in the script. -
func apply_gravity(delta: float) -> void: Applies the gravitational forces to the enemies. -
func check_out_of_bounds() -> bool: Checks if the enemy is outside of the bounds of the level. -
func detect_tiles(horizontal: bool = false) -> void: Checks tile collisions under and above, if horizontal is true then it also checks for horizontal collisions. Can collide with bounce and slow tiles.
Future Work:
- Rename class, Enemy doesn't work since MovingPlatform is also a child of it (and that isn't an enemy)
- More enemies?
Risks:
- None
- No Notes
Resources
Known Issues
Future Work
Globals
Managers
- Main Menu Manager
- Master Manager
- Camera Manager
- Hotkey Manager
- Import Export Manager
- Audio Manager
- Animation Manager
- PopUp Manager
UI
Managers
- Editor Manager
- Tile Manager
- Entity Manager
- Icon Manager
- Preview Manager
- Tool Manager
- Asset Manager
- Custom Cursor Manager
Tiles & Entities
- Grid Lines
- Preview Line
- Tiles & Entities
- Enemies
- Patrolling Enemy
- Flying Enemy
- Shooting Enemy
- Stationary Enemy
- Moving Platform
- Property Editing
Asset Swapping
UI
Managers
Player