Exemple #1
0
        public Player()
        {
            m_location  = new LocationComponent(this);
            m_rigidBody = new RigidBodyComponent(this, m_location);

            m_renderer = new SpriteRenderer(PlayerSprites.Instance);
            m_sprite   = m_renderer.AddSprite(PlayerSprites.Instance.StandRight);

            m_walkRightSequence = new SpriteSequence(
                PlayerSprites.Instance.WalkRight01,
                PlayerSprites.Instance.WalkRight02,
                PlayerSprites.Instance.WalkRight03,
                PlayerSprites.Instance.WalkRight04,
                PlayerSprites.Instance.WalkRight05,
                PlayerSprites.Instance.WalkRight06,
                PlayerSprites.Instance.WalkRight07,
                PlayerSprites.Instance.WalkRight08,
                PlayerSprites.Instance.WalkRight09,
                PlayerSprites.Instance.WalkRight10,
                PlayerSprites.Instance.WalkRight11
                );

            m_walkLeftSequence = new SpriteSequence(
                PlayerSprites.Instance.WalkLeft01,
                PlayerSprites.Instance.WalkLeft02,
                PlayerSprites.Instance.WalkLeft03,
                PlayerSprites.Instance.WalkLeft04,
                PlayerSprites.Instance.WalkLeft05,
                PlayerSprites.Instance.WalkLeft06,
                PlayerSprites.Instance.WalkLeft07,
                PlayerSprites.Instance.WalkLeft08,
                PlayerSprites.Instance.WalkLeft09,
                PlayerSprites.Instance.WalkLeft10,
                PlayerSprites.Instance.WalkLeft11
                );

            m_standRightSequence = new SpriteSequence(PlayerSprites.Instance.StandRight);
            m_standLeftSequence  = new SpriteSequence(PlayerSprites.Instance.StandLeft);
            m_jumpRightSequence  = new SpriteSequence(PlayerSprites.Instance.JumpRight);
            m_jumpLeftSequence   = new SpriteSequence(PlayerSprites.Instance.JumpLeft);
            m_duckRightSequence  = new SpriteSequence(PlayerSprites.Instance.DuckRight);
            m_duckLeftSequence   = new SpriteSequence(PlayerSprites.Instance.DuckLeft);
        }
Exemple #2
0
 public RestrictLocationComponent(Entity entity, LocationComponent location)
     : base(entity)
 {
     m_location = location;
 }
Exemple #3
0
 public RigidBodyComponent(Entity entity, LocationComponent location)
     : base(entity)
 {
     m_location = location;
     Velocity   = new Vector2(0, 0);
 }
Exemple #4
0
 public Camera()
 {
     m_location         = new LocationComponent(this);
     m_target           = new FollowTargetComponent(this, m_location);
     m_restrictPosition = new RestrictLocationComponent(this, m_location);
 }
 public FollowTargetComponent(Entity entity, LocationComponent location)
     : base(entity)
 {
     m_location = location;
 }