Ejemplo n.º 1
0
 public Boxer(ResourcePool resourcePool)
 {
     mSpriteIdle         = new SheetedSprite(resourcePool.BoxerIdle, 4, 100);
     mSpriteJabbing      = new SheetedSprite(resourcePool.BoxerJabbing, 4, 100);
     mSpriteDuckAndCover = new SheetedSprite(resourcePool.BoxerDuckAndCover, 4, 100);
     mCurrentSprite      = mSpriteIdle;
     Position            = new Vector2(40, 0);
     mState               = State.Idle;
     mMoveVector          = Vector2.Zero;
     bCanJump             = true;
     iLastHeightOfTerrain = 999;
     mLastPosition        = new Vector2();
 }
Ejemplo n.º 2
0
 public Boxer(ResourcePool resourcePool)
 {
     mSpriteIdle = new SheetedSprite(resourcePool.BoxerIdle, 4, 100);
     mSpriteJabbing = new SheetedSprite(resourcePool.BoxerJabbing, 4, 100);
     mSpriteDuckAndCover = new SheetedSprite(resourcePool.BoxerDuckAndCover, 4, 100);
     mCurrentSprite = mSpriteIdle;
     Position = new Vector2(40, 0);
     mState = State.Idle;
     mMoveVector = Vector2.Zero;
     bCanJump = true;
     iLastHeightOfTerrain = 999;
     mLastPosition = new Vector2();
 }
Ejemplo n.º 3
0
        public Background(ResourcePool pool)
        {
            mSprite = new Sprite(pool.Background1);
            mSprite.Position = new Vector2( mSprite.Boundingbox.Width / 2, mSprite.Boundingbox.Height / 2);

            mSprites = new Sprite[2];
            Sprite s1 = new Sprite(pool.Background1);
            s1.Position = new Vector2(mSprite.Boundingbox.Width / 2, mSprite.Boundingbox.Height / 2);
            Sprite s2 = new Sprite(pool.Background1);
            s2.Position = new Vector2( (mSprite.Boundingbox.Width * 3) / 2, mSprite.Boundingbox.Height / 2);

            mSprites[0] = s1;
            mSprites[1] = s2;
        }
Ejemplo n.º 4
0
        public Background(ResourcePool pool)
        {
            mSprite          = new Sprite(pool.Background1);
            mSprite.Position = new Vector2(mSprite.Boundingbox.Width / 2, mSprite.Boundingbox.Height / 2);

            mSprites = new Sprite[2];
            Sprite s1 = new Sprite(pool.Background1);

            s1.Position = new Vector2(mSprite.Boundingbox.Width / 2, mSprite.Boundingbox.Height / 2);
            Sprite s2 = new Sprite(pool.Background1);

            s2.Position = new Vector2((mSprite.Boundingbox.Width * 3) / 2, mSprite.Boundingbox.Height / 2);

            mSprites[0] = s1;
            mSprites[1] = s2;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            CUtil.GraphicsDevice = this.GraphicsDevice;

            resourcePool       = new ResourcePool();
            CUtil.ResourcePool = this.resourcePool;

            CUtil.GameRate = 1.0f;

            // TODO: Add your initialization logic here
            prevState = Keyboard.GetState();

            camera       = new Camera();
            CUtil.Camera = camera;

            base.Initialize();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            CUtil.GraphicsDevice = this.GraphicsDevice;

            resourcePool = new ResourcePool();
            CUtil.ResourcePool = this.resourcePool;

            CUtil.GameRate = 1.0f;

            // TODO: Add your initialization logic here
            prevState = Keyboard.GetState();

            camera = new Camera();
            CUtil.Camera = camera;

            base.Initialize();
        }