objects have HP now, only direct hits hurt them
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
type Obstacle struct {
|
||||
Bounds v.Rect2d `json:"bounds"`
|
||||
Hp int `json:"-"`
|
||||
}
|
||||
|
||||
func (o Obstacle) distance_from_point(p v.Point2d) float32 {
|
||||
@@ -48,6 +49,7 @@ func GenerateObstacles(count int, width, height float32) []Obstacle {
|
||||
A: v.Point2d{X: x, Y: y},
|
||||
B: v.Point2d{X: 20 + x + w, Y: 20 + y + h},
|
||||
},
|
||||
Hp: 10000,
|
||||
})
|
||||
}
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user