Pebble King engine test
Loading...
361
views
Loading...
Uploader Comments (andy00black)
see all
All Comments (8)
-
Uggh.. just deleted your comment on my game SpaceGate by mistake..
This is looking sweet by the way.. really reminds me of Gravity Force.
-
a true king
-
Looks very intriguing. Can't wait to see where you go with this.
-
That looks fun!
- Loading comment...
Loading...
Wow, the collision system is awesome.. I'd love to know how it's done.
PlayOrDieGames 1 year ago
@PlayOrDieGames thanks! For the collisions on the player what I did was check against an array full of the pebble objects. If the distance from the player's center to the center of each pebble is less than that pebble's radius plus the distance from the player's feet to his center, it first does some vector maths to basically clip away all motion in the direction from the player's center to the pebble's center, then makes sure the player isn't inside the pebble and moves him if he is. cheers
andy00black 1 year ago
@andy00black thanks for the clear explanation. So once it passes the distance check you set some kind of isSticking flag, then you use a circular momentum calculation of some kind? The vector math you mention sounds interesting. Whatever the maths is, well done for coming up with a really cool system. I will be watching this game with interest.
PlayOrDieGames 1 year ago
@PlayOrDieGames Thanks for the interest :D. It actually doesn't set any kind of isSticking flag or do circular momentum, it just does the calculation I described to clip the current velocity every frame. It also adds the gravity from each pebble within range of the player every frame (using the inverse square of the distance and the pebble's mass), which is how the player appears to stick to the pebbles. It's not great for a ton of objects+pebbles, but it should work well enough for simple play.
andy00black 1 year ago