示例#1
0
        static BulletType()
        {
            WorkerBullet = new BulletType();
            WorkerBullet.Textures = Util.SplitTexture(Game1.Game.Content.Load<Texture2D>("projectile textures/gray ball sheet"), 64, 72);

            RangedNubletBullet = new BulletType();
            RangedNubletBullet.Textures = Util.SplitTexture(Game1.Game.Content.Load<Texture2D>("projectile textures/3 frame fireball"), 32, 29);

            MeleeBullet = new BulletType();
            MeleeBullet.Textures = new Texture2D[1];
            MeleeBullet.Textures[0] = Game1.Game.Content.Load<Texture2D>("boxingglove");
        }
示例#2
0
        public RtsBullet(BulletType type, Unit shooter, RtsObject target, Vector2 position, int size, float speed)
            : base(new Rectangle(0, 0, size, size), new Vector2(speed, speed))
        {
            Type = type;

            /*if (type.Animated)
                animation = new Animation(0, 1 * Rts.GameSpeed, Util.SplitTexture(type.Texture, type.SheetWidth, type.SheetHeight));
            else
                Texture = type.Texture;*/
            if (type.Textures.Length > 1)
                animation = new Animation(0, 10 * Rts.GameSpeed, type.Textures);
            else
                Texture = type.Textures[0];

            this.shooter = shooter;
            this.target = target;
            CenterPoint = position;
            RtsBullets.Add(this);
        }
示例#3
0
        public RtsBullet(BulletType type, Unit shooter, RtsObject target, Vector2 position, int size, float speed)
            : base(new Rectangle(0, 0, size, size), new Vector2(speed, speed))
        {
            Type = type;

            /*if (type.Animated)
             *  animation = new Animation(0, 1 * Rts.GameSpeed, Util.SplitTexture(type.Texture, type.SheetWidth, type.SheetHeight));
             * else
             *  Texture = type.Texture;*/
            if (type.Textures.Length > 1)
            {
                animation = new Animation(0, 10 * Rts.GameSpeed, type.Textures);
            }
            else
            {
                Texture = type.Textures[0];
            }

            this.shooter = shooter;
            this.target  = target;
            CenterPoint  = position;
            RtsBullets.Add(this);
        }