Esempio n. 1
0
 public RedDuck(MainWindow window, int top, DuckController controller)
     : base(window, top, controller)
 {
     this.window = window;
     this.top = top;
     this.controller = controller;
 }
Esempio n. 2
0
 public GameController(MainWindow window)
 {
     this.window = window;
     levelState = new Level(window);
     levelState.getLevelOne();
     duckController = new DuckController(window, this);
 }
Esempio n. 3
0
        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();
        }
Esempio n. 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);
 }
Esempio n. 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;
 }
Esempio n. 6
0
        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;
        }
Esempio n. 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();
        }
Esempio n. 8
0
 public override Unit CreateInstance(MoveContainer mc, DrawContainer dc, BehaviourFactory bf, MainWindow window)
 {
     return new Duck(mc, dc, bf, window);
 }