From 47d1a1ca51ba48e72e0f073850ed241f7c1a8bcb Mon Sep 17 00:00:00 2001 From: Nick Van Dyck Date: Thu, 19 Jul 2018 22:39:57 +0100 Subject: [PATCH] Fixed rainbox tail, prepped 1.0.0 release --- CHANGELOG.md | 15 +++++++++++++++ Nyancat/NyancatScene.cs | 26 ++++++++++---------------- README.md | 9 +++++---- Version.props | 2 +- appveyor.yml | 2 +- 5 files changed, 32 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12e9207..8e3337a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,19 @@ # Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [v1.0.0] - 2018-07-19 +### Added +- Ability to switch between scenes +- Added introduction scene + +### Changed +- Updated README to show all command line arguments + +### Fixed +- Rainbow tail not rendering correct ## [v0.5.0] Minor improvements and bug fixes diff --git a/Nyancat/NyancatScene.cs b/Nyancat/NyancatScene.cs index a153220..5a3916d 100644 --- a/Nyancat/NyancatScene.cs +++ b/Nyancat/NyancatScene.cs @@ -72,16 +72,15 @@ public void Init() counter.Start(); } - private int frameId = 0; + private int frameId = -1; private string[] GetFrame() { - var frame = NyancatAnimation.Frames[frameId]; - frameId++; - if (frameId >= NyancatAnimation.Frames.Count) frameId = 0; + var frame = NyancatAnimation.Frames[frameId]; + return frame; } @@ -121,26 +120,21 @@ public void Render() if (row > 23 && row < 43 && col < 0) { - /* - * Generate the rainbow tail. - * - * This is done with a prettrow simplistic square wave. - */ - int mod_x = ((-col + 2) % 16) / 8; + // Generate the rainbow tail. + // This is done with a prettrow simplistic square wave. + int modX = ((-col + 2) % 16) / 8; if (((frameId / 2) % 2) != 0) { - mod_x++; + modX = 1 - modX; } - /* - * Our rainbow, with some padding. - */ + // Our rainbow, with some padding. string rainbow = ",,>>&&&+++###==;;;,,"; - var index = mod_x + row - 23; + var index = modX + row - 23; - if (index >= rainbow.Length) + if (index >= rainbow.Length || index < 0) index = 0; color = rainbow[index]; diff --git a/README.md b/README.md index 362eec6..ab8ce57 100644 --- a/README.md +++ b/README.md @@ -18,29 +18,30 @@ Nyancat running on dotnet core. Download the [2.1.300](https://www.microsoft.com/net/download/windows) .NET Core SDK or newer. Once installed, running the folling command: -``` +```sh dotnet tool install --global nyancat ``` Or use the following when upgrading from a previous version: -``` +```sh dotnet tool update --global nyancat ``` Type in the following command to get started -``` +```sh nyancat ``` ## Usage -``` +```sh Usage: nyancat [options] Options: --version Show version information + -i|--intro Show the introduction / about information at startup -n|--no-counter Do not display the timer -s|--no-title Do not set the titlebar text -f|--frames Display the requested number of frames, then quit diff --git a/Version.props b/Version.props index f0d2ecc..5a975af 100644 --- a/Version.props +++ b/Version.props @@ -1,6 +1,6 @@ - 0.5.0 + 1.0.0 $(APPVEYOR_REPO_COMMIT) $(VersionPrefix)-$(VersionSuffix) diff --git a/appveyor.yml b/appveyor.yml index dc0418f..ddcd102 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.5.0.{build} +version: 1.0.0.{build} os: Visual Studio 2017 environment: global: