use of com.b3dgs.lionengine.game.feature.TransformableModel in project lionengine by b3dgs.
the class UtilAttackable method prepare.
/**
* Create the featurable.
*
* @param featurable The featurable to prepare.
*/
public static void prepare(Featurable featurable) {
final Animator animator = new AnimatorMock();
animator.play(new Animation("test", 1, 1, 1.0, false, false));
featurable.addFeature(new AnimatableModel(animator));
featurable.addFeature(new TransformableModel());
}
use of com.b3dgs.lionengine.game.feature.TransformableModel in project lionengine by b3dgs.
the class CollidableModelTest method createFeaturable.
/**
* Create a featurable test.
*
* @param config The configuration reference.
* @param services The services reference.
* @return The featurable test.
*/
public static FeaturableModel createFeaturable(Media config, Services services) {
final Setup setup = new Setup(config);
final FeaturableModel featurable = new FeaturableModel(services, setup);
final Transformable transformable = featurable.addFeatureAndGet(new TransformableModel(services, setup));
transformable.setLocation(1.0, 2.0);
transformable.setSize(2, 2);
featurable.addFeature(new CollidableModel(services, setup));
return featurable;
}
use of com.b3dgs.lionengine.game.feature.TransformableModel in project lionengine by b3dgs.
the class CollidableFramedModelTest method createFeaturable.
/**
* Create a featurable test.
*
* @param config The configuration reference.
* @param services The services reference.
* @return The featurable test.
*/
public static FeaturableModel createFeaturable(Media config, Services services) {
final Setup setup = new Setup(config);
final FeaturableModel featurable = new FeaturableModel(services, setup);
final Transformable transformable = featurable.addFeatureAndGet(new TransformableModel(services, setup));
transformable.setLocation(1.0, 2.0);
featurable.addFeature(new AnimatableModel(services, setup));
featurable.addFeatureAndGet(new CollidableModel(services, setup));
featurable.addFeature(new CollidableFramedModel(services, setup));
return featurable;
}
use of com.b3dgs.lionengine.game.feature.TransformableModel in project lionengine by b3dgs.
the class UtilLaunchable method createLauncher.
/**
* Create launcher.
*
* @param services The services.
* @param setup The setup.
* @param featurable The featurable.
* @return The extractable.
*/
public static Launcher createLauncher(Services services, Setup setup, Featurable featurable) {
services.add(new Factory(services));
services.add(new Handler(services));
if (!featurable.hasFeature(Transformable.class)) {
featurable.addFeature(new TransformableModel(services, setup));
}
final LauncherModel launcher = new LauncherModel(services, setup);
launcher.prepare(featurable);
launcher.recycle();
launcher.setOffset(1, 2);
launcher.setDelay(100);
return launcher;
}
use of com.b3dgs.lionengine.game.feature.TransformableModel in project lionengine by b3dgs.
the class UtilLaunchable method createLaunchable.
/**
* Create launchable.
*
* @param services The services.
* @param setup The setup.
* @param featurable The featurable.
* @return The launchable.
*/
public static Launchable createLaunchable(Services services, Setup setup, Featurable featurable) {
featurable.addFeature(new TransformableModel(services, setup));
final Launchable launchable = new LaunchableModel(services, setup);
launchable.prepare(featurable);
launchable.setLocation(0.0, 0.0);
launchable.setVector(new Force(0.0, 1.0));
return launchable;
}
Aggregations