Esempio n. 1
0
 public Entity(Texture2D spritesheet)
 {
     IsFacingRight   = true;
     Spritesheet     = spritesheet;
     Position        = Vector2.Zero;
     Scale           = Vector2.One;
     Angle           = 0;
     Rotation        = 0;
     AnimationFrames = Sprites.GetSprites(1, 1, spritesheet);
     currentframe    = 0;
     Origin          = new Vector2(spritesheet.Width / 2, spritesheet.Height / 2);
 }
Esempio n. 2
0
        public Player(Texture2D spriteSheet)
            : base(spriteSheet)
        {
            DefaultHealth       = 200;
            MaxSelfSpeed        = 2.0f;
            JumpSpeed           = 5f;
            JetPackThrust       = 0.1f;
            MaxClimbingDistance = 5;
            _AimingAngle        = 0f;
            AimingSpeed         = (float)Math.PI / 64f;
            _AimingMaxAngle     = (float)Math.PI / 2f;
            _AimingMinAngle     = -_AimingMaxAngle;
            Weapons             = new List <Weapon>();
            IsFiring            = false;

            CollisionBox = new Rectangle(12, 25, 11, 24);

            AnimationFrames = Sprites.GetSprites(21, 1, spriteSheet);
            Origin          = new Vector2(SourceRect.Width / 2, SourceRect.Height / 2);

            animationPeriod = 3;
        }