From baaa39d463eb10d91c22e6421e10042c3be7fdf7 Mon Sep 17 00:00:00 2001 From: faiface Date: Wed, 24 May 2017 00:01:33 +0200 Subject: [PATCH] fiddle with constants in typewriter example --- typewriter/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/typewriter/main.go b/typewriter/main.go index 6b4bb95..eb36cbd 100644 --- a/typewriter/main.go +++ b/typewriter/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "image/color" "math" "math/rand" @@ -120,7 +121,7 @@ func (tw *typewriter) Draw(t pixel.Target, m pixel.Matrix) { func typeRune(tw *typewriter, r rune) { tw.Ribbon(r) if !unicode.IsSpace(r) { - go shake(tw, 3, 30) + go shake(tw, 3, 17) } } @@ -149,6 +150,7 @@ func shake(tw *typewriter, intensity, friction float64) { intensity -= friction * dt tw.Offset(off) + fmt.Println(off) } }