Exemplo n.º 1
0
        //TODO Construir mecanismo de chamar um delegate method when finish animation

        public MacromapPlayer(Color color, Vector2 position)
            : base(color, position)
        {
            mCurrentColor = color;

            if (mCurrentColor == Color.Red)
            {
                mSpriteNormal = new Sprite(ExtraFunctions.fillArrayWithImages(1, "gameplay\\macromap\\RED_ICONE_POS_0"), new int[] { 0 }, 7, 107, 107, false, false);
            }
            else
            if (mCurrentColor == Color.Green)
            {
                mSpriteNormal = new Sprite(ExtraFunctions.fillArrayWithImages(1, "gameplay\\macromap\\GREEN_ICONE_POS_0"), new int[] { 0 }, 7, 107, 107, false, false);
            }
            else
            if (mCurrentColor == Color.Blue)
            {
                mSpriteNormal = new Sprite(ExtraFunctions.fillArrayWithImages(1, "gameplay\\macromap\\BLUE_ICONE_POS_0"), new int[] { 0 }, 7, 107, 107, false, false);
            }

            addSprite(mSpriteNormal, sSTATE_NORMAL);
            //addSprite(mSpriteExploding, sSTATE_EXPLODING);

            changeToSprite(sSTATE_NORMAL);

            setCollisionRect(40, 40);

            pos = new Vector2(300, 0);
        }
Exemplo n.º 2
0
        public Button(String imgNormal, String imgPressed, Rectangle rectArea)
        {
            mSpriteNormal  = new Sprite(ExtraFunctions.fillArrayWithImages(1, imgNormal), new int[] { 0 }, 7, rectArea.Width, rectArea.Height, false, false);
            mSpritePressed = new Sprite(ExtraFunctions.fillArrayWithImages(1, imgPressed), new int[] { 0 }, 7, rectArea.Width, rectArea.Height, false, false);

            addSprite(mSpriteNormal, sSTATE_NORMAL);
            addSprite(mSpritePressed, sSTATE_PRESSED);

            changeToSprite(sSTATE_NORMAL);

            //setCollisionRect(rectArea.Width,rectArea.Height);

            setCollisionRect(0, 0, rectArea.Width, rectArea.Height);

            setLocation(rectArea.X, rectArea.Y);


            mRectArea = rectArea;
        }
Exemplo n.º 3
0
        //TODO Construir mecanismo de chamar um delegate method when finish animation

        public SelectableCharacter(Vector2 center, Color color)
        {
            mColor = color;

            if (mColor == Color.Red)
            {
                mSpriteUnselected  = new Sprite(ExtraFunctions.fillArrayWithImages(1, "gameplay\\selection\\RED\\Red_unselect_pos"), new int[] { 0 }, 9, 175, 231, false, false);
                mSpriteHighlighted = new Sprite(ExtraFunctions.fillArrayWithImages(1, "gameplay\\selection\\RED\\Red_select"), new int[] { 0 }, 9, 196, 248, false, false);
                mSpriteSelected    = new Sprite(ExtraFunctions.fillArrayWithImages2(0, 16, "gameplay\\selection\\RED\\Selected\\red_selected"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 16 }, 1, 525, 394, true, false);
                mSpriteExplosion   = new Sprite(ExtraFunctions.fillArrayWithImages2(16, 17, "gameplay\\selection\\RED\\Selected\\red_selected"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 17 }, 1, 800, 600, true, false);
            }

            if (mColor == Color.Green)
            {
                mSpriteUnselected  = new Sprite(ExtraFunctions.fillArrayWithImages(1, "gameplay\\selection\\GREEN\\green_unselect_pos"), new int[] { 0 }, 9, 203, 211, false, false);
                mSpriteHighlighted = new Sprite(ExtraFunctions.fillArrayWithImages(1, "gameplay\\selection\\GREEN\\green_select"), new int[] { 0 }, 9, 211, 232, false, false);
                mSpriteSelected    = new Sprite(ExtraFunctions.fillArrayWithImages2(0, 16, "gameplay\\selection\\GREEN\\Selected\\green_selected"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 16 }, 1, 401, 381, true, false);
                mSpriteExplosion   = new Sprite(ExtraFunctions.fillArrayWithImages2(16, 17, "gameplay\\selection\\GREEN\\Selected\\green_selected"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 17 }, 1, 800, 600, true, false);
            }

            if (mColor == Color.Blue)
            {
                mSpriteUnselected  = new Sprite(ExtraFunctions.fillArrayWithImages(1, "gameplay\\selection\\BLUE\\blue_unselect_pos"), new int[] { 0 }, 9, 167, 231, false, false);
                mSpriteHighlighted = new Sprite(ExtraFunctions.fillArrayWithImages(1, "gameplay\\selection\\BLUE\\blue_select"), new int[] { 0 }, 9, 185, 254, false, false);
                mSpriteSelected    = new Sprite(ExtraFunctions.fillArrayWithImages2(0, 17, "gameplay\\selection\\BLUE\\Selected\\blue_selected"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 17 }, 1, 545, 393, true, false);
                mSpriteExplosion   = new Sprite(ExtraFunctions.fillArrayWithImages2(17, 16, "gameplay\\selection\\BLUE\\Selected\\blue_selected"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 16 }, 1, 800, 600, true, false);
            }

            addSprite(mSpriteUnselected, sSTATE_UNSELECTED);
            addSprite(mSpriteHighlighted, sSTATE_HIGHLIGHTED);
            addSprite(mSpriteSelected, sSTATE_SELECTED);
            addSprite(mSpriteExplosion, sSTATE_EXPLOSION);

            changeToSprite(sSTATE_UNSELECTED);

            setCollisionRect(30, 30, 150, 150);

            setCenter(center.X, center.Y);
            setVisible(true);

            pos = new Vector2(300, 0);
        }
Exemplo n.º 4
0
        public Collectable(CollectableType type)
        {
            mType = type;

            switch (mType)
            {
            case CollectableType.StagePiece:

                mSpriteNormal    = new Sprite(ExtraFunctions.fillArrayWithImages(10, "gameplay\\collectable\\heart"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 10 }, 1, 40, 40, false, false);
                mSpriteCollected = new Sprite(ExtraFunctions.fillArrayWithImages(1, "gameplay\\maincharacter\\blue_stopped"), new int[] { 0, 1 }, 1, 45, 45, false, false);
                break;
            }


            addSprite(mSpriteNormal, sSTATE_NORMAL);
            addSprite(mSpriteCollected, sSTATE_COLLECTED);

            changeToSprite(sSTATE_NORMAL);

            setCollisionRect(40, 40);
        }
Exemplo n.º 5
0
        //TODO Construir mecanismo de chamar um delegate method when finish animation

        public MacromapShip(Vector2 position, ColorStatus colorStatus)
        {
            if (colorStatus == ColorStatus.Colored)
            {
                mSpriteNormal = new Sprite(ExtraFunctions.fillArrayWithImages(3, "gameplay\\macromap\\barco"), new int[] { 0, 1, 2, 1 }, 9, 132, 109, false, false);
            }
            else
            {
                mSpriteNormal = new Sprite(ExtraFunctions.fillArrayWithImages(3, "gameplay\\macromap\\barcobw"), new int[] { 0, 1, 2, 1 }, 9, 132, 109, false, false);
            }

            addSprite(mSpriteNormal, sSTATE_NORMAL);
            //addSprite(mSpriteExploding, sSTATE_EXPLODING);

            changeToSprite(sSTATE_NORMAL);

            setCollisionRect(40, 40);

            setLocation(position);
            setVisible(true);

            pos = new Vector2(300, 0);
        }
Exemplo n.º 6
0
        public Cursor()
        {
            int sizeBrushInGame = 90;

            mSpriteNormal = new Sprite(ExtraFunctions.fillArrayWithImages(1, "gameplay\\cursors\\cursor"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 1 }, 1, 93, 150, false, false);
            mSpriteBlue   = new Sprite(ExtraFunctions.fillArrayWithImages2(14, "gameplay\\cursors\\blue\\cursor"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 14 }, 1, sizeBrushInGame, sizeBrushInGame, false, false);
            mSpriteGreen  = new Sprite(ExtraFunctions.fillArrayWithImages2(14, "gameplay\\cursors\\green\\cursor"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 14 }, 1, sizeBrushInGame, sizeBrushInGame, false, false);
            mSpriteRed    = new Sprite(ExtraFunctions.fillArrayWithImages2(14, "gameplay\\cursors\\red\\cursor"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 14 }, 1, sizeBrushInGame, sizeBrushInGame, false, false);

            addSprite(mSpriteNormal, sSTATE_NORMAL);
            addSprite(mSpriteBlue, sSTATE_BLUE);
            addSprite(mSpriteGreen, sSTATE_GREEN);
            addSprite(mSpriteRed, sSTATE_RED);

            changeToSprite(sSTATE_NORMAL);

            setCollisionRect(0, 0, 40, 40);

            for (int i = 0; i < tracers.Length; i++)
            {
                tracers[i]       = new Tracer();
                tracers[i].alive = false;
            }
        }