update code for 03 guide

This commit is contained in:
faiface 2017-04-03 17:38:12 +02:00
parent 9c2e71b5d5
commit 2286a87ebe
1 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package main
import ( import (
"image" "image"
"os" "os"
"time"
_ "image/png" _ "image/png"
@ -46,8 +47,12 @@ func run() {
angle := 0.0 angle := 0.0
last := time.Now()
for !win.Closed() { for !win.Closed() {
angle += 0.05 dt := time.Since(last).Seconds()
last = time.Now()
angle += 3 * dt
win.Clear(colornames.Firebrick) win.Clear(colornames.Firebrick)