Add the concept of commands to the world and executing them

This commit is contained in:
Marc Di Luzio 2020-06-03 18:12:08 +01:00
parent 013a69fa63
commit e5d5d123a6
6 changed files with 163 additions and 19 deletions

View file

@ -1,6 +1,15 @@
package game
type Position struct {
X int `json:"x"`
Y int `json:"y"`
// Vector desribes a 3D vector
type Vector struct {
X float64 `json:"x"`
Y float64 `json:"y"`
Z float64 `json:"z"`
}
// Add adds one vector to another
func (v *Vector) Add(v2 Vector) {
v.X += v2.X
v.Y += v2.Y
v.Z += v2.Z
}