Example #1
0
 public Skill(Type skillType, Vector2 position, Vector2 direction)
 {
     this.skillType = skillType;
     this.texture = textures[(int)this.skillType];
     this.position = position;
     this.direction = direction;
     if (texture != null)
     {
         switch (this.skillType)
         {
             case Type.FireBall:
                 this.width = texture.Width / 4;
                 this.height = texture.Height;
                 this.frameTimer = new Timer(1000 / 20);
                 speed = 0.125f;
                 break;
         }
         this.frame = new Rectangle(0, 0, width, height);
     }
 }
Example #2
0
        public Player(SpriteBatch spriteBatch, Level level)
        {
            this.spriteBatch = spriteBatch;

            this.level = level;
            this.position = this.level.startPosition;
            this.target = this.position;

            this.width = texture.Width / 3;
            this.height = texture.Height / 4;

            this.path = new List<Vector2>();
            pathIndex = 0;

            this.direction = Vector2.UnitY;
            this.frame = new Rectangle(0, 0, width, height);
            this.frameTimer = new Timer(1000 / FPS);
            this.skillTimer = new Timer(SKILL_DELAY);

            this.skills = new List<Skill>();
            curSkill = Skill.Type.FireBall;
        }