Exemplo n.º 1
0
        public void SetViewTarget(LivingSpriteObject _target)
        {
            target = _target;

            var bb = new RectangleF(
                ConvertUnits.ToSimUnits(target.Transform.Position.X - target.colBodySize.X / 2),
                ConvertUnits.ToSimUnits(target.Transform.Position.Y - target.colBodySize.Y / 2),
                ConvertUnits.ToSimUnits(target.colBodySize.X),
                ConvertUnits.ToSimUnits(target.colBodySize.Y));

            focusArea = new FocusArea(bb, focusAreaSize);
        }
Exemplo n.º 2
0
        public void SpawnPlayer(Vector2?loc)
        {
            if (CustomProperties != null && CustomProperties.ContainsKey("spawnVector"))
            {
                var spawnLocation = !loc.HasValue ? (Vector2)CustomProperties["spawnVector"].value : loc.Value;
            }
            RemoveSprite("Player");
            var l = new Vector2(100, 0);

            player = new Ninja1(l, context);


            player.LoadContent(context.content);
            AddSprite("Player", player);

            player.Initialize();
        }