Example #1
0
        public Bang AddBang(Vector2 p, BangType bangType, GameSound gameSound)
        {
            var b = AddBang(p, bangType);

            b.PlaySound(gameSound);
            return(b);
        }
Example #2
0
        /// <summary>
        /// Add bang
        /// </summary>
        /// <param name="p">Position to place the sprite</param>
        /// <param name="bangType">The type of bang to create</param>
        public Bang AddBang(Vector2 p, BangType bangType)
        {
            var b = new Bang(p, bangType);

            this._gameObjectCollection.Add(b);
            return(b);
        }
Example #3
0
 internal ExecuteBangParam(string args)
 {
     this.Options         = new Dictionary <string, string>();
     this.OverrideOptions = new List <Dictionary <string, string> >();
     this.Commands        = new List <string>();
     this.Command         = args.Trim();
     this.DismissAction   = null;
     this.Type            = BangType.Unknown;
 }
Example #4
0
        public Bang(Vector2 position, BangType bangType) : base(position)
        {
            switch (bangType)
            {
            case BangType.Short:
                this._animationPlayer = new LinearAnimation(this, "Sprites/Props/ShortBang", 3);
                break;

            case BangType.Long:
                this._animationPlayer = new LinearAnimation(this, "Sprites/Props/LongBang", 12);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(bangType));
            }

            this._isExtant = true;
            this.Properties.Set(GameObjectProperties.DrawOrder, (int)SpriteDrawOrder.Bang);
        }
Example #5
0
        public Bang(World world, Vector2 position, BangType bangType)
            : base(world, position)
        {
            Animation a;
            switch (bangType)
                {
                case BangType.Short:
                    a = Animation.SingleRunAnimation(World, "Sprites/Props/ShortBang", 3);
                    break;
                case BangType.Long:
                    a = Animation.SingleRunAnimation(World, "Sprites/Props/LongBang", 3);
                    break;
                default:
                    throw new ArgumentOutOfRangeException("bangType");
                }

            Ap.PlayAnimation(a);
            Ap.AnimationFinished += AnimationFinished;

            this._isExtant = true;
        }
Example #6
0
 internal ExecuteBangParam(string args)
 {
     this.Options = new Dictionary<string, string>();
     this.OverrideOptions = new List<Dictionary<string, string>>();
     this.Commands = new List<string>();
     this.Command = args.Trim();
     this.DismissAction = null;
     this.Type = BangType.Unknown;
 }
Example #7
0
 /// <summary>
 /// Add bang
 /// </summary>
 /// <param name="p">Position to place the sprite</param>
 /// <param name="bangType">The type of bang to create</param>
 public void AddBang(Vector2 p, BangType bangType)
 {
     var b = new Bang(this, p, bangType);
     this.GameObjects.Add(b);
 }