Overlapping objects, Collision problems

Get help using Construct 2

Post » Tue Oct 20, 2015 7:53 am

Hi guys, hope you can help please check out the following capx.

https://www.dropbox.com/s/y0vswq7wbza1c ... .capx?dl=0

Left click to create a chopper, the chopper will start moving right until it collides with a tree. Once collided it will go to a chopping state and damage the tree until it's destroyed or has been right clicked (will be attack hit later). This all works pretty good however, if you click fast enough and create choppers that are perfectly aligned with each other the system breaks down and you get more than one chopper on a tree. I tried using pick nth instance when the chopper collides with the tree but, no good.
Have retro games for sale? Buy & Sell Retro Games UK
B
9
S
2
Posts: 68
Reputation: 768

Post » Tue Oct 20, 2015 11:22 am

I have the following working while the fps is over 20/30. I guessing collision detection becomes less responsive at slower fps, is there anyway around this?

https://www.dropbox.com/s/s9mshxx2lmxar ... .capx?dl=0

EDIT: actually it seems to work fine unless I start clicking to create new choppers above & ahead of the currently moving ones, at a random point the choppers seem to start ignoring the tree's instance variables and get stuck in the chopping state.
Have retro games for sale? Buy & Sell Retro Games UK
B
9
S
2
Posts: 68
Reputation: 768

Post » Tue Oct 20, 2015 12:09 pm

Wouldn't something like this simple event do the trick?

Chopper is overlapping Chopper
Pick top instance
> chopper set state: "moving"
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 20, 2015 12:21 pm

thanks for the reply, unfortunately I'm getting the same results
Have retro games for sale? Buy & Sell Retro Games UK
B
9
S
2
Posts: 68
Reputation: 768

Post » Tue Oct 20, 2015 12:27 pm

aha, I think I have narrowed it down, it all goes pear shaped when the first tree gets destroyed.
Have retro games for sale? Buy & Sell Retro Games UK
B
9
S
2
Posts: 68
Reputation: 768

Post » Tue Oct 20, 2015 12:32 pm

Yeah, I guess you are overcomplicating things, but this way it works:

chopper
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 20, 2015 12:57 pm

thanks for the help, I could still get yours to bug out.

https://www.dropbox.com/s/42fj1qf7fwfqve6/choppers-v4.capx?dl=0

Tested this a few times and I works however, if I right click a chopper he jumps fine but it all goes pete tong again. Been working on this for far too long now :) It seems that when I can't figure something out I get desperate and over complicate things, time for a coffee break I think :)
Have retro games for sale? Buy & Sell Retro Games UK
B
9
S
2
Posts: 68
Reputation: 768

Post » Tue Oct 20, 2015 2:07 pm

actually I could do with some help, really can't figure out why it messes up if I make a chopper jump.
Have retro games for sale? Buy & Sell Retro Games UK
B
9
S
2
Posts: 68
Reputation: 768

Post » Tue Oct 20, 2015 2:57 pm

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 20, 2015 3:10 pm

great stuff thanks a ton mate, really mean it! I get all of it apart from the nested for-each loop within the chopping state, if you wouldn't mind could you briefly explain why it's needed.
Have retro games for sale? Buy & Sell Retro Games UK
B
9
S
2
Posts: 68
Reputation: 768

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, facecrime, Yahoo [Bot] and 7 guests