Exemple #1
0
        public override IBox BuildMapObject(IWorld world, Vector2 tilesize)
        {
            if (!Enabled)
            {
                return(null);
            }

            var box = world.Create(TileX * tilesize.X, TileY * tilesize.Y, TileWidth * tilesize.X, TileHeight * tilesize.Y);

            box.AddTags(HumperColliderTags.World);
            return(box);
        }
        public PlayerHumper(Player playerCollider)
            : base()
        {
            Owner         = playerCollider;
            _statemanager = Scene.Current.FindComponent <GameStateManager>();

            World = GameLevel.Instance.BuildHumpermap();

            Box = World.Create(Owner.GameObj.Transform.Pos.X,
                               -Owner.GameObj.Transform.Pos.Y,
                               Owner.Collider.SizeX,
                               Owner.Collider.SizeY);
            Box.AddTags(HumperColliderTags.Player);
            Box.Data   = Owner.GameObj.GetComponent <Player>();
            ignoreSelf = new List <IBox> {
                Box
            };

            Logs.Game.Write("PlayerHumper created at {0}/{1} as a {2}/{3} wide box", Box.X, Box.Y, Box.Width, Box.Height);
        }