rubber band

0 favourites
  • If anyone is interested I managed to solve this easily in the end by populating a variable of the can's the Y position upon impact with the band (set on an angle) then validating that as a condition before applying the force. :)

    Cheers

  • I know this is really old, but could someone re-upload this example please? R0J0hound, do you still have it?

  • illugion updated link

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • illugion updated link

    I've been tinkering with this .capx example and I wanted to know how I would go about making any adjustments.

    • Can you multiply the rubber bands?
    • Can you adjust the length?
    • Can you make the rubber bands disappear/reappear at random?

    I've only really managed to move the rubber band to another space on the layout. Any help would be appreciated.

  • YoHoho

    A simple way to do multiple would be to clone the band object, duplicate the events and change the old band of the new with replace.

    The length and location of the band is hard coded into the events. You'd have to change the positions of the bands, change the event that resets the band's angle and length when no can is on it (event 1), and change the event that sees if the can is on the band (three conditions on event 3).

    To appear and disappear it's probably as simple as destroying and creating the bands, and setting the length and position from what can be figured out with the previous question.

    Overall the capx wasn't really designed for a lot of that so it would have to be reworked. Maybe understanding what is done would be useful in making something that makes everything easier.

    basically it just checks if the can is between and below two points. When the can first falls in that area then the distance from the can to the the two ends is measured, this is the rest length of the two halfs of the band. Than after that both halves apply a force to the can. It's a spring force and both are calculated with F=-k*(length-rest_length) for each band half. We then apply those forces in direction to the endpoints and that's what moves the can. The spinning and slipping along the band are more of a fuzzy thing. The capx condenses that stuff and also using the band sprites as a visualization.

    Anyways a fixed capx or a redesigned one that supports what you want to do more easily is left to someone else to do. I won't get around to it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)