Exemple #1
0
        public override void OnAddedToEntity()
        {
            _animator = Entity.AddComponent <SpriteAnimator>();
            _animator.AddAnimationsFromAtlas(_spriteAtlas);


            _player        = Entity.Scene.FindEntity("player");
            _linkComponent = _player.GetComponent <LinkComponent>();
        }
Exemple #2
0
 public override void OnAddedToEntity()
 {
     Atlas = Entity.Scene.Content.LoadSpriteAtlas($"Content/{Entity.Name}.atlas");
     Entity.Scene.Content.LoadTexture($"Content/{Entity.Name}.png");
     Animerare = Entity.AddComponent <SpriteAnimator>();
     Animerare.SetRenderLayer(1);
     StandardBox         = Entity.AddComponent(new BoxCollider(-20, -31, 40, 63));
     AttackBox           = Entity.AddComponent(new BoxCollider(-20, -31, 50, 31));
     AttackBox.IsTrigger = true;
     Animerare.AddAnimationsFromAtlas(Atlas);
 }
Exemple #3
0
        public override void OnAddedToEntity()
        {
            _mover       = this.GetComponent <TiledMapMover>();
            _boxCollider = Entity.GetComponent <BoxCollider>();

            _xAxisInput = new VirtualIntegerAxis();
            _xAxisInput.Nodes.Add(new VirtualAxis.KeyboardKeys(VirtualInput.OverlapBehavior.TakeNewer, Microsoft.Xna.Framework.Input.Keys.A, Microsoft.Xna.Framework.Input.Keys.D));

            _jumpInput = new VirtualButton();
            _jumpInput.Nodes.Add(new VirtualButton.KeyboardKey(Microsoft.Xna.Framework.Input.Keys.Space));

            _animator = Entity.AddComponent <SpriteAnimator>();
            atlas     = thisScene.Content.LoadSpriteAtlas("Content/out.atlas");
            _animator.AddAnimationsFromAtlas(atlas);
            camera = this.GetComponent <Camera>();
        }
Exemple #4
0
        public override void OnAddedToEntity()
        {
            _bodyAnimator = Entity.AddComponent <SpriteAnimator>();
            //_bodyAnimator.Speed = 0.2f;
            _mover = Entity.AddComponent(new Mover());

            // add a shadow that will only be rendered when our player is behind the details layer of the tilemap (RenderLayer -1). The shadow
            // must be in a renderLayer ABOVE the details layer to be visible.
            var shadow = Entity.AddComponent(new SpriteMime(Entity.GetComponent <SpriteRenderer>()));

            shadow.Color       = new Color(10, 10, 10, 80);
            shadow.Material    = Material.StencilRead();
            shadow.RenderLayer = -11; // ABOVE our tiled map layer so it is visible

            _bodyAnimator.AddAnimationsFromAtlas(_spriteAtlas);

            SetupInput();

            _linkStateFactory = new LinkStateFactory(_primaryAttackInput, _bodyAnimator);
        }