Search in sources :

Example 1 with Toggle

use of me.wobblyyyy.pathfinder2.utils.Toggle in project Pathfinder2 by Wobblyyyy.

the class ExampleListeners method exampleToggleListeners.

public void exampleToggleListeners() {
    Pathfinder pathfinder = Pathfinder.newSimulatedPathfinder(0.01);
    Toggle toggle = new Toggle();
    // bind the A button to toggling the toggle
    pathfinder.getListenerManager().bind(ListenerMode.CONDITION_NEWLY_MET, this::aButton, b -> b, b -> toggle.toggle());
    while (true) {
        pathfinder.tick();
    }
}
Also used : Pathfinder(me.wobblyyyy.pathfinder2.Pathfinder) Toggle(me.wobblyyyy.pathfinder2.utils.Toggle)

Aggregations

Pathfinder (me.wobblyyyy.pathfinder2.Pathfinder)1 Toggle (me.wobblyyyy.pathfinder2.utils.Toggle)1