示例#1
0
 public Camera(Vector2 pos, Vector2 bounds, float maxSpeed, GameObject target)
 {
     this.Target = target;
     this.MaxSpeed = maxSpeed;
     this.pos = pos;
     this.bounds = bounds;
 }
示例#2
0
        public SpeechBubble(GameObject target, int objectDistance, string text)
        {
            this.Text = text;
            this.target = target;
            this.objectDistance = objectDistance;

            this.width = 2 * TEXT_BUFFER + (int)fntSpeech.MeasureString(text).X;
            this.height = 2 * TEXT_BUFFER + (int)fntSpeech.MeasureString(text).Y;
            topLeft = target.Position - Vector2.UnitX * (objectDistance + width) - Vector2.UnitY * (objectDistance + height);
            center = new Vector2(topLeft.X + (float)width / 2, (float)topLeft.Y + height / 2);
            arrowPosition = center;
        }
示例#3
0
 public bool ContainsObject(GameObject obj)
 {
     return area.Contains(new Point((int)obj.Position.X, (int)obj.Position.Y));
 }
示例#4
0
 public void CreateObject(GameObject obj)
 {
     toAdd.Add(obj);
 }