Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Rope physics experimentation

Author
Message
CodeTrasher
12
Years of Service
User Offline
Joined: 18th Jul 2012
Location: Tampere, Finland
Posted: 28th Jul 2016 13:54
Hi all,

if this isn't the correct place to post this, I apologize. I just thought I'd share my for those who might find this useful in their current projects.

I haven't really played around 2D physics related projects that much but I have always wanted to implement some sort of rope physics in my games and I thought I'd experiment a little with it.

Below is the code I have currently, feel free to copy and use as you please. What the code does is that it create a small amount of rope sprites connected with distance joints with each other, and one of the sprites is connected to a static sprite. This makes the rope hang freely. You can drag any part of the rope with a mouse and move the rope freely. I'll upload the rope image as well.

Here's the code:

Mah machine: Intel Xeon E3-1231v3 4x3.40GHz | CM Hyper 212 Evo | ASRock H97 Pro4 | 240GB SanDisk SSD | Sapphire Radeon R9 270X Dual-X 2048MB | Seagate HDD 1000GB |
8GB Crucial Ballistix Sport DDR3-1600

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-25 03:38:30
Your offset time is: 2024-11-25 03:38:30