SzarkEngine 1.0.5

dotnet add package SzarkEngine --version 1.0.5
                    
NuGet\Install-Package SzarkEngine -Version 1.0.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SzarkEngine" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SzarkEngine" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="SzarkEngine" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SzarkEngine --version 1.0.5
                    
#r "nuget: SzarkEngine, 1.0.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=SzarkEngine&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=SzarkEngine&version=1.0.5
                    
Install as a Cake Tool

Getting Starting Example (Pong)

using System;
using Szark;

namespace Example
{
    class PongExample : SzarkEngine
    {
        private const float playerSpeed = 500;
        private const float enemyDifficulty = 4;

        private float playerY, enemyY;
        private Vector ballPos, ballVel;

        private int playerScore, enemyScore;
        private bool ballShot;

        private Sprite paddle, line, ball;

        PongExample() : base("Pong Example",
            1280, 720) { }

        protected override void Start()
        {
            paddle = new Sprite(16, 128);
            paddle.ClearToColor(Color.White);

            line = new Sprite(8, Height);
            line.ClearToColor(Color.White);

            ball = new Sprite(16, 16);
            ball.ClearToColor(Color.White);
        }

        protected override void Update(float deltaTime)
        {
            /* Player Code */

            playerY += deltaTime * playerSpeed * 
                (Input.GetKey("W") ? 1 : Input.GetKey("S") ? -1 : 0);
            playerY = Mathf.Clamp(playerY, -Height + 144, Height - 144);

            if (!ballShot && Input.GetKeyDown("Space"))
            {
                ballShot = true;
                ballVel.x = 800;
                ballVel.y = new Random().Next(-800, 800);
            }

            /* Enemy Code */

            enemyY = Mathf.Lerp(enemyY, ballPos.y, enemyDifficulty * deltaTime);
            enemyY = Mathf.Clamp(enemyY, -Height + 144, Height - 144);

            /* Ball Code */

            ballPos += ballVel * deltaTime;
            ballPos.x = ballShot ? ballPos.x : -Width + 128;
            ballPos.y = ballShot ? ballPos.y : playerY;

            if (ballPos.y > Height - 16 || ballPos.y < -Height + 16)
                ballVel.y *= -1;

            bool hitEnemyPaddle = ballPos.y < enemyY + 128 &&
                ballPos.y > enemyY - 128 && ballPos.x > Width - 88;
            bool hitPlayerPaddle = ballPos.y < playerY + 128 &&
                ballPos.y > playerY - 128 && ballPos.x < -Width + 88;

            if (hitEnemyPaddle || hitPlayerPaddle)
            {
                ballVel.x *= -1;
                ballVel.y += new Random().Next(-250, 250);
            }

            if (ballPos.x > Width)
            {
                ballShot = false;
                playerScore++;
                Debug.Log("Player Scored!");
                Debug.Log($"{playerScore} | {enemyScore}");
            }

            if (ballPos.x < -Width)
            {
                ballShot = false;
                enemyScore++;
                Debug.Log("Enemy Scored!");
                Debug.Log($"{playerScore} | {enemyScore}");
            }
        }

        protected override void Draw(float deltaTime)
        {
            paddle.Render(-Width + 64, playerY);
            paddle.Render(Width - 64, enemyY);
            ball.Render(ballPos.x, ballPos.y);
            line.Render(0, 0);
        }

        protected override void Destroyed() { }

        static void Main() => new PongExample();
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 672 4/13/2019