public Wumpus(Player p) : base("Wumpus", "Wumpus.png", 128, 128) { Position = new PointFHelp.PointF(0, 0); ToTrack = p; Collision = CollisionTypes.Rectangular; //Enable the collision CollisionBox = new PointFHelp.PointF(Width, Height); ShootTimer = SecondsPerShoot * 60; }
public Wall(string Name) : base(Name, "Wall.png", 128, 128) { Collidable = false; CollisionBox = new PointFHelp.PointF(128, 128); RemoveFrame(0); AddFrame("Wall.png", 15); AddFrame("Wall2.png", 15); AddFrame("Wall3.png", 15); //AnimateForwards(); }
string Texture; //The filename of the model #endregion Fields #region Constructors public GameObject(string Name, string Texture, uint Width, uint Height) { this.Name = Name; this.Texture = Texture; this.Height = Height; this.Width = Width; Position = new PointF(0, 0); //Initialize it to default position ZOrder = 0; //The default ZOrder is 0 Models = new List<Frame>(); //The list of Frames that the object has try { Image i = Image.FromFile("Assets\\" + Texture); //Load the image Models.Add(new Frame(i, 0)); //Add the first image into the Frame Model = i; //Set the current model to the default texture } catch { Models.Add(null); //Otherwise add a black box Model = null; } Scale = new PointF(1, 1); }