Пример #1
0
        private void Activity(float frameTimeInSeconds)
        {
            this.frameTimeInSeconds = frameTimeInSeconds;

            if (hasGameEnded == false)
            {
                //new code
                paddleXVerlocity += frameTimeInSeconds * gravityX;
                paddle.PositionX += paddleXVerlocity * frameTimeInSeconds;
                //paddleYVerlocity += frameTimeInSeconds * gravityY;
                //paddle.PositionY += paddleYVerlocity * frameTimeInSeconds;



                paddle.Activity(frameTimeInSeconds);

                foreach (var fruit in fruitList)
                {
                    fruit.Activity(frameTimeInSeconds);
                }

                spawner.Activity(frameTimeInSeconds);

                DebugActivity();

                PerformCollision();
            }
            //cai nay minh viet hay truong hop ma paddle cham vao khung hinh thi dung lai
            PaddleVsBorders(this.paddle);
        }
Пример #2
0
        private void Activity(float frameTime)
        {
            _paddle.Activity(frameTime);

            foreach (var fruit in _fruitsPool.Fruits)
            {
                fruit.Update(frameTime);
            }

            _fruitsPool.Update(frameTime);

            PerformCollision();
        }
Пример #3
0
        private void Activity(float frameTimeInSeconds)
        {
            if (hasGameEnded == false)
            {
                paddle.Activity(frameTimeInSeconds);

                foreach (var fruit in fruitList)
                {
                    fruit.Activity(frameTimeInSeconds);
                }

                spawner.Activity(frameTimeInSeconds);

                DebugActivity();

                PerformCollision();
            }
        }