go-tetris/tetris.go

31 lines
425 B
Go
Raw Normal View History

2017-03-27 15:07:29 -05:00
package main
import (
"math/rand"
2017-03-27 15:07:29 -05:00
"os"
"path/filepath"
"time"
2017-03-27 15:07:29 -05:00
"gopkg.in/inconshreveable/log15.v2"
2017-03-27 15:07:29 -05:00
)
func main() {
baseDir, _ = filepath.Abs(filepath.Dir(os.Args[0]))
logger = log15.New()
if baseDir != "" {
logger.SetHandler(log15.Must.FileHandler(baseDir+"/tetris.log", log15.LogfmtFormat()))
}
rand.Seed(time.Now().UnixNano())
NewMinos()
NewBoard()
NewView()
NewEngine()
2017-03-27 15:07:29 -05:00
engine.Run()
view.Stop()
}