Beispiel #1
0
        public Player(int id, BrickDispenser brickDispenser, Field field, GameDraw draw)
        {
            this.id             = id;
            this.brickDispenser = brickDispenser;
            this.field          = field;
            this.draw           = draw;

            brick = brickDispenser.NewBrick(); //fixme
            DrawPoints();
        }
Beispiel #2
0
        public AIPlayer(int id, BrickDispenser brickDispenser, Field field, GameDraw draw)
            : base(id, brickDispenser, field, draw)
        {
            cols = Field.FieldMatrix.Cols;
            rows = Field.FieldMatrix.Rows;

            //timer = new System.Windows.Forms.Timer();
            //timer.Interval = 150;
            //timer.Enabled = true;
            //this.timer.Tick += new System.EventHandler(AIMove);
        }
Beispiel #3
0
        public Game(Form form)
        {
            this.form = form;

            field = new Field(cols, rows);

            Graphics canvas = form.CreateGraphics();

            draw = new GameDraw(canvas, field);

            brickDispenser = new BrickDispenser(field, draw);

            //player = new Player(0, brickDispenser, field, draw);
            player = new AIPlayer(0, brickDispenser, field, draw);

            timer            = new System.Windows.Forms.Timer();
            timer.Interval   = 10;
            timer.Enabled    = true;
            this.timer.Tick += new System.EventHandler(MoveStuff);

            draw.Draw(); //fixme
        }