Пример #1
0
        public Ship(AIController ai, GameEnvironment env)
            : base()
        {
            this.ai = ai;
            this.maxSpeed = 50.0f;
            this.maxTurn = 0.025f;

            shooter = new BulletEmitter(env, BulletEmitter.BulletStrength.Medium, IsFriendly());
            env.AddChild(shooter);
        }
Пример #2
0
        private void Initialize(SpawnPoint sp)
        {
            shooter = new BulletEmitter(Environment, this,BulletEmitter.BulletStrength.Strong);
            AddChild(shooter);
            RelativeShooterPos = new Vector2(50.0f, 0.0f);

            ai = m_originalAI = new AIController(sp, Environment);
            LoadTexture(Environment.contentManager, "squaretopia");

            Registration = new Vector2(100.0f, 125.0f);
            CreateCollisionBody(Environment.CollisionWorld, BodyType.Dynamic, CollisionFlags.Default);
            AddCollisionCircle(50.0f, Vector2.Zero);
            CollisionBody.LinearDamping = 8.0f;
            this.health = this.MaxHealth = (int)(this.MaxHealth * 1.5);
            passiveShield = 20.0f;

            shield = new Entity();
            shield.Zindex = 0.0f;
            shield.Registration = new Vector2(125.0f, 115.0f);
            shield.LoadTexture(Environment.contentManager, "shield");
            shield.Position = Position;
            shield.Alpha = 0.0f;
            AddChild(shield);
        }
Пример #3
0
        private void Initialize(SpawnPoint sp)
        {
            shooter = new BulletEmitter(Environment, this, BulletEmitter.BulletStrength.Medium);
            AddChild(shooter);
            RelativeShooterPos = new Vector2(65.0f, -5.0f);

            ai = m_originalAI = new AIController(sp, Environment);
            LoadTexture(Environment.contentManager, "circloid");

            Registration = new Vector2(117.0f, 101.0f);
            CreateCollisionBody(Environment.CollisionWorld, BodyType.Dynamic, CollisionFlags.Default);
            AddCollisionCircle(60.0f, Vector2.Zero);
            CollisionBody.LinearDamping = 8.0f;
            CollisionBody.IgnoreGravity = true; // The circloid will not be affected by its own black hole.
            this.maxSpeed *= 1.25f;
            this.health = this.MaxHealth = (int)(this.MaxHealth * 1.25);
        }