Example #1
0
        public Tile(Screen parent, Vector3 position, String texName, bool collidable)
            : base(((collidable) ? parent.Walls : parent.Tiles), position, new Vector3(TileWidth, TileHeight, 1f), Vector3.Zero)
        {
            base.Initialize();

            // Animations
            _Animations = new AnimationSet();
            _Animations.AddAnimation(new Animation(texName, "Normal", 1, 1, 1.0f));

            if (collidable)
            {
                // Collision settings
                _CollisionType   = CollisionType.Passive;
                _Radius         *= 1.5f;
                _CollisionRadius = _Radius * 0.6f;
                _Shadow          = new ShadowRegion(this, _Position, _Radius);
                _Size.Z          = _Size.X;
            }
            else
            {
                CollisionType = CollisionType.None;
            }

            _EntityClass = texName.Substring(21, (texName.Length - 25));
        }
Example #2
0
        public override string Initialize()
        {
            base.Initialize();

            // Animations
            _Animations = new AnimationSet();
            _Animations.AddAnimation(new Animation("Textures/GUI/TextureListBox01_1x1", "Normal", 1, 1, 1.0f));

            // Settings
            _Depth           = 0.2f;
            _DynamicLighting = false;

            return("TextureBox_GUI");
        }
Example #3
0
        public override string Initialize()
        {
            base.Initialize();

            // Animations
            _Animations = new AnimationSet();
            _Animations.AddAnimation(new Animation("Textures/GUI/Radar01_1x1", "Normal", 1, 1, 1.0f));

            // Settings
            _Depth   = 0.19f;
            _BlipTex = Application.AppReference.Content.Load <Texture2D>("Textures/GUI/Blip01_1x1");

            // Return the name for this class
            return("Radar_GUI");
        }
Example #4
0
        public override string Initialize()
        {
            base.Initialize();

            // Animstions
            _Animations = new AnimationSet();
            _Animations.AddAnimation(new Animation("Textures/Misc/Crosshair01_1x1", "Normal", 1, 1, 8.0f));

            // Settings
            _Depth         = 0.1f;
            _CollisionType = CollisionType.None;

            // Return the name for this class
            return("Crosshair");
        }
Example #5
0
        public override string Initialize()
        {
            base.Initialize();

            // Animations
            _Animations = new AnimationSet();
            _Animations.AddAnimation(new Animation("Textures/GUI/Health03_1x1", "Normal", 1, 1, 1.0f));

            // Settings
            _Depth           = 0.19f;
            _DynamicLighting = false;
            _Font            = Application.AppReference.Content.Load <SpriteFont>(FontName);
            _HPText          = "Loading..";

            return("Health_GUI");
        }
Example #6
0
        /// <summary>
        /// Initializes the entity with the correct settings.
        /// </summary>
        /// <returns>The string name of the entity.</returns>
        public override string Initialize()
        {
            base.Initialize();

            // Animations
            _Animations = new AnimationSet();
            _Animations.AddAnimation(new Animation("Textures/GUI/Health01_1x1", "Normal", 1, 1, 1f));

            // Settings
            _DynamicLighting = false;
            _Depth           = 0.5f;
            _Temporary       = false;
            _Spin            = new Vector3(0f, 0f, 0.1f);
            _CollisionType   = CollisionType.Passive;
            new LightSource(_Parent, this, _Position, new Color(0.15f, 0f, 0f, 1f), 150f, 6.28f, Vector3.Zero);

            return("HealthPack");
        }
Example #7
0
        public override string Initialize()
        {
            base.Initialize();

            // Animations
            _Animations = new AnimationSet();
            _Animations.AddAnimation(new Animation("Textures/Misc/Bullet01_1x1", "Normal", 1, 1, 8.0f));

            // Settings
            _Depth           = 0.82f;
            _CollisionRadius = 3f;
            _CollisionType   = CollisionType.Active;
            _DynamicLighting = false;
            _LifeTime        = BulletLifeTime;
            _Temporary       = true;
            _Speed           = BulletSpeed;
            _Damage          = DamageBase + Application.AppReference.Random.Next(DamageVar);
            _CollisionPeriod = DefaultCollisionPeriod[Application.AppReference.GfxLevel];

            return("Bullet");
        }
Example #8
0
        public override string Initialize()
        {
            base.Initialize();

            // Animations
            _Animations = new AnimationSet();
            Animation normal = new Animation("Textures/Effects/MuzzleFlash01_1x3", "Normal", 1, 3, 20.0f);

            normal.Loop = 1;
            _Animations.AddAnimation(normal);
            _Animations.PlayAnimation("Normal");

            // Settings
            _Depth           = 0.18f;
            _ColourOverlay   = MuzzleColour;
            _LifeTime        = DefaultLifeTime;
            _DynamicLighting = false;
            _Temporary       = true;

            return("MuzzleFlash");
        }