examples: Fix warnings in the examples

Updates #889
This commit is contained in:
Hajime Hoshi 2019-10-07 03:05:06 +09:00
parent 4088de5349
commit 5b22a1218e
2 changed files with 5 additions and 5 deletions

View File

@ -66,7 +66,7 @@ func getPixel(x, y uint) int {
func makeBall(x, y float64) *cp.Shape {
body := cp.NewBody(1.0, cp.INFINITY)
body.SetPosition(cp.Vector{x, y})
body.SetPosition(cp.Vector{X: x, Y: y})
shape := cp.NewCircle(body, 0.95, cp.Vector{})
shape.SetElasticity(0)
@ -144,7 +144,7 @@ func main() {
}
body = space.AddBody(cp.NewBody(1e9, cp.INFINITY))
body.SetPosition(cp.Vector{-1000, 225})
body.SetPosition(cp.Vector{X: -1000, Y: 225})
body.SetVelocity(400, 0)
shape = space.AddShape(cp.NewCircle(body, 8, cp.Vector{}))

View File

@ -206,9 +206,9 @@ func handleMovement() {
func rayVertices(x1, y1, x2, y2, x3, y3 float64) []ebiten.Vertex {
return []ebiten.Vertex{
{float32(x1), float32(y1), 0, 0, 1, 1, 1, 1},
{float32(x2), float32(y2), 0, 0, 1, 1, 1, 1},
{float32(x3), float32(y3), 0, 0, 1, 1, 1, 1},
{DstX: float32(x1), DstY: float32(y1), SrcX: 0, SrcY: 0, ColorR: 1, ColorG: 1, ColorB: 1, ColorA: 1},
{DstX: float32(x2), DstY: float32(y2), SrcX: 0, SrcY: 0, ColorR: 1, ColorG: 1, ColorB: 1, ColorA: 1},
{DstX: float32(x3), DstY: float32(y3), SrcX: 0, SrcY: 0, ColorR: 1, ColorG: 1, ColorB: 1, ColorA: 1},
}
}