Examples of BallShooter


Examples of com.grt192.mechanism.partybot.BallShooter

        addMechanism("Ball Shooter", bs);
        addMechanism("Driver Station", ds);
    }

    public void act() {
        BallShooter bs = (BallShooter) getMechanism("Ball Shooter");
        PartyBotDriverStation ds = (PartyBotDriverStation) getMechanism("Driver Station");
        if(ds.isIncSpeedButtonPressed() && !increasing){
            bs.incSpeed();
            System.out.println("Ball Speed "+bs.getSpeed());
            increasing = true;
        }
        increasing = !(!ds.isIncSpeedButtonPressed() && increasing);
        if(ds.isDecSpeedButtonPressed() && !decreasing){
            bs.decSpeed();
            System.out.println("Ball Speed "+bs.getSpeed());
            decreasing = true;
        }
        decreasing = !(!ds.isDecSpeedButtonPressed() && decreasing);
        if (ds.isTimedBallButtonPressed() && !timeShooting) {
            timeShooting = true;
            bs.fire();
            System.out.println("Ball Firing "+bs.getSpeed());
        }
        timeShooting = !(!ds.isTimedBallButtonPressed() && timeShooting);
        if(ds.isContinuousBallButtonPressed() && !continuousShooting) {
            bs.turnOn();
            continuousShooting = true;
        }
        if(!ds.isContinuousBallButtonPressed() && continuousShooting) {
            bs.turnOff();
            continuousShooting = false;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.