Projectile

Inherits: RigidBody2D < PhysicsBody2D < CollisionObject2D < Node2D < CanvasItem < Node < Object

A shootable element that causes damage to Entity on impact and self-destucts. Can be shot using a ProjectileAttack.

If it hits anything other than an Entity, it will self-destruct without applying damage.

Properties

float

Damage

AudioStreamPlayer2D

Hit_SFX

int

dir

Methods

void

_ready()

void

_physics_process(_delta: float)

void

flip()

bool

timeout()

void

self_destruct(mute: bool = false)

void

launch(force: Vector2)

void

hit(entity: Entity)


Property Descriptions

float Damage 🔗

The damage applied on the Entity hit.


AudioStreamPlayer2D Hit_SFX 🔗

The AudioStreamPlayer2D to play when something is hit.


int dir 🔗

The direction in which the Projectile is being hit.


Method Descriptions

void _ready() 🔗

There is currently no description for this method. Please help us by contributing one!


void _physics_process(_delta: float) 🔗

There is currently no description for this method. Please help us by contributing one!


void flip() 🔗

A function to change the direction (but not the force) of the Projectile.


bool timeout() 🔗

A function to self-destruct if the projectile hasn’t hit something.

Overwrite to use your own custom check.


void self_destruct(mute: bool = false) 🔗

The Self-Destruct sequence. Overwrite to define your own sequence.


void launch(force: Vector2) 🔗

A function to launch the projectile.

Can be overwritten.


void hit(entity: Entity) 🔗

A function that is called when an Entity is hit.