예제 #1
0
 private void init()
 {
     mSprite = new AnimatedSprite();
     mSprite.setOrigin(new Vector2(mSprite.getSourceRect().Width / 2, mSprite.getSourceRect().Height / 2));
 }
예제 #2
0
        private void init()
        {
            isAlive = true;
            mSprite = new AnimatedSprite();
            input = new GetInput(PlayerIndex.One);
            attachEventListener();

            mSprite.setSourceRect(new Microsoft.Xna.Framework.Rectangle(CelX, CelY, CelWidth, CelHeight));

            mSprite.mCurrentCel = 0;
            mSprite.mNumberOfCels = mCels;
            mSprite.msUntilNextCel = 100;
            mSprite.msPerCel = 100;

            mSprite.setScale(new Vector2(1.5f));
            mSprite.setOrigin(new Vector2(mSprite.getSourceRect().Width / 2, mSprite.getSourceRect().Height / 2));
            mPosition = new Vector2(640 - (mSprite.getSourceRect().Width / 2), 360 - (mSprite.getSourceRect().Height / 2));
            mVelocity = new Vector2(0);
        }