Skip to content

Commit

Permalink
Merge pull request #30 from iCarambaa/patch-1
Browse files Browse the repository at this point in the history
Make nycan cat move back- and forwards.
  • Loading branch information
avatsaev authored Sep 24, 2018
2 parents b4d2ac4 + 22ecae8 commit 1b3fafa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions touchbar_nyancat/NyanCatCanvas.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ class NyanCatCanvas: NSImageView {

}

var direction: CGFloat = 1
@objc public func moveNyancat() {
if (xPosition < 0) {
xPosition += 1
xPosition += direction
if xPosition > 0 {
direction = -1
} else if xPosition < -680 {
direction = 1
}
}

Expand Down

0 comments on commit 1b3fafa

Please sign in to comment.