public Element(string Name) { Belongings = new List <Updatable>(); Position = new PointF(0, 0); this.Name = Name; Game.AddElement(this); }
/*Returns: * 1 if quadrant 1, 2 if quadrant 2, 3 if quadrant 3, 4 if quadrant 4 * 5 if it lies on the positive x axis, 6 if it lies on the positive y axis * 7 if it lies on the negative x axis, 8 if it lies on the negative y axis * -1 if none of the above*/ public static int RelativeQuadrant(Engine.PointF Pos1, Engine.PointF Pos2) { if (Pos1.X < Pos2.X) { if (Pos1.Y < Pos2.Y) { return(1); } if (Pos1.Y > Pos2.Y) { return(4); } else { return(5); } } if (Pos1.X > Pos2.X) { if (Pos1.Y < Pos2.Y) { return(2); } if (Pos1.Y > Pos2.Y) { return(3); } else { return(7); } } else { if (Pos1.Y < Pos2.Y) { return(6); } if (Pos1.Y > Pos2.Y) { return(8); } else { return(-1); } } }
public Element(string Name) { Position = new PointF(0, 0); this.Name = Name; }
public SolidObject(string Name, string Texture, uint Width, uint Height, CollisionTypes CollisionType) : base(Name, Texture, Width, Height) { Collision = CollisionType; CollisionBox = new Engine.PointF(Width, Height); }