Skip to main content
The Projectile class represents a single in-flight projectile in RollingQuest. You create projectiles by calling LevelSection:createProjectile() with either a ProjectileRequest object or an inline property table. Once created, a Projectile lets you read and write its physics parameters, control its collision behaviour, and hook into fire, explode, and update events. The companion ProjectileRequest class is the recommended way to configure a projectile before launch.

Projectile

Properties

Identity

Transform

Movement

Collision Behaviour

Methods

fire

Launch the projectile. Six overloads give you control over the starting position, rotation, and speed:

explode

Detonate the projectile immediately:

Event callbacks

You can attach Lua functions to three lifecycle events after creation:

ProjectileRequest

ProjectileRequest is a configuration object you build before calling LevelSection:createProjectile(). Using it keeps your creation code readable and gives you access to all properties in one place.

Static Constructor

Three overloads create a new request:

Properties

All ProjectileRequest properties are read/write.

Creating and Firing a Projectile

You create a projectile through the LevelSection object. The example below fires a homing projectile from a side each time the ball rolls onto it:
You can also use the inline table overload for concise one-liners: