Exemplo n.º 1
0
 public MountainSmall(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame, float depth)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION = new Vector3(POSITION.X, POSITION.Y, 0.73f + depth);
     ID       = MyID.MOUNTAIN_SMALL;
     SPRITE   = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 2
0
 public Building(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION = new Vector3(POSITION.X, POSITION.Y, 0.76f);
     ID       = MyID.BUILDING;
     SPRITE   = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 3
0
 public WinPole(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION = new Vector3(POSITION.X, POSITION.Y, 0.81f);
     ID       = MyID.WINPOLE;
     SPRITE   = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 4
0
 public Fence(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame, int _CurFrame)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION     = new Vector3(POSITION.X, POSITION.Y, 0.8f);
     ID           = MyID.FENCE;
     CURRENTFRAME = _CurFrame;
     SPRITE       = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 5
0
 public Cloud(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame, float depth)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION     = new Vector3(POSITION.X, POSITION.Y, 0.75f + depth);
     ID           = MyID.CLOUD;
     CURRENTFRAME = 0;
     SPRITE       = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 6
0
 public BrickHard(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION     = new Vector3(POSITION.X, POSITION.Y, 0.9f);
     ID           = MyID.BRICK_HARD;
     CURRENTFRAME = 0;
     STATUS       = MyStatus.ACTIVE;
     SPRITE       = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 7
0
 public Base_RightOn(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION     = new Vector3(POSITION.X, POSITION.Y, 0.9f);
     ID           = MyID.BASE;
     CURRENTFRAME = 2;
     STATUS       = MyStatus.ACTIVE;
     SPRITE       = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 8
0
 public MushroomBig(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION = new Vector3(POSITION.X, POSITION.Y, 0.9f);
     ID       = MyID.MUSHROOM_BIG;
     STATUS   = MyStatus.START;
     SPRITE   = RSManager.Instance(_Game).SPRITE(ID);
     Y        = _Y;
 }
Exemplo n.º 9
0
 public Flower(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION = new Vector3(POSITION.X, POSITION.Y, 0.9f);
     ID       = MyID.FLOWER;
     STATUS   = MyStatus.START;
     SPRITE   = RSManager.Instance(_Game).SPRITE(ID);
     Y        = _Y;
 }
Exemplo n.º 10
0
 public BulletBoss(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame, int _dri)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION = new Vector3(POSITION.X, POSITION.Y, 0.9f);
     ID       = MyID.BULLETBOSS;
     STATUS   = MyStatus.START;
     dri      = _dri;
     SPRITE   = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 11
0
 public Break(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION     = new Vector3(POSITION.X, POSITION.Y, 0.96f);
     ID           = MyID.BREAK;
     CURRENTFRAME = 1;
     ACCEL        = new Vector3(0, 0.004f, 0);
     STATUS       = MyStatus.ACTIVE;
     SPRITE       = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 12
0
 public MushroomToxic(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION = new Vector3(POSITION.X, POSITION.Y, 0.92f);
     ID       = MyID.MUSHROOM_TOXIC;
     ACCEL    = new Vector3(0, 0.001f, 0);
     VELOC    = new Vector3(-0.1f, 0, 0);
     STATUS   = MyStatus.ACTIVE;
     SPRITE   = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 13
0
 public Question(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame, MyObject _Visible)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION     = new Vector3(POSITION.X, POSITION.Y, 0.92f);
     Visible      = _Visible;
     ID           = MyID.QUESTION_MARK;
     CURRENTFRAME = 1;
     STATUS       = MyStatus.ACTIVE;
     SPRITE       = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 14
0
 public BrickBreak(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     game      = _Game;
     POSITION  = new Vector3(POSITION.X, POSITION.Y, 0.9f);
     ID        = MyID.BRICK_BREAK;
     STATUS    = MyStatus.ACTIVE;
     SPRITE    = RSManager.Instance(_Game).SPRITE(ID);
     ListBreak = new List <MyObject>();
     Y         = _Y;
 }
Exemplo n.º 15
0
 public Title(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame, int _DirVeloc)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION     = new Vector3(POSITION.X, POSITION.Y, 0.94f);
     ACCEL        = new Vector3(0, 0.001f, 0);
     VELOC        = (_DirVeloc > 0) ? new Vector3(0.1f, 0.0f, 0.0f) : new Vector3(-0.1f, 0.0f, 0.0f);
     ID           = MyID.TITLE;
     CURRENTFRAME = 1;
     STATUS       = MyStatus.ACTIVE;
     SPRITE       = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 16
0
 public Mario(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame, MyObject _visible)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     Game     = _Game;
     POSITION = new Vector3(POSITION.X, POSITION.Y, 1);
     ID       = MyID.MARIO_SUPER;
     STATUS   = MyStatus.ACTIVE;
     dri      = 1;
     Visible  = _visible;
     bullets  = 20;
     scale    = new Vector2(1.0f, 1.0f);
     ACCEL    = new Vector3(0, 0.004f, 0);
     SPRITE   = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 17
0
 public Coin(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame, int _Status)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     POSITION = new Vector3(POSITION.X, POSITION.Y, 0.9f);
     ID       = MyID.COIN;
     if (_Status == 1)
     {
         STATUS = MyStatus.ACTIVE;
     }
     else
     {
         STATUS = MyStatus.START;
     }
     SPRITE = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 18
0
 public Boss(Game _Game, int _X, int _Y, int _SX, int _SY, int _TotalFrame)
     : base(_Game, _X, _Y, _SX, _SY, _TotalFrame)
 {
     game      = _Game;
     POSITION  = new Vector3(POSITION.X, POSITION.Y, 1);
     ID        = MyID.BOSS;
     STATUS    = MyStatus.ACTIVE;
     ACCEL     = new Vector3(0, 0.001f, 0);
     VELOC     = new Vector3(-0.15f, 0, 0);
     Direct    = -1;
     scale     = new Vector2(1.0f, 1.0f);
     Rdn       = new Random();
     ListBreak = new List <MyObject>();
     Blood     = 240;
     SPRITE    = RSManager.Instance(_Game).SPRITE(ID);
 }
Exemplo n.º 19
0
        public override void Update(GameTime mGameTime)
        {
            UpdateAnimate(mGameTime);
            UpdateMove(mGameTime);
            switch (STATUS)
            {
            case MyStatus.SHOT:
                TimeUpdate += mGameTime.ElapsedGameTime.Milliseconds;
                if (TimeUpdate > 100)
                {
                    TimeUpdate -= 100;
                    STATUS      = MyStatus.ACTIVE;
                }
                break;

            case MyStatus.BEFORE_DEATH1:
                TimeUpdate += mGameTime.ElapsedGameTime.Milliseconds;
                if (TimeUpdate > 4000)
                {
                    TimeUpdate -= 4000;
                    STATUS      = MyStatus.DEATH;
                }
                break;

            case MyStatus.UP:
                TimeUpdate += mGameTime.ElapsedGameTime.Milliseconds;
                if (TimeUpdate > 500)
                {
                    TimeUpdate -= 500;

                    ID       = MyID.MARIO_BIG;
                    SPRITE   = RSManager.Instance(Game).SPRITE(ID);
                    SIZE     = new Vector3(SIZE.X, 100, 0);
                    POSITION = new Vector3(POSITION.X, POSITION.Y - 50, POSITION.Z);

                    STATUS = MyStatus.ACTIVE;
                }
                break;

            case MyStatus.DOWN:
                TimeUpdate += mGameTime.ElapsedGameTime.Milliseconds;
                if (TimeUpdate > 500)
                {
                    TimeUpdate -= 500;

                    STATUS = MyStatus.INVI;
                }
                break;

            case MyStatus.INVI:
                TimeUpdate += mGameTime.ElapsedGameTime.Milliseconds;
                if (TimeUpdate > 2000)
                {
                    TimeUpdate -= 2000;

                    STATUS = MyStatus.ACTIVE;
                }
                break;

            case MyStatus.CHANGE:
                TimeUpdate += mGameTime.ElapsedGameTime.Milliseconds;
                if (TimeUpdate > 500)
                {
                    TimeUpdate -= 500;

                    STATUS = MyStatus.ACTIVE;
                }
                break;
            }
        }
Exemplo n.º 20
0
        public override void ActionCollision(MyObject Obj)
        {
            DIR Dir = DirectionCollision(Obj);

            switch (Obj.ID)
            {
            case MyID.PIPE:
            case MyID.BASE:
            case MyID.BRICK_BREAK:
            case MyID.BRICK_HARD:
            case MyID.QUESTION_MARK:
                if (STATUS == MyStatus.ACTIVE || STATUS == MyStatus.DOWN || STATUS == MyStatus.UP || STATUS == MyStatus.INVI || STATUS == MyStatus.CHANGE || STATUS == MyStatus.SHOT || STATUS == MyStatus.WIN)
                {
                    if (Obj.STATUS == MyStatus.ACTIVE || Obj.STATUS == MyStatus.STATIC || Obj.STATUS == MyStatus.RUN || Obj.STATUS == MyStatus.BEFORE_DEATH3)
                    {
                        switch (Dir)
                        {
                        case DIR.BOTTOM:
                            VELOC    = new Vector3(VELOC.X, 0, 0);
                            POSITION = new Vector3(POSITION.X, Obj.POSITION.Y - SIZE.Y + 1, POSITION.Z);
                            break;

                        case DIR.TOP:
                            VELOC    = new Vector3(VELOC.X, -1 * VELOC.Y, 0);
                            POSITION = new Vector3(POSITION.X, Obj.POSITION.Y + Obj.SIZE.Y, POSITION.Z);
                            break;

                        case DIR.LEFT:
                            if (VELOC.X < 0)
                            {
                                VELOC = new Vector3(0, VELOC.Y, 0);
                            }
                            POSITION = new Vector3(Obj.POSITION.X + Obj.SIZE.X, POSITION.Y, POSITION.Z);
                            break;

                        case DIR.RIGHT:
                            if (VELOC.X > 0)
                            {
                                VELOC = new Vector3(0, VELOC.Y, 0);
                            }
                            POSITION = new Vector3(Obj.POSITION.X - SIZE.X, POSITION.Y, POSITION.Z);
                            break;
                        }
                    }
                }
                break;

            case MyID.MUSHROOM_BIG:
                if (STATUS == MyStatus.ACTIVE || STATUS == MyStatus.INVI)
                {
                    switch (ID)
                    {
                    case MyID.MARIO_SMALL:
                        if (Obj.STATUS == MyStatus.ACTIVE || Obj.STATUS == MyStatus.RUN)
                        {
                            STATUS = MyStatus.UP;
                        }
                        break;
                    }
                }
                break;

            case MyID.FLOWER:
                if (STATUS == MyStatus.ACTIVE || STATUS == MyStatus.INVI)
                {
                    switch (ID)
                    {
                    case MyID.MARIO_SMALL:
                        if (Obj.STATUS == MyStatus.ACTIVE || Obj.STATUS == MyStatus.RUN)
                        {
                            STATUS = MyStatus.UP;
                        }
                        break;

                    case MyID.MARIO_BIG:
                        if (Obj.STATUS == MyStatus.ACTIVE || Obj.STATUS == MyStatus.RUN)
                        {
                            STATUS = MyStatus.CHANGE;

                            ID     = MyID.MARIO_SUPER;
                            SPRITE = RSManager.Instance(Game).SPRITE(ID);
                        }
                        break;
                    }
                }
                break;

            case MyID.MUSHROOM_1UP:
                break;

            case MyID.MUSHROOM_TOXIC:
                if (STATUS == MyStatus.ACTIVE || STATUS == MyStatus.SHOT || STATUS == MyStatus.INVI)
                {
                    if (Obj.STATUS == MyStatus.ACTIVE)
                    {
                        switch (Dir)
                        {
                        case DIR.BOTTOM:
                            VELOC    = new Vector3(VELOC.X, -1 * VELOC.Y * 0.8f, 0);
                            POSITION = new Vector3(POSITION.X, Obj.POSITION.Y - SIZE.Y + 1, POSITION.Z);
                            break;

                        case DIR.RIGHT:
                        case DIR.LEFT:
                            if (STATUS != MyStatus.INVI)
                            {
                                if (ID == MyID.MARIO_SMALL)
                                {
                                    VELOC  = new Vector3(0, -0.9f, 0);
                                    STATUS = MyStatus.BEFORE_DEATH1;
                                }
                                if (ID == MyID.MARIO_BIG)
                                {
                                    STATUS = MyStatus.DOWN;

                                    ID       = MyID.MARIO_SMALL;
                                    SPRITE   = RSManager.Instance(Game).SPRITE(ID);
                                    SIZE     = new Vector3(SIZE.X, 50, 0);
                                    POSITION = new Vector3(POSITION.X, POSITION.Y + 50, POSITION.Z);
                                }
                                if (ID == MyID.MARIO_SUPER)
                                {
                                    STATUS = MyStatus.CHANGE;

                                    ID     = MyID.MARIO_BIG;
                                    SPRITE = RSManager.Instance(Game).SPRITE(ID);
                                }
                            }
                            break;
                        }
                    }
                }
                break;

            case MyID.TITLE:
                if (Dir == DIR.BOTTOM)
                {
                    if (STATUS == MyStatus.ACTIVE || STATUS == MyStatus.SHOT || STATUS == MyStatus.INVI)
                    {
                        if (Obj.STATUS == MyStatus.STATIC || Obj.STATUS == MyStatus.ACTIVE || Obj.STATUS == MyStatus.RUN)
                        {
                            POSITION = new Vector3(POSITION.X, Obj.POSITION.Y - SIZE.Y - 5, POSITION.Z);
                            VELOC    = new Vector3(VELOC.X, -1.0f, 0);
                        }
                    }
                }
                else
                {
                    if (STATUS == MyStatus.ACTIVE || STATUS == MyStatus.SHOT)
                    {
                        if (Obj.STATUS == MyStatus.ACTIVE || Obj.STATUS == MyStatus.RUN)
                        {
                            if (ID == MyID.MARIO_SMALL)
                            {
                                VELOC  = new Vector3(0, -0.9f, 0);
                                STATUS = MyStatus.BEFORE_DEATH1;
                            }
                            if (ID == MyID.MARIO_BIG)
                            {
                                STATUS = MyStatus.DOWN;

                                ID       = MyID.MARIO_SMALL;
                                SPRITE   = RSManager.Instance(Game).SPRITE(ID);
                                SIZE     = new Vector3(SIZE.X, 50, 0);
                                POSITION = new Vector3(POSITION.X, POSITION.Y + 50, POSITION.Z);
                            }
                            if (ID == MyID.MARIO_SUPER)
                            {
                                STATUS = MyStatus.CHANGE;

                                ID     = MyID.MARIO_BIG;
                                SPRITE = RSManager.Instance(Game).SPRITE(ID);
                            }
                        }
                    }
                }
                break;

            case MyID.BOSS:
                if (STATUS == MyStatus.ACTIVE || STATUS == MyStatus.SHOT || STATUS == MyStatus.INVI)
                {
                    if (Obj.STATUS == MyStatus.ACTIVE || Obj.STATUS == MyStatus.SHOT || Obj.STATUS == MyStatus.HURT)
                    {
                        switch (Dir)
                        {
                        case DIR.BOTTOM:
                            VELOC    = new Vector3(VELOC.X, -1 * VELOC.Y * 0.9f, 0);
                            POSITION = new Vector3(POSITION.X, Obj.POSITION.Y - SIZE.Y + 1, POSITION.Z);
                            break;

                        case DIR.RIGHT:
                        case DIR.LEFT:
                            if (STATUS != MyStatus.INVI)
                            {
                                if (ID == MyID.MARIO_SMALL)
                                {
                                    VELOC  = new Vector3(0, -0.9f, 0);
                                    STATUS = MyStatus.BEFORE_DEATH1;
                                }
                                if (ID == MyID.MARIO_BIG)
                                {
                                    STATUS = MyStatus.DOWN;

                                    ID       = MyID.MARIO_SMALL;
                                    SPRITE   = RSManager.Instance(Game).SPRITE(ID);
                                    SIZE     = new Vector3(SIZE.X, 50, 0);
                                    POSITION = new Vector3(POSITION.X, POSITION.Y + 50, POSITION.Z);
                                }
                                if (ID == MyID.MARIO_SUPER)
                                {
                                    STATUS = MyStatus.CHANGE;

                                    ID     = MyID.MARIO_BIG;
                                    SPRITE = RSManager.Instance(Game).SPRITE(ID);
                                }
                            }
                            break;
                        }
                    }
                }
                break;

            case MyID.BULLETBOSS:
                if (STATUS == MyStatus.ACTIVE || STATUS == MyStatus.SHOT)
                {
                    if (Obj.STATUS == MyStatus.ACTIVE)
                    {
                        if (ID == MyID.MARIO_SMALL)
                        {
                            VELOC  = new Vector3(0, -0.9f, 0);
                            STATUS = MyStatus.BEFORE_DEATH1;
                        }
                        if (ID == MyID.MARIO_BIG)
                        {
                            STATUS = MyStatus.DOWN;

                            ID       = MyID.MARIO_SMALL;
                            SPRITE   = RSManager.Instance(Game).SPRITE(ID);
                            SIZE     = new Vector3(SIZE.X, 50, 0);
                            POSITION = new Vector3(POSITION.X, POSITION.Y + 50, POSITION.Z);
                        }
                        if (ID == MyID.MARIO_SUPER)
                        {
                            STATUS = MyStatus.CHANGE;

                            ID     = MyID.MARIO_BIG;
                            SPRITE = RSManager.Instance(Game).SPRITE(ID);
                        }
                    }
                }
                break;
            }
        }
Exemplo n.º 21
0
        public override void UpdateMove(GameTime mGameTime)
        {
            switch (STATUS)
            {
            case MyStatus.WIN:
                VELOC = new Vector3(0.2f, 0, 0);
                base.UpdateMove(mGameTime);
                break;

            case MyStatus.SHOT:
            case MyStatus.CHANGE:
            case MyStatus.INVI:
            case MyStatus.UP:
            case MyStatus.DOWN:
            case MyStatus.BEFORE_DEATH1:
            case MyStatus.ACTIVE:
                if (ACCEL.X == 0)
                {
                    if (VELOC.X != 0)
                    {
                        if (VELOC.X > 0)
                        {
                            VELOC = new Vector3(VELOC.X - 0.008f, VELOC.Y, 0);
                            if (VELOC.X < 0)
                            {
                                VELOC = new Vector3(0, VELOC.Y, 0);
                            }
                        }
                        else
                        {
                            VELOC = new Vector3(VELOC.X + 0.008f, VELOC.Y, 0);
                            if (VELOC.X > 0)
                            {
                                VELOC = new Vector3(0, VELOC.Y, 0);
                            }
                        }
                    }
                }

                if (VELOC.X < -0.50f)
                {
                    VELOC = new Vector3(-0.50f, VELOC.Y, 0);
                }
                if (VELOC.X > 0.50f)
                {
                    VELOC = new Vector3(0.50f, VELOC.Y, 0);
                }

                if (POSITION.X < 0)
                {
                    POSITION = new Vector3(0, POSITION.Y, POSITION.Z);
                    VELOC    = new Vector3(0, VELOC.Y, 0);
                }

                /*
                 * neu' roi xuong vuc
                 */
                if (STATUS != MyStatus.BEFORE_DEATH1)
                {
                    if (POSITION.Y > Game.GraphicsDevice.Viewport.Height)
                    {
                        ID     = MyID.MARIO_SMALL;
                        SPRITE = RSManager.Instance(Game).SPRITE(ID);
                        SIZE   = new Vector3(SIZE.X, 50, 0);

                        VELOC  = new Vector3(0, -1.8f, 0);
                        STATUS = MyStatus.BEFORE_DEATH1;
                    }
                }
                base.UpdateMove(mGameTime);
                ACCEL = new Vector3(0, ACCEL.Y, 0);
                break;
            }
        }