How do I Move and stop object on a random timer

Get help using Construct 2

Post » Sun Jun 08, 2014 11:59 pm

I have these levers in my game that I would like to move down randomly and I also need them to stop randomly. On start of the game the levers start in their top positions. throughout the game I would like the levers to individually move down at different times (so even if lever_1 moves lever_2 and lever_3 don't have to move.). I also would like the levers to individually stop their downward movement at random times too.

Example: Every 4-9 seconds the lever should move down for 2-4 seconds then it should stop. That should repeat until the lever reaches the bottom.

I have attached the capx that I have been working on and the progress thus far. I haven't started with the random timing mechanic because I don't know where to start exactly.

capx instruction:
move sprite with arrows
move sprite over place holder and press up and down arrows to move lever
You do not have the required permissions to view the files attached to this post.
B
8
S
1
Posts: 39
Reputation: 685

Post » Mon Jun 09, 2014 2:41 am

You can just make an instance variable and subtract dt from it, and when it's <=1 reset to random(n) + x where x is the base time, and random(n) is the variability.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Mon Jun 09, 2014 6:13 pm

Thanks, I'll give that a try today.
B
8
S
1
Posts: 39
Reputation: 685

Post » Thu Dec 04, 2014 11:21 pm

I know it has been a while but I took some time off from the project im working on but now I'm back to work. I'm still having an issue with that post I entered below. I'm still a beginner when it comes to some parts of construct so I'm not too sure what you are taking about exactly, but I am eager to learn.

To be completely honest I understand everything until instant variable after that I'm lost. I'm not even sure what object I should create the instance variable on. Please help.
B
8
S
1
Posts: 39
Reputation: 685

Post » Sat Dec 06, 2014 3:53 am

Ok, well I spent most of today working on this part of my project. I have the mechanic working and I learnt a couple of things today. I created a condition that asked the system to check every choose (2,3,4,5) and set the objects y to it's current position + choose(11,15,16,19). I wished I could the object to have a gradually transition but I test it out a cpl of times today and I am satisfied with this part of the game.
B
8
S
1
Posts: 39
Reputation: 685


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, senecaa and 22 guests