Basics
Guides
API Reference
Basics
Guides
API Reference
[19:7] extends: Component
Wraps FXGL's ProjectileWithAccelerationComponent (com.almasb.fxgl.dsl.components.ProjectileWithAccelerationComponent), a DSL Component that translates the entity each tick along a Point2D direction with an additional acceleration vector applied per tick. Automatically rotates the entity to face the direction of motion. Does not extend FXGL's ProjectileComponent.
ProjectileWithAccelerationComponent (double Dx = 1.0, double Dy = 0.0, double Speed = 1.0, double Ax = 0.0, double Ay = 0.0)
Creates a new component with the given initial direction, speed, and optional acceleration. Defaults to (1,0) direction at speed 1.0 and zero acceleration when no arguments are passed.
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.Ax is the X component of the acceleration vector.Ay is the Y component of the acceleration vector.adopt (object Ajo)
Wraps an existing component AussomJavaObject.
getVelocity ()
Returns the velocity Point2D AJO.
getDirection ()
Returns the direction Point2D AJO.
setDirection (double Dx, double Dy)
Sets the direction of motion.
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 objectgetAcceleration ()
Returns the acceleration Point2D AJO.
setAcceleration (double Ax, double Ay)
Sets the acceleration vector.
Ax is the X component.Ay is the Y component.this objectallowRotation (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.