Beispiel #1
0
        public void SetupAnimations()
        {
            ZAnimationInfo info = new ZAnimationInfo();

            info.numFrames = 1;
            for (int i = 0; i < info.numFrames; i++)
            {
                if ((int)movement == (int)CowMovement.kCowWalkingLeft)
                {
                    info.texture [i] = (Globals.g_world.game).GetTexture(TextureType.kTexture_Cow);
                }
                else if ((int)movement == (int)CowMovement.kCowWalkingRight)
                {
                    info.texture[i] = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_Cow2);
                }
                else
                {
                    int r = Utilities.GetRand(2);
                    info.texture[i] = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_Cow + r);
                }

                info.frameTime[i] = 5;
            }

            info.gapType = GapType.kAnimGapDistance;
            (anim[(int)CowAnimation.n_Walk]).Setup(info);
            for (int i = 0; i < info.numFrames; i++)
            {
                info.texture[i]   = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_Cow2);
                info.frameTime[i] = 0.2f;
            }

            info.gapType = GapType.kAnimGapTime;
            (anim[(int)CowAnimation.n_FallOver]).Setup(info);
        }
Beispiel #2
0
        }                                                         ///@property(readwrite,assign) int currentFrame;

        public void SetupP1(ZAnimationInfo info, float standardGap)
        {
            justChangedFrame = false;
            numFrames        = info.numFrames;
            Globals.Assert(numFrames <= (int)Enum.kMaxTexturesInAnim);
            for (int i = 0; i < numFrames; i++)
            {
                info.frameTime[i] = standardGap;
            }

            this.Setup(info);
        }
        public int AddAnimation(ZAnimationInfo zInfo)
        {
            Globals.Assert(numAnimations < (int)Enum.kMaxAnimationsPerCharacter);
            if (anim[numAnimations] == null)
            {
                anim[numAnimations] = new Zanimation();
            }

            (anim[numAnimations]).Setup(zInfo);
            numAnimations++;
            return(numAnimations - 1);
        }
Beispiel #4
0
        public void SetupAnimations()
        {
            ZAnimationInfo info = new ZAnimationInfo();

            info.numFrames = 1;
            for (int i = 0; i < info.numFrames; i++)
            {
                info.texture[i]   = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_CowPat);
                info.frameTime[i] = 5;
            }

            info.gapType = GapType.kAnimGapDistance;
            (anim[(int)CowPatAnimation.n_Splat]).Setup(info);
        }
Beispiel #5
0
        public void SetupAnimations()
        {
            ZAnimationInfo info = new ZAnimationInfo();

            info.numFrames = 5;
            if (facingDirection == (int)ChickenDirection.kChickenFacingLeft)
            {
                info.subTextureId [0] = 17;
                info.subTextureId [1] = 18;
                info.subTextureId [2] = 19;
                info.subTextureId [3] = 18;
                info.subTextureId [4] = 17;
            }
            else
            {
                info.subTextureId [0] = (short)World.Enum2.kGTMud_ChickenPeck1;
                info.subTextureId [1] = (short)World.Enum2.kGTMud_ChickenPeck2;
                info.subTextureId [2] = (short)World.Enum2.kGTMud_ChickenPeck3;
                info.subTextureId [3] = (short)World.Enum2.kGTMud_ChickenPeck2;
                info.subTextureId [4] = (short)World.Enum2.kGTMud_ChickenPeck1;
            }

            for (int i = 0; i < info.numFrames; i++)
            {
                info.frameTime [i] = 0.06f;
            }

            info.gapType = GapType.kAnimGapTime;
            (anim [(int)ChickenAnimation.n_Peck]).Setup(info);
            info.numFrames = 2;
            if (facingDirection == (int)ChickenDirection.kChickenFacingLeft)
            {
                info.subTextureId [0] = (short)World.Enum2.kGTMud_ChickenFly1;
                info.subTextureId [1] = (short)World.Enum2.kGTMud_ChickenFly2;
            }
            else
            {
                info.subTextureId [0] = (short)World.Enum2.kGTMud_ChickenFly1;
                info.subTextureId [1] = (short)World.Enum2.kGTMud_ChickenFly2;
            }

            for (int i = 0; i < info.numFrames; i++)
            {
                info.frameTime[i] = 0.06f;
            }

            info.gapType = GapType.kAnimGapTime;
            (anim[(int)ChickenAnimation.n_RunAway]).Setup(info);
        }
Beispiel #6
0
        public void Setup(ZAnimationInfo info)
        {
            numFrames = info.numFrames;
            Globals.Assert(numFrames <= (int)Enum.kMaxTexturesInAnim);
            float gapTotal = 0;

            for (int i = 0; i < numFrames; i++)
            {
                gapTotal       += info.frameTime[i];
                texture[i]      = info.texture[i];
                subTextureId[i] = info.subTextureId[i];
                frameTime[i]    = gapTotal;
            }

            state        = AnimationState.kAnimNotStarted;
            gapType      = info.gapType;
            currentFrame = 0;
        }
Beispiel #7
0
        public void SetupAnimations()
        {
            ZAnimationInfo info = new ZAnimationInfo();

            info.numFrames = 13;
            for (int i = 0; i < info.numFrames; i++)
            {
                info.texture[i]   = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_FlyingFlower1 + i);
                info.frameTime[i] = 0.1f;
            }

            info.gapType   = GapType.kAnimGapTime;
            info.numFrames = 7;
            for (int i = 0; i < info.numFrames; i++)
            {
                info.texture[i]   = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_FlyingFlowerShadow1 + i);
                info.frameTime[i] = 0.1f;
            }

            info.gapType = GapType.kAnimGapTime;
        }
Beispiel #8
0
        public void SetupAnimations()
        {
            int            kStartGateSubtextures = 184;
            ZAnimationInfo aInfo      = new ZAnimationInfo();
            ZAnimationInfo aCloseInfo = new ZAnimationInfo();

            aInfo.numFrames      = 6;
            aInfo.gapType        = GapType.kAnimGapTime;
            aCloseInfo.numFrames = 6;
            aCloseInfo.gapType   = GapType.kAnimGapTime;
            if ((int)type == (int)StartingGateType.e_Left)
            {
                for (int i = 0; i < 6; i++)
                {
                    aCloseInfo.subTextureId[i] = kStartGateSubtextures + 5 - i;
                    aInfo.texture[i]           = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_GateLeft1 + i);
                    aInfo.frameTime[i]         = 0.04f;
                    aInfo.subTextureId[i]      = kStartGateSubtextures + i;
                    aCloseInfo.texture[i]      = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_GateLeft6 - i);
                    aCloseInfo.frameTime[i]    = 0.04f;
                }
            }
            else
            {
                kStartGateSubtextures += 6;
                for (int i = 0; i < 6; i++)
                {
                    aCloseInfo.subTextureId[i] = kStartGateSubtextures + 5 - i;
                    aInfo.texture[i]           = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_GateRight1 + i);
                    aInfo.frameTime[i]         = 0.04f;
                    aInfo.subTextureId[i]      = kStartGateSubtextures + i;
                    aCloseInfo.texture[i]      = (Globals.g_world.game).GetTexture((TextureType)TextureType.kTexture_GateRight6 - i);
                    aCloseInfo.frameTime[i]    = 0.04f;
                }
            }

            aCloseInfo.frameTime[0] = 0.12f;
            animOpen.Setup(aInfo);
            animClose.Setup(aCloseInfo);
        }
        public void Setup(ArrowInfo info)
        {
            hasLeftScreen = false;
            type          = info.type;
            position      = info.position;
            mapObjectId   = info.mapObjectId;
            groundLevel   = 0.0f;
            for (int y = 0; y < (int)Enum.kNumBoostPoints; y++)
            {
                boostPointPosition[y] = Utilities.CGPointMake(info.position.x, -50 + info.position.y + ((float)y * 22));
                for (int i = 0; i < (int)Enum.kBAMaxPlayers; i++)
                {
                    pointHit[i, y] = false;
                }
            }

            ZAnimationInfo zaInfo = new ZAnimationInfo();

            zaInfo.numFrames = 5;
            for (int i = 0; i < zaInfo.numFrames; i++)
            {
                zaInfo.frameTime[i] = 0.2f;
                if ((int)((Globals.g_world.game).lBuilder).currentScene == (int)SceneType.kSceneGrass)
                {
                    zaInfo.subTextureId[i] = (short)(6 + i);
                }
                else
                {
                    zaInfo.subTextureId[i] = (short)(49 + i);
                }
            }

            zaInfo.gapType = GapType.kAnimGapTime;
            anim.Setup(zaInfo);
            anim.PlayLooping();
        }