# rubber band

Get help using Construct 2

### » Tue Nov 22, 2011 7:19 am

This is great.

One thing I'm yet to figure out in my own experiments with this sort of thing, is how to restrict how far you can pull the can within the rubber band. Like the band has reached it's limits.

Any clues how one might do this?
B
10
S
4
G
5
Posts: 139
Reputation: 2,983

### » Wed Sep 05, 2012 2:52 pm

This is super amazing!!! Man, you're making me understand how C2 works, thank you so much!
B
19
S
3
G
3
Posts: 16
Reputation: 3,365

### » Wed Apr 24, 2013 8:46 pm

What the Good

I am really very much thank full to you , I was looking something like this.

But i have one questions if anyone can solve it, after pulling little bit more , some times the band left and the soda can left behind , when we just shot the soda can falls.

How to fix this problem, if anyone can PM me please. I will be very much thanks full.
B
101
S
20
G
15
Posts: 198
Reputation: 14,721

### » Sun Jun 16, 2013 7:59 am

I started a game back when you first posted this, as a joke. I picked it up again to enter in the Win8 contest.

http://clay.io/game/hotchicksontrampolines

I left the band red in your honor.

B
252
S
65
G
34
Posts: 907
Reputation: 41,528

### » Wed Nov 27, 2013 1:31 pm

This is almost exactly what I have been trying to achieve, thanks R0J0 for your contribution.

I have made some changes to suit my needs but am trying implement this as a rotatable object but unfortunately am having some difficulty :(

Would anyone be able to point me in the right direction or give me some idea on how this could be achieved based upon R0J0s model?!

Many thanks..

B
9
S
3
G
1
Posts: 112
Reputation: 1,827

### » Thu Nov 28, 2013 1:03 pm

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
B
9
S
3
G
1
Posts: 112
Reputation: 1,827

### » Thu May 11, 2017 4:46 pm

I know this is really old, but could someone re-upload this example please? @R0J0hound, do you still have it?
B
9
S
2
Posts: 13
Reputation: 601

### » Mon May 15, 2017 8:12 pm

B
98
S
36
G
132
Posts: 5,521
Reputation: 84,005

### » Mon Oct 23, 2017 11:15 pm

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.
B
246
S
136
G
13
Posts: 167
Reputation: 26,467

### » Tue Oct 24, 2017 12:02 am

@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.
B
98
S
36
G
132
Posts: 5,521
Reputation: 84,005

PreviousNext