예제 #1
0
        public Enemy(EnemyType type, Level l)
        {
            this.Type = type;
            Health = 1;
            VelocityModifier = 1.0f;

            InitializeTimer = 0;

            Alpha = 1.0f;
            alphaIncrease = 0.03f;
            level = l;

            DashCooldown = 0;

            Initialized = false;

            TwirlRotation = 0;
            SlowRotation = 0;

            ImprintSpawn = 0;

            Origin = new Vector2(Type.Texture.Width / 2, Type.Texture.Height / 2);

            if (Type.Equals(level.DashEnemy))
            {
                Animation = new Animation(Type.Texture, 40, 0.01f);
                Origin = new Vector2(Animation.FrameWidth / 2, Animation.Texture.Height / 2);
            }

            SpawnAnimation = new Animation(l.EnemySpawnTexture, 200.0f, 0.1f);
            SpawnAlpha = 0.01f;
        }
예제 #2
0
        // Resets the bullet
        public void Reset()
        {
            Acceleration = Vector2.Zero;

            origin = new Vector2(Type.Texture.Width / 2, Type.Texture.Height / 2);
            Alpha = 1.0f;

            Random r = new Random();
            ParticleSpawnTime = 0;
            MaxSpawnTime = (float)(r.Next(50) + 50);

            Timer = 0;
            rotTime = 0;

            Scale = 1.0f;

            BulletColor = Color.White;

            // Creates the animation
            Animation = new Animation(Type.Texture, Type.FrameWidth, Type.FrameRate);
        }