Tons of experimental updates.
This commit is contained in:
40
objects/bobble.go
Normal file
40
objects/bobble.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package objects
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
p "loading/point"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultRadius = 20
|
||||
)
|
||||
|
||||
type Bobble struct {
|
||||
Radius float32
|
||||
Pose p.Point
|
||||
Id string
|
||||
Color color.RGBA
|
||||
Bordercolor color.RGBA
|
||||
}
|
||||
|
||||
func NewBobble() Bobble {
|
||||
//default bobble values, with white center and black border
|
||||
return Bobble{
|
||||
Radius: defaultRadius,
|
||||
Pose: p.Point{X: 0, Y: 0},
|
||||
Color: color.RGBA{0xFF, 0xFF, 0xFF, 0xFF},
|
||||
Bordercolor: color.RGBA{0x00, 0x00, 0x00, 0xFF},
|
||||
Id: "ID-" + strconv.Itoa(rand.Intn(100)),
|
||||
}
|
||||
}
|
||||
|
||||
func GetDefaultRadius() float32 {
|
||||
return float32(defaultRadius)
|
||||
}
|
||||
|
||||
func (b *Bobble) SetPose(x float32, y float32) {
|
||||
b.Pose.X = x
|
||||
b.Pose.Y = y
|
||||
}
|
||||
Reference in New Issue
Block a user