예제 #1
0
        private void init()
        {
            _settings = rootObject.getScript <Settings>();

            _steering.maxVelocity = 3;
            _targetObjects        = rootObject.getScript <TargetableObjects>();
            _targetObjects.add(gameObject, TargetFilters.Player);

            damageParticleEmitter = gameObject.
                                    createScript <ParticleEmitter>();

            damageParticleEmitter.MinEnergy        = 0.25f;
            damageParticleEmitter.MaxEnergy        = 0.5f;
            damageParticleEmitter.Size             = new Vector2(16, 16);
            damageParticleEmitter.RandomScale      = 0.5f;
            damageParticleEmitter.EndSizeScale     = 0.5f;
            damageParticleEmitter.MinRotationSpeed = 0.1f;
            damageParticleEmitter.MaxRotationSpeed = 0.2f;
            damageParticleEmitter.StartColor       = Color.Green;
            damageParticleEmitter.EndColor         = Color.Blue;
            damageParticleEmitter.RandomVelocity   = 1f;
            damageParticleEmitter.Velocity         = 1;

            var file     = "content/textures/streak.png";
            var material = resources.
                           createMaterialFromTexture(file);

            material.SetBlendState(BlendState.Additive);

            damageParticleEmitter.material = material;

            setupEngineEmitter();
        }
예제 #2
0
        private void init()
        {
            if (aroundRadius != 0 && around == Vector2.Zero)
            {
                around = transform.DerivedPosition;
            }

            _targetObjects = rootObject.getScript <TargetableObjects>();
            _targetObjects.add(gameObject, friendlyFilters);

            _ship = gameObject.getScript <Ship>();

            setupEngineEmitter();
        }