Skip to content

Projectile

class Projectile : Entity()
Example
fun shoot(player: Actor, target: Npc, arrow: GraphicDefinition) {
val projectile = Projectile.create(arrow.id, player.tile4.tile, target, delay = 10)
if (World.registerProjectile(projectile)) player.message("You fire an arrow.")
}
fun create(
id: Int,
tile: Tile3,
target: Entity,
startHeight: Int? = null,
endHeight: Int? = null,
steepness: Int? = null,
angle: Int? = null,
delay: Int? = null,
lifespan: Int? = null,
sourceEntity: Entity? = null
): Projectile
fun create(
id: Int,
tile: Tile3,
destination: Tile3,
startHeight: Int? = null,
endHeight: Int? = null,
steepness: Int? = null,
angle: Int? = null,
delay: Int? = null,
lifespan: Int? = null,
sourceEntity: Entity? = null
): Projectile