Beispiel #1
0
 public Attack(Texture2D spriteSheet, Vector2 velocity, Player attackOwner, Vector2 pos, int width, int height)
     : base(pos, width, height)
 {
     this.spriteSheet = new SpriteSheet(spriteSheet, width, height);
     this.velocity = velocity;
     this.attackOwner = attackOwner;
     tint = Color.White;
 }
Beispiel #2
0
 public Player(Texture2D image, Vector2 pos, int width, int height)
     : base(pos, width, height)
 {
     spriteSheet = new SpriteSheet(image, width,height);
     List<Point> animation = new List<Point>();
     //Idle
     animation.Add(new Point(4, 2));
     animation.Add(new Point(5, 2));
     animation.Add(new Point(6, 2));
     animation.Add(new Point(7, 2));
     spriteSheet.AddNewAnimation("idle", animation);
     //Walking
     animation = new List<Point>();
     animation.Add(new Point(0, 0));
     animation.Add(new Point(1, 0));
     animation.Add(new Point(2, 0));
     animation.Add(new Point(3, 0));
     animation.Add(new Point(4, 0));
     animation.Add(new Point(5, 0));
     animation.Add(new Point(6, 0));
     animation.Add(new Point(7, 0));
     spriteSheet.AddNewAnimation("walking", animation);
     //Jumping
     spriteSheet.AddNewAnimation("jump", animation);
     //Falling
     animation = new List<Point>();
     animation.Add(new Point(0, 2));
     animation.Add(new Point(1, 2));
     animation.Add(new Point(2, 2));
     animation.Add(new Point(3, 2));
     spriteSheet.AddNewAnimation("fall", animation);
     //Eating
     animation = new List<Point>();
     animation.Add(new Point(0, 1));
     animation.Add(new Point(1, 1));
     animation.Add(new Point(2, 1));
     animation.Add(new Point(3, 1));
     animation.Add(new Point(4, 1));
     animation.Add(new Point(5, 1));
     animation.Add(new Point(6, 1));
     animation.Add(new Point(7, 1));
     spriteSheet.AddNewAnimation("eat", animation);
     //Attacking
     spriteSheet.AddNewAnimation("attack", animation);
     spriteSheet.SetAnim("idle", 0.6f, flipped);
     velocity = Vector2.Zero;
     tint = Color.White;
     spriteSheet.SetTint(tint);
 }
Beispiel #3
0
 public Stimulant(Texture2D image, Vector2 pos, int width, int height)
     : base(pos, width, height)
 {
     spriteSheet = new SpriteSheet(image, width, height);
     List<Point> animation = new List<Point>();
     //Idle
     animation.Add(new Point(4, 2));
     animation.Add(new Point(5, 2));
     animation.Add(new Point(6, 2));
     animation.Add(new Point(7, 2));
     spriteSheet.AddNewAnimation("idle", animation);
     spriteSheet.SetAnim("idle", 0.6f, flipped);
     tint = Color.White;
     spriteSheet.SetTint(tint);
 }
Beispiel #4
0
 public Wall(Texture2D image ,Vector2 pos, int width, int height)
     : base(pos,width,height)
 {
     spriteSheet = new SpriteSheet(image, width, height);
 }
Beispiel #5
0
        void CommonInit(Texture2D image, int width, int height)
        {
            eatingPos = new Dictionary<Player, Point>();
            eating = new List<Player>();
            spriteSheet = new SpriteSheet(image, width, height);

            List<Point> animation = new List<Point>();
            animation.Add(new Point(0, 0));
            spriteSheet.AddNewAnimation("default", animation);
            animation = new List<Point>();
            animation.Add(new Point(0, 0));
            animation.Add(new Point(1, 0));
            animation.Add(new Point(2, 0));
            animation.Add(new Point(3, 0));
            animation.Add(new Point(4, 0));
            spriteSheet.AddNewAnimation("eating", animation);
            spriteSheet.SetAnim("default", 0.0f);
        }