Пример #1
0
 public WaterEffectInfo(Vector2 position, float rotation, float delay, Sprite image)
 {
     this.Position = position;
     this.Rotation = rotation;
     this.Image = image;
     this.Delay = delay;
 }
Пример #2
0
 public ObstacleInfo(Vector2 position, int type, Sprite image, bool isStatic, bool isWalkable)
 {
     this.Type = type;
     this.Image = image;
     this.Position = position;
     this.IsStatic = isStatic;
     this.IsWalkable = isWalkable;
 }
Пример #3
0
        protected void onChangeDirection(int dir)
        {
            switch (dir)
            {
                case Shared.Constants.DIRECTION_LEFT:
                    sprCurrent = sprMoveLeft;
                    accelerator.X = -velocity.X;
                    accelerator.Y = 0f;
                    break;
                case Shared.Constants.DIRECTION_RIGHT:
                    sprCurrent = sprMoveRight;
                    accelerator.X = velocity.X;
                    accelerator.Y = 0f;
                    break;
                case Shared.Constants.DIRECTION_UP:
                    sprCurrent = sprMoveUp;
                    accelerator.X = 0f;
                    accelerator.Y = -velocity.Y;
                    break;
                case Shared.Constants.DIRECTION_DOWN:
                    sprCurrent = sprMoveDown;
                    accelerator.X = 0f;
                    accelerator.Y = velocity.Y;
                    break;
                default:
                    sprCurrent = sprMoveDown;
                    accelerator.X = 0f;
                    accelerator.Y = 0f;
                    break;

            }
            sprCurrent.Play();

            if (this.oldDirection != this.direction)
            {
                this.oldDirection = this.direction;
            }
            this.direction = dir;
        }
Пример #4
0
        public override void onInit()
        {
            base.onInit();

            // Get bomber resources
            sprMoveLeft = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.EnemyMoveLeft);
            sprMoveRight = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.EnemyMoveRight);
            sprMoveUp = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.EnemyMoveUp);
            sprMoveDown = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.EnemyMoveDown);

            // Begin with move down
            sprCurrent = sprMoveDown;

            randomDirection();
        }
Пример #5
0
 protected void onChangeImage(Sprite spr)
 {
     if (!(this.Stage is WrapBombStage))
     {
         this.sprCurrent = spr;
     }
 }
Пример #6
0
 public void wrappedBomb()
 {
     this.sprCurrent = sprWrapBomb;
 }
Пример #7
0
        public override void onInit()
        {
            base.onInit();

            // Get bomber resources
            sprMoveLeft = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveLeft);
            sprMoveRight = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveRight);
            sprMoveUp = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveUp);
            sprMoveDown = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveDown);
            sprWrapBomb = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberWrapBomb);

            // Begin with move down
            sprCurrent = sprMoveDown;

            // Begin with idle stage
            stgBomberStage = IdleStage.getInstance();
            stgBomberStage.ApplyStageEffect(this);

            velocity = new Vector2(5f, 5f);

            Range = 2;
            Shared.Global.Counter_BombCanLocated = 1;
        }