Merge pull request #30 from iCarambaa/patch-1

Make nycan cat move back- and forwards.
This commit is contained in:
Aslan Vatsaev 2018-09-24 11:51:05 +02:00 committed by GitHub
commit 1b3fafacd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}
}