Exemplo n.º 1
0
 public void Draw(PrimitiveRender primitiveRender, SpriteBatch spriteBatch)
 {
     if (IsActive)
     {
         mBuildingBlock.Draw(primitiveRender);
     }
 }
Exemplo n.º 2
0
 public override void Draw(PrimitiveRender primitiveRender)
 {
     if (mIsActive)
     {
         mBox.Draw(primitiveRender);
     }
 }
Exemplo n.º 3
0
 public void Draw(PrimitiveRender primitiveRender, SpriteBatch spriteBatch)
 {
     if (mIsActive)
     {
         mBuildingBox.Draw(primitiveRender);
     }
 }
Exemplo n.º 4
0
 public void Draw(PrimitiveRender primitiveRender)
 {
     if (mIsActive)
     {
         mBox.Draw(primitiveRender);
     }
 }
Exemplo n.º 5
0
 public void Draw(PrimitiveRender primitiveRender)
 {
     if (!mIsDestroyed)
     {
         Transform transform;
         mBody.GetTransform(out transform);
         //primitiveRender.DrawRectangle(transform, mSize.X, mSize.Y, mColor);
         primitiveRender.DrawSprite(transform, mSize.X, mSize.Y, mTexture);
     }
 }
Exemplo n.º 6
0
        protected override void Initialize()
        {
            spriteBatch    = new SpriteBatch(GraphicsDevice);
            mImmortalBoxes = new List <Box>();
            mBullets       = new List <Bullet>();
            mBasicEffect   = new BasicEffect(graphics.GraphicsDevice);
            mBasicEffect.VertexColorEnabled = true;
            mCamera          = new Camera(GraphicsDevice.Viewport, mBasicEffect);
            mPrimitiveRender = new PrimitiveRender(graphics.GraphicsDevice, Content, mCamera);
            mPlayer          = new Player();

            Vector2 gravity = new Vector2(0, -10f);

            mWorld                 = new World(gravity, true);
            mContactListener       = new ContactListener();
            mWorld.ContactListener = mContactListener;

            Vector2 pos  = new Vector2(0, 30);
            Vector2 size = new Vector2(2, 2);

            mBoxes = new List <Box>();

            AddPyramid(300, -19.5f, 12);

            pos  = new Vector2(0, -20);
            size = new Vector2(10000, 1);
            Box groundBox = new Box(mWorld, pos, size, "block", true, mPlayer);

            mImmortalBoxes.Add(groundBox);

            pos  = new Vector2(-20, -15);
            mGun = new Gun(mWorld, pos, mPlayer);

            mBuilder = new Builder(mWorld, mCamera, mPlayer);
            mBuilder.Activate();

            mUiManager = new UIManager(spriteBatch, Content, mBuilder, mGun);

            base.Initialize();
        }
Exemplo n.º 7
0
 public override void Draw(PrimitiveRender primitiveRender)
 {
     int count = (mCountBaseVertexs - 3) * 10 + 3;
     primitiveRender.DrawLineList(mTerrainDrawVertexs, count, Color.White);
 }
Exemplo n.º 8
0
 public override void Draw(PrimitiveRender primitiveRender)
 {
     if (!mIsDestroyed)
     {
         Transform transform;
         mBody.GetTransform(out transform);
         //primitiveRender.DrawRectangle(transform, mSize.X, mSize.Y, mColor);
         primitiveRender.DrawSprite(transform, mSize.X, mSize.Y, mTexture);
     }
 }
Exemplo n.º 9
0
 public override void Draw(PrimitiveRender primitiveRender)
 {
     mBaseBox.Draw(primitiveRender);
     mBarrelBox.Draw(primitiveRender);
 }
Exemplo n.º 10
0
 public abstract void Draw(PrimitiveRender primitiveRender);
Exemplo n.º 11
0
        protected override void Initialize()
        {
            mGameObjectCollection = new GameObjectCollection();
            spriteBatch = new SpriteBatch(GraphicsDevice);
            mImmortalBoxes = new List<Box>();
            mBasicEffect = new BasicEffect(graphics.GraphicsDevice);
            mBasicEffect.VertexColorEnabled = true;
            mCamera = new Camera(GraphicsDevice.Viewport, mBasicEffect);
            mPrimitiveRender = new PrimitiveRender(graphics.GraphicsDevice, spriteBatch, Content, mCamera);

            Vector2 gravity = new Vector2(0, -10f);
            mWorld = new World(gravity, true);
            mContactListener = new ContactListener();
            mWorld.ContactListener = mContactListener;

            mTerrain = new Terrain(mWorld);

            mBuilder = new Builder(mWorld, mCamera, mGameObjectCollection);

            mUiManager = new UIManager(spriteBatch, Content, mBuilder);
            mGameplay = new Gameplay.Gameplay(mCamera, mUiManager);
            mPlayer = mGameplay.Player1;

            Vector2 pos = new Vector2(0, 30);
            Vector2 size = new Vector2(2, 2);

            pos = new Vector2(-150, -7);
            Gun gunPlayer1 = new Gun(mWorld, pos, mPlayer);
            mGameObjectCollection.Guns.Add(gunPlayer1);
            mPlayer.Guns.Add(gunPlayer1);

            pos = new Vector2(140, -7);
            Gun gunPlayer2 = new Gun(mWorld, pos, mGameplay.Player2);
            mGameObjectCollection.Guns.Add(gunPlayer2);
            mGameplay.Player2.Guns.Add(gunPlayer2);

            List<Box> baseBoxes = PlayerBaseFactory.CreateBuilding(mWorld, mGameplay, EntityCategory.Player1);
            mGameObjectCollection.Boxes.AddRange(baseBoxes);

            baseBoxes = PlayerBaseFactory.CreateBuilding(mWorld, mGameplay, EntityCategory.Player2);
            mGameObjectCollection.Boxes.AddRange(baseBoxes);

            mGameplay.StartGame();
            mBuilder.Activate();
            base.Initialize();
        }
Exemplo n.º 12
0
 public void Draw(PrimitiveRender primitiveRender)
 {
     mBaseBox.Draw(primitiveRender);
     mBarrelBox.Draw(primitiveRender);
 }