Beispiel #1
0
 public Vector2D Subtract(Vector2D vec)
 {
     Vector2D newVec = new Vector2D(x, y);
     newVec.X = vec.X - this.x;
     newVec.Y = vec.Y - this.y;
     return newVec;
 }
Beispiel #2
0
 //The constructor. This also creates the string, which make the worker travel between the inn and the farm.
 public Worker(float speed, string imagepath, Vector2D startPos, float scalefactor) : base(imagepath, startPos, scalefactor)
 {
     this.speed = speed;
     Thread t = new Thread(() => Update(GameWorld.currentFps));
     t.IsBackground = true;
     t.Start();
 }
Beispiel #3
0
 //The base constructor.
 public GameObject(string imagePath, Vector2D startPos, float scaleFactor)
 {
     position = startPos;
     this.scaleFactor = scaleFactor;
     this.imagePath = imagePath;
     this.sprite = Image.FromFile(imagePath);
 }
Beispiel #4
0
 public Farm(string imagepath, Vector2D startpos, float scalefactor) : base(imagepath, startpos, scalefactor)
 {
     base.position = startpos;
 }