Search in sources :

Example 1 with EffectControl

use of com.almasb.fxgl.entity.control.EffectControl in project FXGL by AlmasB.

the class MarioFactory method newPlayer.

@Spawns("player")
public Entity newPlayer(SpawnData data) {
    PhysicsComponent physics = new PhysicsComponent();
    physics.setBodyType(BodyType.DYNAMIC);
    return Entities.builder().type(MarioType.PLAYER).from(data).bbox(new HitBox(BoundingShape.box(32, 42))).with(physics).with(new CollidableComponent(true)).with(new PlayerControl(), new EffectControl()).build();
}
Also used : HitBox(com.almasb.fxgl.physics.HitBox) PhysicsComponent(com.almasb.fxgl.physics.PhysicsComponent) CollidableComponent(com.almasb.fxgl.entity.component.CollidableComponent) EffectControl(com.almasb.fxgl.entity.control.EffectControl)

Aggregations

CollidableComponent (com.almasb.fxgl.entity.component.CollidableComponent)1 EffectControl (com.almasb.fxgl.entity.control.EffectControl)1 HitBox (com.almasb.fxgl.physics.HitBox)1 PhysicsComponent (com.almasb.fxgl.physics.PhysicsComponent)1