public Entity(string id, int layer, Coord position, Sprite sprite) { if (Game.entities.Exists(x => x.id == id)) { this.id = id + "_2"; } else { this.id = id; } this.layer = layer; activeSpriteSet = 0; activeSprite = 0; spriteSheet = new List <Sprite[]>() { new Sprite[1] { sprite } }; rect = new Rect(position, sprite.size); direction = new Vector(0, 0, 0); moveDelay = new Ticker(Game.gameTicker.delay); Game.entities.Add(this); }
public Entity(string id, int layer, Coord position) { if (Game.entities.Exists(x => x.id == id)) { this.id = id + "_2"; } else { this.id = id; } this.layer = layer; activeSpriteSet = 0; activeSprite = 0; spriteSheet = new List <Sprite[]>() { new Sprite[1] { new Sprite(new string(' ', Game.pixelWidth), 0, 15) } }; rect = new Rect(position, new Coord(1, 1)); direction = new Vector(0, 0, 0); moveDelay = new Ticker(Game.gameTicker.delay); Game.entities.Add(this); }