Pendulum

Discussion and feedback on Construct 2

Post » Sun Sep 09, 2012 2:53 pm

I need do something with Pendulum and I have no clue how to start it from Construct object.
Tell me a suggestion, I have to write my own plugin or combine it from existed...???
B
11
S
2
Posts: 73
Reputation: 1,438

Post » Sun Sep 09, 2012 4:06 pm

1. Add a sprite of your pendulum.
2. In the image editor move the origin to where you want to pivot.
3. Add the sine behavior to the sprite.
4. Change "Movement" to "Angle".
5. Profit
6. Tweak settings to your liking.
B
91
S
31
G
103
Posts: 5,234
Reputation: 67,754

Post » Sun Sep 09, 2012 4:18 pm

Physics would also work ;)
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Sun Sep 09, 2012 7:00 pm

Thank so much @R0J0hound
B
11
S
2
Posts: 73
Reputation: 1,438

Post » Mon Jul 03, 2017 1:13 am

@R0J0hound Wow that still worked, thank you so much. Am I wondering though is there a way to make it swing a few swings and then gradually slow down and stop in place until it is activated again?

Thank you in advance...
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
32
S
14
G
3
Posts: 356
Reputation: 5,169

Post » Mon Jul 03, 2017 11:40 am

If using the sine behaviour, a simple way is to set the pendulum's sine magnitude to max(self.sine.magnitude-value,0) every tick, where "value" is the rate at which you want the pendulum to slow down.

You can then do a check to see if the magnitude is 0 and disable the sine behaviour to stop it running.
B
16
S
7
G
3
Posts: 395
Reputation: 3,693

Post » Mon Jul 03, 2017 6:49 pm

You can not use any behaviors if you like. Create a sprite and make the image origin to the left.
Then give the sprite a variable called "w" and create an event like this:

every tick:
--- sprite: add cos(self.angle)*500*dt - self.w*0.001
--- sprite: rotate self.w*dt degrees clockwise


"w" is the angular velocity of the object.
500 is the gravity. Change it to adjust the speed things go.
0.001 is the damping. Make it lower to allow the pendulum to swing longer before it stops.
B
91
S
31
G
103
Posts: 5,234
Reputation: 67,754


Return to Construct 2 General

Who is online

Users browsing this forum: New Tide Studios and 10 guests