@@ -4,10 +4,10 @@ import (
44 "github.com/hajimehoshi/ebiten/v2"
55 "github.com/hajimehoshi/ebiten/v2/ebitenutil"
66 "image/color"
7- "physix /pkg/polygon"
8- "physix /pkg/vector"
9- "physix /internal/physics"
10- "physix /internal/collision"
7+ "github.com/rudransh61/Physix-go /pkg/polygon"
8+ "github.com/rudransh61/Physix-go /pkg/vector"
9+ "github.com/rudransh61/Physix-go /internal/physics"
10+ "github.com/rudransh61/Physix-go /internal/collision"
1111 "fmt"
1212)
1313
2121func update () error {
2222 // Apply a force to simulate gravity
2323 gravity := vector.Vector {X : 0 , Y : 10 }
24- physix .ApplyForcePolygon (ball , gravity , dt )
25- physix .ApplyForcePolygon (ball2 , gravity , dt )
24+ github . com / rudransh61 / Physix - go .ApplyForcePolygon (ball , gravity , dt )
25+ github . com / rudransh61 / Physix - go .ApplyForcePolygon (ball2 , gravity , dt )
2626
2727 if ball .Position .Y < 0 || ball .Position .Y > 400 {
2828 ball .Velocity .Y = - 10
@@ -45,7 +45,7 @@ if collision.PolygonCollision(ball, ball2) {
4545
4646
4747func draw (screen * ebiten.Image ) {
48- // Draw the ball using the physix engine's position
48+ // Draw the ball using the github.com/rudransh61/Physix-go engine's position
4949 // calculateCentroid calculates the centroid of a polygon given its vertices.
5050 for _ , v := range ball .Vertices {
5151 ebitenutil .DrawRect (screen , v .X , v .Y , 10 , 10 , color.RGBA {R : 0xff , G : 0 , B : 0 , A : 0xff })
@@ -75,7 +75,7 @@ func main() {
7575
7676 vertices := []vector.Vector {{X : 250 , Y : 50 }, {X : 200 , Y : 100 }, {X : 200 , Y : 50 }, {X : 350 , Y : 200 }}
7777
78- // Initialize a rigid body with your physix engine
78+ // Initialize a rigid body with your github.com/rudransh61/Physix-go engine
7979 ball = polygon .NewPolygon (vertices , 50 , true )
8080 ball2 = polygon .NewPolygon ( []vector.Vector {{X : 100 , Y : 50 }, {X : 50 , Y : 100 }, {X : 50 , Y : 50 }, {X : 200 , Y : 200 }}, 50 , true )
8181 ball2 .Velocity .X = 100
0 commit comments