using System; using System.Collections.Generic; using System.Linq; using System.Text; using VBXSE; namespace TalkingIsAFreeAction { public class Object : PhysicsObject { public static float OBJECT_DEPTH = 40; public string symbol = "?"; public Sprite sprite; public string onAction = ""; public string onTouch = ""; public string special = ""; public string carryid = ""; public string parameter = ""; public Object(string symbol, string texture, int x, int y, string onAction = "", string onTouch = "", string special = "", string carryid = "", string parameter = "") { this.symbol = symbol; this.x = x; this.y = y; this.sprite = GetSpecialSprite(texture, x, y); if (this.sprite == null) { this.sprite = SpriteEngine.CreateSprite(texture, new Microsoft.Xna.Framework.Vector2(x, y)); } this.sprite.depth = OBJECT_DEPTH; this.onAction = onAction; this.onTouch = onTouch; this.special = special; this.carryid = carryid; this.parameter = parameter; this.width = this.sprite.GetImage().Width; this.height = this.sprite.GetImage().Height; } public Sprite GetSpecialSprite(string name, int x, int y) { Sprite toReturn = null; switch (name) { case "portal": toReturn = SpriteEngine.CreateMultiSprite(new string[] { "portal1", "portal2", "portal3" }, x, y, 1f); toReturn.AddAnimation("animate", new Animation("animate", "portal1", 3, 100)); toReturn.currentAnimation = "animate"; break; } return toReturn; } } }