public GameEntity(EntityArguments args) { Args = args; if (args.Position != Vector2.Zero) { Position = args.Position; } else { X = Data.TileOffset.X + args.TileX * Global.TileSize; Y = Data.TileOffset.Y + args.TileY * Global.TileSize; } Type = Data.Type; Direction = args.Direction; Hp = args.Data.Hp; Width = Data.Hitbox.Width; Height = Data.Hitbox.Height; OriginX = Data.Hitbox.X; OriginY = Data.Hitbox.Y; Collider = Data.PixelMask; Layer = Data.Layer; Sprite = new Animator(Data.Anim); Sprite.Origin = Data.SpriteOrigin; Sprite.FlipX = Data.SpriteFlipX; Sprite.FlipY = Data.SpriteFlipY; Add(Sprite); UpdateSortOrder(); }
public LockedDoor(EntityArguments args) : base(args) { }
public Collectible(EntityArguments args) : base(args) { }
public Ogre(EntityArguments args) : base(args) { }
public Enemy(EntityArguments args) : base(args) { Collidable = false; OnStartAlive(); }
public Goblin(EntityArguments args) : base(args) { velocity = DirectionUtils.GetNormal(Direction) * 20.0f; UpdateSprite(); }
public Minotaur(EntityArguments args) : base(args) { }
public Door(EntityArguments args) : base(args) { }
public static GameEntity Create(EntityArguments args) { return((GameEntity)Activator.CreateInstance(args.Data.Class, args)); }