Day 13 solution
This was incredibly cool and I had a really fun time with it. Uncomment the draw and sleep in Part2 to see the game play itself! Note that I'm not seeking around in the terminal window to make the drawing smooth, I'm just outputting each new frame as it happens, so there's some jitter, but it still looks great! I messed around a bit with control codes to move the cursor around instead of the "draw the buffer over and over again" approach, and they work, mostly, but I'm sticking with this for now.
This commit is contained in:
@ -37,6 +37,11 @@ func (v Vec2[T]) AngleBetween(other Vec2[T]) float64 {
|
||||
return rad * 180 / math.Pi
|
||||
}
|
||||
|
||||
func (v Vec2[T]) Equals(other Vec2[T]) bool {
|
||||
return v.X == other.X &&
|
||||
v.Y == other.Y
|
||||
}
|
||||
|
||||
func VecBetween[T Number](a, b Vec2[T]) Vec2[T] {
|
||||
return Vec2[T]{
|
||||
X: a.X - b.X,
|
||||
|
Reference in New Issue
Block a user