Skip to content

Commit

Permalink
Fixed rainbox tail, prepped 1.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
vandycknick committed Jul 19, 2018
1 parent d6d43a8 commit 47d1a1c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 22 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 10 additions & 16 deletions Nyancat/NyancatScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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];
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <FRAMES> Display the requested number of frames, then quit
Expand Down
2 changes: 1 addition & 1 deletion Version.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>0.5.0</VersionPrefix>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<SourceRevisionId>$(APPVEYOR_REPO_COMMIT)</SourceRevisionId>
<PackageVersion Condition="'$(APPVEYOR_REPO_TAG)' == 'true' AND '$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix)</PackageVersion>
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.5.0.{build}
version: 1.0.0.{build}
os: Visual Studio 2017
environment:
global:
Expand Down

0 comments on commit 47d1a1c

Please sign in to comment.