objects have HP now, only direct hits hurt them

This commit is contained in:
Fraser Graham
2013-11-17 08:21:36 -08:00
parent ae9d09596c
commit 4c4c0d4e67
2 changed files with 7 additions and 1 deletions
+2
View File
@@ -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