Basics
Guides
API Reference
Basics
Guides
API Reference
[17:7] extends: Component
Wraps FXGL's ProjectileComponent (com.almasb.fxgl.dsl.components.ProjectileComponent), a DSL Component that translates the entity each tick along a Point2D direction at a given speed. Automatically rotates the entity to face the direction of motion (0 degrees assumed to face right).
ProjectileComponent (double Dx = 1.0, double Dy = 0.0, double Speed = 1.0)
Creates a new ProjectileComponent. Pass (Dx, Dy, Speed) to set the initial direction vector and speed; with no arguments uses (1.0, 0.0) facing right at 1.0.
Dx is the X component of the initial direction.Dy is the Y component of the initial direction.Speed is the initial speed in pixels per second.adopt (object Ajo)
Wraps an existing ProjectileComponent AussomJavaObject.
getVelocity ()
Returns the velocity Point2D AJO (direction.normalize() * speed).
getDirection ()
Returns the direction Point2D AJO (velocity.normalize()).
setDirection (double Dx, double Dy)
Sets the direction of motion. The direction vector is normalized internally and scaled by the current speed.
Dx is the X component of the direction.Dy is the Y component of the direction.this objectgetSpeed ()
Returns the current speed (double).
setSpeed (double Speed)
Sets the speed.
Speed is the speed in pixels per second.this objectspeedProperty ()
Returns the DoubleProperty for speed (binding-friendly).
allowRotation (bool AllowRotation)
Enables or disables auto-rotation toward the direction of travel.
AllowRotation true to enable rotation.this object
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.