public class LaunchableModel extends TraitModel implements Launchable
The ObjectGame
owner must have the following Trait
:
Constructor and Description |
---|
LaunchableModel()
Create the launchable model.
|
Modifier and Type | Method and Description |
---|---|
void |
launch()
Initiate launch by using the defined vector with
Launchable.setVector(Force) starting at the location defined by
Launchable.setLocation(double, double) . |
void |
prepare(ObjectGame owner,
Services services)
Prepare the trait.
|
void |
setDelay(long time)
Set the delay time before being effectively launched after a call to
Launchable.launch() . |
void |
setLocation(double x,
double y)
Set the launch starting location.
|
void |
setVector(Force force)
Set the vector to use when launched.
|
void |
update(double extrp) |
getOwner
public void prepare(ObjectGame owner, Services services)
Trait
prepare
in interface Trait
prepare
in class TraitModel
owner
- The owner reference.services
- The services reference.public void launch()
Launchable
Launchable.setVector(Force)
starting at the location defined by
Launchable.setLocation(double, double)
.launch
in interface Launchable
public void setLocation(double x, double y)
Launchable
Launchable.launch()
.setLocation
in interface Launchable
x
- The starting horizontal location.y
- The starting vertical location.public void setVector(Force force)
Launchable
Launchable.launch()
.setVector
in interface Launchable
force
- The force to use.public void setDelay(long time)
Launchable
Launchable.launch()
. Must be called before
Launchable.launch()
.setDelay
in interface Launchable
time
- The delay time in millisecond.Copyright © 2016 Byron 3D Games Studio. All rights reserved.