mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-24 18:02:02 +01:00
parent
4088de5349
commit
5b22a1218e
@ -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{}))
|
||||
|
@ -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},
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user