use of dev.DeveloperWASDControl in project FXGL by AlmasB.
the class ViewportSample method initGame.
@Override
protected void initGame() {
entityBuilder().view("background.png").buildAndAttach();
var e = entityBuilder().at(150, 150).view(new Rectangle(10, 10, Color.BLUE)).with(new DeveloperWASDControl()).buildAndAttach();
getGameScene().getViewport().setBounds(30, 30, 1600 - 30, 1200 - 30);
getGameScene().getViewport().bindToEntity(e, getAppWidth() / 2, getAppHeight() / 2);
}
use of dev.DeveloperWASDControl in project FXGL by AlmasB.
the class PhysicsSample method initGame.
@Override
protected void initGame() {
FXGL.entityBuilder().type(Type.PLAYER).at(100, 100).bbox(new HitBox(BoundingShape.box(40, 40))).view(new Rectangle(40, 40, Color.BLUE)).collidable().with(new DeveloperWASDControl()).buildAndAttach();
FXGL.entityBuilder().type(Type.ENEMY).at(200, 100).viewWithBBox(new Rectangle(40, 40, Color.RED)).collidable().buildAndAttach();
}
use of dev.DeveloperWASDControl in project FXGL by AlmasB.
the class TimeGameApp method initGame.
@Override
protected void initGame() {
getGameScene().setBackgroundColor(Color.BLACK);
player = spawnRect(Point2D.ZERO);
player.addComponent(new DeveloperWASDControl());
}
Aggregations