Ejemplo n.º 1
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);
 }
Ejemplo n.º 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);
 }