Beispiel #1
0
        protected override void AddedToScene()
        {
            base.AddedToScene();

            initPhysics();

            // Use the bounds to layout the positioning of our drawable assets
            var bounds = VisibleBoundsWorldspace;

            // position the label on the center of the screen
            //labelScore.Position = new CCPoint(80, bounds.Size.Height - 16);

            //labelLives.Position = new CCPoint(bounds.Size.Width - 100, bounds.Size.Height - 16);

            _progressTimer.Position = new CCPoint(bounds.Center.X, bounds.Center.Y);
            //_progressTimer.Midpoint = new CCPoint(0.5f, 0.5f);
            //_progressTimer.ReverseDirection = true;

            _cordinatesGenerator = new CordinatesGenerator(bounds);
            animator             = new Animator(_cordinatesGenerator);

            _cordinatesGenerator.SetSquaresCordinates(_squares);

            //_soundButton.Position = new CCPoint(bounds.Size.Width - 90, bounds.Size.Height - 90);
            //_pauseButton.Position = new CCPoint(90, bounds.Size.Height - 90);

            _cordinatesGenerator.SetSoundPosition(_soundButton);
            _cordinatesGenerator.SetPausePosition(_pauseButton);



            var touchListener = new CCEventListenerTouchOneByOne();

            touchListener.IsSwallowTouches = true;
            touchListener.OnTouchBegan     = this.OnTouchesBegan;
            //AddEventListener(touchListener, this);
            AddEventListener(touchListener, _redPlay.Current);
            AddEventListener(touchListener.Copy(), _greenPlay.Current);
            AddEventListener(touchListener.Copy(), _yellowPlay.Current);
            AddEventListener(touchListener.Copy(), _bluePlay.Current);

            FirstRun();
        }
Beispiel #2
0
 public Animator(CordinatesGenerator cordinates)
 {
     _cordinatesGenerator = cordinates;
 }