Update() private method

private Update ( ) : void
return void
Beispiel #1
0
        public void Update(GameTime gametime)
        {
            foreach (var updateable in mUpdateables)
            {
                updateable.Update(gametime);
            }

            List <ISpatial> copyList = (mSpatialObjects.Concat(mMap.GetStructureMap().GetPlatformList()).ToList());

            foreach (var spatial in copyList)
            {
                var collidingObject = spatial as ICollider;

                if (collidingObject != null)
                {
                    mMap.UpdateCollider(collidingObject);
                }

                spatial.RelativePosition = Vector2.Transform(spatial.AbsolutePosition, mCamera.GetTransform());
                spatial.RelativeSize     = spatial.AbsoluteSize * mCamera.GetZoom();

                spatial.Update(gametime);
            }
            mMap.GetStructureMap().Update(gametime);

            mFow.Update(gametime);

            mTransformMatrix = mCamera.GetTransform();
        }
Beispiel #2
0
    //Update the level
    public void update(GameTime gameTime)
    {
        // GameEnvironment.getCamera().getScreenSize();
        // Console.WriteLine(mousePos);
        level.update(gameTime);
        fog.Update();

        if (level._tempBuilding != null)
        {
            if (level.Player.Gold < level._tempBuilding.GoldCost && level.Player.Wood < level._tempBuilding.LumberCost)
            {
                canBuild = false;
            }
        }
    }
Beispiel #3
0
        public void Update(GameTime gameTime)
        {
            for (int i = gatherBalls.Count - 1; i >= 0; i--)
            {
                gatherBalls[i].Update(gameTime);

                if (gatherBalls[i].IsOver)
                {
                    gatherBalls.RemoveAt(i);
                }
            }
            fogofwar.Update(gameTime);
            //foreach ( City city in cities)
            //{
            //    city.Update(gameTime);


            //}

            //for (int i = 0; i < naturalResource.Length; i++)
            //{
            //    naturalResource[i].Update(gameTime);
            //}
        }