示例#1
0
 public RedDuck(MainWindow window, int top, DuckController controller)
     : base(window, top, controller)
 {
     this.window = window;
     this.top = top;
     this.controller = controller;
 }
示例#2
0
 public GameController(MainWindow window)
 {
     this.window = window;
     levelState = new Level(window);
     levelState.getLevelOne();
     duckController = new DuckController(window, this);
 }
        public GameController(MainWindow window)
        {
            unitFactory = UnitFactory.Instance;
            behaviourFactory = BehaviourFactory.Instance;
            moveContainer = new MoveContainer();
            drawContainer = new DrawContainer();
            units = new ArrayList();
            
            this.window = window;

            timer = new Timer();

            dispatcher = Dispatcher.CurrentDispatcher;

            currentLevel = new BaseLevelState(this); //maak level 1 aan
            currentLevel.NextLevel();

            Crow.AddUnitToFactory();
            Duck.AddUnitToFactory();

            Unit unit1 = unitFactory.CreateUnit("Duck", moveContainer, drawContainer, behaviourFactory, window);
            units.Add(unit1);
            //Thread t = new Thread(new ThreadStart(gameLoop));
            //t.Start();

            Unit unit2 = unitFactory.CreateUnit("Crow", moveContainer, drawContainer, behaviourFactory, window);
            units.Add(unit2);

            t2 = new Thread(new ThreadStart(gameLoop));
            t2.Start();
        }
示例#4
0
 public DuckController(MainWindow window, GameController gameController)
 {
     this.window = window;
     this.gameController = gameController;
     ducks = new ArrayList();
     rnd = new Random();
     dispatcher = Dispatcher.CurrentDispatcher;
     duckFactory = new DuckFactory(window, this);
 }
示例#5
0
 public Level(MainWindow window)
 {
     this.window = window;
     levelOne = new LevelOne(this);
     levelTwo = new LevelTwo(this);
     levelThree = new LevelThree(this);
     bossLevel = new BossLevel(this);
     setLevelState(levelOne);
     dispatcher = Dispatcher.CurrentDispatcher;
 }
示例#6
0
文件: Duck.cs 项目: Bryans91/DuckHunt
        public Duck(MainWindow window, int top, DuckController controller)
        {
            dispatcher = Dispatcher.CurrentDispatcher;
            aliveDuck = new AliveDuck(this);
            shotDuck = new ShotDuck(this);
            deadDuck = new DeadDuck(this);

            this.controller = controller;

            duckState = aliveDuck;
        }
示例#7
0
        public Duck(MoveContainer mc, DrawContainer dc, BehaviourFactory bf, MainWindow window)
            : base(mc, dc, bf, window)
        {
            //rnd = new Random();
            size = 40;
            x = 0;
            y = rnd.Next(26, 300);
            color = Brushes.PowderBlue;
            velocity = 1.0F;
            heading = 1.5F;

            InitUnit();
        }
示例#8
0
 public override Unit CreateInstance(MoveContainer mc, DrawContainer dc, BehaviourFactory bf, MainWindow window)
 {
     return new Duck(mc, dc, bf, window);
 }