Changed to use user-provided stats.
This commit is contained in:
parent
7f75104f3a
commit
e391cd3a0b
15
main.go
15
main.go
@ -1,11 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bitbucket.org/hackerbots/botserv/protocol"
|
||||
v "bitbucket.org/hackerbots/vector"
|
||||
"code.google.com/p/go.net/websocket"
|
||||
"flag"
|
||||
"fmt"
|
||||
"bitbucket.org/hackerbots/botserv/protocol"
|
||||
v "bitbucket.org/hackerbots/vector"
|
||||
"log"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
@ -98,7 +98,7 @@ func addPlayer(ws *websocket.Conn) {
|
||||
log.Printf("%s invalid config", id)
|
||||
}
|
||||
}
|
||||
log.Printf("%s eventually sent valid config", id)
|
||||
log.Printf("%s eventually sent valid config: %+v", id, conf)
|
||||
|
||||
start_pos := v.Point2d{
|
||||
X: rand.Float64() * *width,
|
||||
@ -106,16 +106,11 @@ func addPlayer(ws *websocket.Conn) {
|
||||
}
|
||||
p := &player{
|
||||
Robot: robot{
|
||||
Stats: stats{
|
||||
Speed: *velocity,
|
||||
Hp: 200,
|
||||
WeaponRadius: 35,
|
||||
ScannerRadius: 200,
|
||||
},
|
||||
Stats: conf.Stats,
|
||||
Position: start_pos,
|
||||
MoveTo: start_pos,
|
||||
Id: id,
|
||||
Health: 200,
|
||||
Health: conf.Stats.Hp,
|
||||
Scanners: make([]scanner, 0)},
|
||||
send: make(chan *boardstate),
|
||||
ws: ws,
|
||||
|
@ -1,8 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"code.google.com/p/go.net/websocket"
|
||||
v "bitbucket.org/hackerbots/vector"
|
||||
"code.google.com/p/go.net/websocket"
|
||||
"log"
|
||||
"math/rand"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user