Пример #1
0
        protected virtual void init()
        {
            bounds = new cAABB(0, 0, 1, 1);
            bounds.SetDims(new Vector2f(Constants.CHAR_COLLISON_RECT.Width, Constants.CHAR_COLLISON_RECT.Height));
            bounds.SetPosByTopLeft(position);

            this.hitCollisionRect.SetDims(new Vector2f(32.0f, 32.0f));
            this.hitCollisionRect.SetPosByTopLeft(position);

            shape           = new RectangleShape();
            shape.FillColor = Color.Green;
            shape.Size      = new Vector2f(bounds.dims.X, bounds.dims.Y);

            isJumpActive        = false;
            isOnGround          = false;
            isOnOnewWayPlatform = false;

            horizontalFacing = HorizontalFacing.FACING_RIGHT;

            //must call, else not working
            spriteControl.ChangeState(this.GetSpriteState());

            this.health = 1;
        }