Move all engine stuff to GoRetro. Still many interactions between game and engine code that there should not be.

This commit is contained in:
stevenhowes
2022-01-03 22:13:34 +00:00
commit 4d1ab58ca4
19 changed files with 976 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package GoRetro
import "math"
type Vector struct {
X float64
Y float64
}
func vectorAdd(v1, v2 Vector) Vector {
return Vector{
X: v1.X + v2.X,
Y: v1.Y + v2.Y,
}
}
func vectorDistance(v1, v2 Vector) float64 {
return math.Sqrt(math.Pow(v2.X-v1.X, 2) +
math.Pow(v2.Y-v1.Y, 2))
}