add -timescale to command line to speed up or slow down time on server, try 0.1 - 2.0 range for fun
This commit is contained in:
parent
43b68f27f8
commit
bad900997f
3
main.go
3
main.go
@ -13,6 +13,7 @@ import (
|
||||
|
||||
var addr = flag.String("addr", ":8666", "http service address")
|
||||
var tick = flag.Int("tick", 60, "")
|
||||
var timescale = flag.Float64("timescale", 1, "time scale factor")
|
||||
var verbose = flag.Bool("verbose", false, "")
|
||||
var width = flag.Float64("width", 800, "width of field")
|
||||
var height = flag.Float64("height", 550, "height of field")
|
||||
@ -42,7 +43,7 @@ func main() {
|
||||
games = MapLock{m: make(map[string]*game)}
|
||||
idg = NewIdGenerator()
|
||||
|
||||
delta = float32(*tick) / 1000
|
||||
delta = (float32(*tick) / 1000.0) * float32(*timescale)
|
||||
|
||||
http.Handle("/ws/", websocket.Handler(addPlayer))
|
||||
http.Handle("/game/start/", JsonHandler(startGame))
|
||||
|
Loading…
Reference in New Issue
Block a user