示例#1
0
func TestNull(t *testing.T) {
	hb := hitbox.NewNull()

	contour := hb.Contour(nil)
	if len(contour) != 0 {
		t.Fatal("Null hitbox contour must be empty")
	}
}
示例#2
0
文件: game.go 项目: emersion/miko
func GetHitbox(sprite message.Sprite) hitbox.Hitbox {
	switch sprite {
	case PlaceholderSprite:
		return hitbox.NewNull()
	case PlayerSprite:
		return hitbox.NewCircle(10)
	case BallSprite:
		return hitbox.NewCircle(10)
	}
	return nil
}