public PlayerBullet()
        {
            SpriteComponent spriteComponent = new SpriteComponent(this);

            spriteComponent.Image = Resources.PlayerBullet;
            AddComponent(spriteComponent);

            BoxCollider boxCollider = new BoxCollider(this);

            boxCollider.Size = spriteComponent.Image.Size;
            AddComponent(boxCollider);

            ScrollingComponent scrolling = new ScrollingComponent(this);

            scrolling.Speed        = 200f;
            scrolling.ScrollY      = true;
            scrolling.YAddNegative = true;
            AddComponent(scrolling);

            LimitLocationDelete limit = new LimitLocationDelete(this);

            AddComponent(limit);

            DamageSystem damageSystem = new DamageSystem(this);

            damageSystem.HitAbleTag = "Enemy";
            AddComponent(damageSystem);
        }
Beispiel #2
0
        public BackGround()
        {
            SpriteComponent spriteComponent = new SpriteComponent(this);

            spriteComponent.Image = Resources.BackGroundStar2;
            AddComponent(spriteComponent);

            // 화면 내리는 효과를 주기 위한 컴포넌트
            ScrollingComponent scrolling = new ScrollingComponent(this);

            scrolling.ScrollY = true;
            scrolling.Speed   = 150;
            AddComponent(scrolling);

            // 애니메이션 컴포넌트
            AnimationSprite animationSprite = new AnimationSprite(this);

            animationSprite.ImageList.Add(Resources.BackGroundStar1);
            animationSprite.ImageList.Add(Resources.BackGroundStar2);
            animationSprite.ImageList.Add(Resources.BackGroundStar3);
            animationSprite.ImageChangeInterval = 0.2f;
            AddComponent(animationSprite);

            AddComponent(new BackGroundRePos(this));
        }