protected void OnRecalcLevels()
        {
            var width = this.ClientSize.Width;

            state.XLevel = this.PointToScreen(new Point(width / 2, 0)).X;
            RecalcLevels?.Invoke(this, EventArgs.Empty);
        }
Exemplo n.º 2
0
        protected void OnRecalcLevels()
        {
            var height = this.ClientSize.Height;
            var width  = this.ClientSize.Width;

            state.YLevel0 = this.PointToScreen(new Point(0, (int)state.LevelGround * height / 1000)).Y;
            state.YLevel1 = this.PointToScreen(new Point(0, (int)state.LevelPlatform1 * height / 1000)).Y;
            state.YLevel2 = this.PointToScreen(new Point(0, (int)state.LevelPlatform2 * height / 1000)).Y;
            state.YLevel3 = this.PointToScreen(new Point(0, (int)state.LevelPlatform3 * height / 1000)).Y;

            state.MonkeyArea = this.RectangleToScreen(new Rectangle(width, 0, width + 50, height));

            RecalcLevels?.Invoke(this, EventArgs.Empty);
        }