Grappling Hook game, now without blobs

Published September 07, 2014
Advertisement
grapple.jpg

Decided on a bit of a change for the grappling hook game. I ditched the blob, as it was more trouble than it was worth, didn't work properly and was detracting from the main point of the game, which is classy grappling hook action.

I also decided to stop modelling the rope as a list of small bodies and go with the far more complex route of using a single joint, then using ray casts to check for intersections with the scenery and subdivide it into segments at collision points.



At the moment it is only working with static geometry. This is quite simple, as you only have to have an actual joint between the last point and the player. The rest are just drawn as lines but have no physical presence. And you only have to check the player to last point to simplify the rope when the line of sight becomes valid again.

Feels pretty nice to use. Need to build a bigger level to really find out how it feels, which will need some kind of editor as usual. Round we go in circles smile.png

I made of copy of b2DistanceJoint called b2SoftRopeJoint in my Box2D source and then modified it until it only constrains you when the distance is greater than the rope length and the rope shortens as you get closer to the attach point. This feels a lot better as the rope now isn't a stiff pole between you and the ground and feels much more like how I want.

Extending this to work with moving objects is going to be a lot harder. Going to have to create joints between more than just the last two points for example - you can see at the end of the video how the box drops to the floor because there is no joint between it and the scenery one a new point is added. There are also some horrendous issues that come up if a moving object crosses the path of the rope somewhere along its segments that will take a bit of solving, but hopefully can be addressed by just raytesting every rope segment in both directions. Have to see.

Thanks for reading.
Previous Entry Blob Grappling Hooks
Next Entry Grappling away...
5 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement