Пример #1
0
            public override void Initialize()
            {
                base.Initialize();

                _xGhost = new AsteroidGhost(this, "XGhost");
                _xGhost.Body.Position = GetDependency <Body>(DEPENDENCY_BODY).Position;
                _xGhost.Render.Scale  = GetDependency <Render>(DEPENDENCY_RENDER).Scale;           //Scale is set dymanically by asteroid
                _xGhost.Collision.Exclusions.Add(GetDependency <Collision>(DEPENDENCY_COLLISION)); //Add an exclusion to prevent the ghost from colliding with its original.
                _xGhost.Initialize();

                _yGhost = new AsteroidGhost(this, "YGhost");
                _yGhost.Body.Position = GetDependency <Body>(DEPENDENCY_BODY).Position;
                _yGhost.Render.Scale  = GetDependency <Render>(DEPENDENCY_RENDER).Scale;
                _yGhost.Collision.Exclusions.Add(GetDependency <Collision>(DEPENDENCY_COLLISION));
                _yGhost.Initialize();

                //_cornerGhost = new AsteroidGhost(this, "CornerGhost");
                //_cornerGhost.Body.Position = GetDependency<Body>(DEPENDENCY_BODY).Position;
                //_cornerGhost.Render.Scale = GetDependency<Render>(DEPENDENCY_RENDER).Scale;
                //_cornerGhost.Collision.Exclusions.Add(GetDependency<Collision>(DEPENDENCY_COLLISION));
                //_cornerGhost.Initialize();
            }
            public override void Initialize()
            {
                base.Initialize();

                _xGhost = new AsteroidGhost(this, "XGhost");
                _xGhost.Body.Position = GetDependency<Body>(DEPENDENCY_BODY).Position;
                _xGhost.Render.Scale = GetDependency<Render>(DEPENDENCY_RENDER).Scale; //Scale is set dymanically by asteroid
                _xGhost.Collision.Exclusions.Add(GetDependency<Collision>(DEPENDENCY_COLLISION)); //Add an exclusion to prevent the ghost from colliding with its original.
                _xGhost.Initialize();

                _yGhost = new AsteroidGhost(this, "YGhost");
                _yGhost.Body.Position = GetDependency<Body>(DEPENDENCY_BODY).Position;
                _yGhost.Render.Scale = GetDependency<Render>(DEPENDENCY_RENDER).Scale;
                _yGhost.Collision.Exclusions.Add(GetDependency<Collision>(DEPENDENCY_COLLISION));
                _yGhost.Initialize();

                //_cornerGhost = new AsteroidGhost(this, "CornerGhost");
                //_cornerGhost.Body.Position = GetDependency<Body>(DEPENDENCY_BODY).Position;
                //_cornerGhost.Render.Scale = GetDependency<Render>(DEPENDENCY_RENDER).Scale;
                //_cornerGhost.Collision.Exclusions.Add(GetDependency<Collision>(DEPENDENCY_COLLISION));
                //_cornerGhost.Initialize();
            }