Exemplo n.º 1
0
        public void setup()
        {
            LoadConfig(@"configuration/machine.json");
            setup_ball_search();

            this.all_gi_on();

            // Lamp showage
            //this.lampctrl.register_show("attract1", @"lamps\attract1.lampshow");
            this.lampctrl.RegisterShow("attract2", @"lamps/attract2.lampshow");
            //this.lampctrl.register_show("attract3", @"lamps\attract3.lampshow");
            //this.lampctrl.register_show("attract4", @"lamps\attract4.lampshow");

            // Intantiate basic game features
            attract         = new Attract(this);
            _base_game_mode = new BaseGameMode(this);

            string[] trough_switchnames = new string[3] {
                "trough1", "trough2", "trough3"
            };
            trough = new Trough(this,
                                trough_switchnames,
                                "trough1",
                                "trough",
                                new string[] { "leftOutlane", "rightOutlane" },
                                "shooterLane");
            ball_save = new BallSave(this, "ballSave", "shooterLane");

            // Link ball save to trough
            ball_save.allow_multiple_saves    = false;
            trough.ball_save_callback         = new AnonDelayedHandler(ball_save.launch_callback);
            trough.num_balls_to_save          = new GetNumBallsToSaveHandler(ball_save.get_num_balls_to_save);
            ball_save.trough_enable_ball_save = new BallSaveEnable(trough.enable_ball_save);

            this.PROC.initialize_i2c(0x40);

            ServoConfiguration _servoConfig = new ServoConfiguration()
            {
                address = 0x40, minimum = 150, maximum = 600
            };

            this.wall1         = new I2cServo(0, _servoConfig, this.PROC);
            this.wall2         = new I2cServo(1, _servoConfig, this.PROC);
            this.flasherMotor1 = new I2cServo(2, _servoConfig, this.PROC);
            this.flasherMotor2 = new I2cServo(3, _servoConfig, this.PROC);
            this.flasherMotor3 = new I2cServo(4, _servoConfig, this.PROC);
            this.testServo     = new I2cServo(0, _servoConfig, this.PROC);

            if (this.ledDriver != null)
            {
                this.ledDriver.FadeAllToColor(255, 255, 255, 0);
                this.ledDriver.ScheduleAll(0xFFFFFFFF);
            }

            // Instead of resetting everything here as well as when a user initiated reset occurs, do everything in
            // this.reset and call it now and during a user initiated reset
            this.Reset();
        }
Exemplo n.º 2
0
        public void setup()
        {
            LoadConfig(@"configuration\machine.json");
            setup_ball_search();

            this.all_gi_on();

            // Lamp showage
            this.lampctrl.register_show("attract1", @"lamps\attract1.lampshow");
            this.lampctrl.register_show("attract2", @"lamps\attract2.lampshow");
            this.lampctrl.register_show("attract3", @"lamps\attract3.lampshow");
            this.lampctrl.register_show("attract4", @"lamps\attract4.lampshow");

            // Intantiate basic game features
            attract         = new Attract(this);
            _base_game_mode = new BaseGameMode(this);

            string[] trough_switchnames = new string[5] {
                "trough1", "trough2", "trough3", "trough4", "trough5"
            };
            trough = new Trough(this,
                                trough_switchnames,
                                "trough5",
                                "trough",
                                new string[] { "leftOutlane", "rightOutlane" },
                                "shooterLane");
            ball_save = new BallSave(this, "ballSave", "shooterLane");

            claw = new Claw(this);

            // Link ball save to trough
            ball_save.allow_multiple_saves    = false;
            trough.ball_save_callback         = new AnonDelayedHandler(ball_save.launch_callback);
            trough.num_balls_to_save          = new GetNumBallsToSaveHandler(ball_save.get_num_balls_to_save);
            ball_save.trough_enable_ball_save = new BallSaveEnable(trough.enable_ball_save);

            // Instead of resetting everything here as well as when a user initiated reset occurs, do everything in
            // this.reset and call it now and during a user initiated reset
            this.Reset();
        }
Exemplo n.º 3
0
        public void setup()
        {
            LoadConfig(@"configuration\machine.json");
            setup_ball_search();

            this.all_gi_on();

            // Lamp showage
            this.lampctrl.register_show("attract1", @"lamps\attract1.lampshow");
            this.lampctrl.register_show("attract2", @"lamps\attract2.lampshow");
            this.lampctrl.register_show("attract3", @"lamps\attract3.lampshow");
            this.lampctrl.register_show("attract4", @"lamps\attract4.lampshow");

            // Intantiate basic game features
            attract = new Attract(this);
            _base_game_mode = new BaseGameMode(this);

            string[] trough_switchnames = new string[5] { "trough1", "trough2", "trough3", "trough4", "trough5" };
            trough = new Trough(this,
                                trough_switchnames,
                                "trough5",
                                "trough",
                                new string[] { "leftOutlane", "rightOutlane" },
                                "shooterLane");
            ball_save = new BallSave(this, "ballSave", "shooterLane");

            claw = new Claw(this);

            // Link ball save to trough
            ball_save.allow_multiple_saves = false;
            trough.ball_save_callback = new AnonDelayedHandler(ball_save.launch_callback);
            trough.num_balls_to_save = new GetNumBallsToSaveHandler(ball_save.get_num_balls_to_save);
            ball_save.trough_enable_ball_save = new BallSaveEnable(trough.enable_ball_save);

            // Instead of resetting everything here as well as when a user initiated reset occurs, do everything in
            // this.reset and call it now and during a user initiated reset
            this.Reset();
        }