How do I Time Instances

Get help using Construct 2

Post » Mon Apr 21, 2014 1:32 am

hi guys =)
i ned you help and i will appreciate it

see... i have this hammers that come down and crush the player..
but... what i want them to do... is to every hammer to have their own timer to time when whey will axecute a code instead of doing it at the same time... i tried doing it with a instance variable... but, still i does not look good, if you pay attention the left one has 1.5 s of time and the right one has 6 but they only wait once and then they take the same time to go up and down

another problem i have with my exmaple is that if you pay attention when the hammer go up... and hit the limit... they are supposed to totally stop but, for some reaosn the keep going up slowly, i dont know why they do that... so i will appreciate if you could help me here aswell

can you give me a hand with this?? check out the .capx below

im planing to do... disappering platforms (like in the classic megamans) but before that i need to resolve the time problem..

thanks for any help =)
You do not have the required permissions to view the files attached to this post.
B
23
S
6
G
3
Posts: 316
Reputation: 3,461

Post » Mon Apr 21, 2014 1:54 am

Here you go... :)

I substituted the bullet behavior for custom movement (that was why the hammers were creeping upwards - don't know why but I'm not a fan of using bullet behavior for things that aren't bullets). I added a timer behavior to the hammers and used that to trigger their falling - they are selected by UID at the start of layout but you could easily add a variable and select by position number etc if you wanted.

Edit - attachment deleted (see the example below - it's better IMO).
Last edited by Colludium on Mon Apr 21, 2014 2:00 am, edited 1 time in total.
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,285
Reputation: 47,554

Post » Mon Apr 21, 2014 1:59 am

Ignore the last one - this is even better. It uses a for-loop to set the timer value at the start of the layout according to the instance variable you set (better for editing in the layout view).
You do not have the required permissions to view the files attached to this post.
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,285
Reputation: 47,554

Post » Mon Apr 21, 2014 2:03 am

Colludium wrote:Ignore the last one - this is even better. It uses a for-loop to set the timer value at the start of the layout according to the instance variable you set (better for editing in the layout view).


thanks a lot =) i will check it out :D and report my findings

Update... Thanks a lot :D it looks and works great!!
B
23
S
6
G
3
Posts: 316
Reputation: 3,461


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests