Exemple #1
0
        public BDController()
        {
            InitializeComponent();
            model = new BoulderModel();
            aboutbox = new BDAbout();

            levels = createDefaultLevels();

            ShowLevelName();

            //Adding the key to listen to
            keys = new List<KeyDef>();
            keys.Add(new KeyDef(Keys.Up, "↑"));
            keys.Add(new KeyDef(Keys.Down, "↓"));
            keys.Add(new KeyDef(Keys.Left, "←"));
            keys.Add(new KeyDef(Keys.Right, "→"));
            keys.Add(new KeyDef(Keys.Space, "🔫"));

            //Positionning of the panel
            view = new BoulderView(pnlPositionning.Location, pnlPositionning.Width, pnlPositionning.Height, levels[0]);
            this.Controls.Add(view);
            this.watch = Stopwatch.StartNew();
            this.model.LoadLevel(this.levels[0]);
        }
 public virtual bool Replace(BoulderModel model, BoulderEntity entity)
 {
     model.setItem(this.X, this.Y, entity);
     return true;
 }
 public abstract bool Move(BoulderModel model);