How do I determine the time of collision

Just started using Construct 2? Post your questions here

Post » Tue Dec 30, 2014 8:52 am

Hi all,

New to Construct. Just began 'playing around'. Looks nice. Question. I want to know the time of collision (or the time an object reaches the border of a layout). I have two instances of an object with both it's own speed. I want to go to a next level when both instances collide with an object (or layout border) at the same time.

Regards, Harry
B
4
S
1
Posts: 5
Reputation: 260

Post » Tue Dec 30, 2014 4:53 pm

You might use tickCount or time...

But it would be incredibly hard for both objects to collide at exactly the same time, I guess...
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 428
Reputation: 2,337

Post » Tue Dec 30, 2014 9:49 pm

Perhaps it is not the time of collision you are looking for.

2 overlap checks in 1 event.

Event
player a is overlapping Finish
player b is overlapping Finish
action
go to layout


for time tracking purposes, you could give each player its own variable: starttime, endtime
and respectively set them at each event, after which you can use them in all sorts of calculations.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567

Post » Wed Dec 31, 2014 9:25 am

HarryDeBoer you could create timer like this
You do not have the required permissions to view the files attached to this post.
B
250
S
39
G
15
Posts: 1,953
Reputation: 40,623

Post » Fri Jan 02, 2015 1:49 pm

Hi all

thanks for your answers. helped me to get going. I created an instance variable for this and on collision with walls I set the (rounded) time to that variable. I can see (write to text) the time on collision so that is working but I'm trying to figure out now how to compare the time variable for all instances -at gametime I don't know how many instances there are- at once.

PS if the time for the instances is equal I restart the level with another instance added (so difficulty increases)

Regards, Harry
B
4
S
1
Posts: 5
Reputation: 260


Return to Beginner's Questions

Who is online

Users browsing this forum: FartsLolz and 2 guests