コード例 #1
0
ファイル: Level.cs プロジェクト: D-Eijkelenboom/DP2
 public Level()
 {
     Units = new List<Unit>();
     BehaviourFactory = new BehaviourFactory();
     MoveContainer = new MoveContainer();
     DrawContainer = new DrawContainer();
     Difficulty = 0;
 }
コード例 #2
0
ファイル: Unit.cs プロジェクト: D-Eijkelenboom/DP2
        public Unit(MoveContainer moveContainer, DrawContainer drawContainer, BehaviourFactory behaviourFactory)
        {
            MoveContainer = moveContainer;
            MoveBehaviour moveBehaviour = behaviourFactory.CreateMoveBehaviour(this);
            MoveContainer.Add(moveBehaviour);

            DrawContainer = drawContainer;
            DrawBehaviour drawBehaviour = behaviourFactory.CreateDrawBehaviour(this);
            DrawContainer.Add(drawBehaviour);
        }
コード例 #3
0
ファイル: DuckEasy.cs プロジェクト: D-Eijkelenboom/DP2
        public DuckEasy(MoveContainer moveContainer, DrawContainer drawContainer, BehaviourFactory behaviourFactory)
            : base(moveContainer, drawContainer, behaviourFactory)
        {
            Width = Properties.Settings.Default.EasyDuckWidth;
            Height = Properties.Settings.Default.EasyDuckHeight;

            Random rnd = new Random();
            X = rnd.Next(Width, Properties.Settings.Default.ScreenWidth - Width);
            Y = rnd.Next(Height, Properties.Settings.Default.ScreenHeight - Height);

            Vx = Properties.Settings.Default.EasyDuckvX;
            Vy = Properties.Settings.Default.EasyDuckvY;
        }