Do I still need collisions for this?

Get help using Construct 2

Post » Tue Jan 13, 2015 6:21 pm

Hello World,

So I have a 2 part question. First of lets say I have an event like this
every tick if object a is overlapping object b then destroy object b
do I need collisions to be enabled on those 2 objects for that to work?

Second part lets say I set an object to have collisions disabled by default, then I have an event
if object c is on screen then set collisions enabled for object c
will that permanently enable collisions for the object once it comes into view, or will collisions be set back to disabled after the object leaves the screen?

Thank you.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Tue Jan 13, 2015 6:38 pm

Yes, and overlapping is already every tick by definition. Collisions are for a single trigger.
Yes, all objects have collisions enabled by default. If you want to stop them offscreen use else.

You might also try a different approach of not using collisions at all.
The array object can mimic a grid of objects, and can simplify comparisons.
value of arrayAt(1,1) > arrayAt(1,2) etc.
You just have to worry about picking objects after that. In which case instance variables work well.
Image ImageImage
B
171
S
50
G
180
Posts: 8,396
Reputation: 113,986

Post » Tue Jan 13, 2015 6:40 pm

1. Yes you need collisions to be enabled (but you don't need the every tick condition).
2. If you want to disable conditions then make an else statement or something which disables them when the object isn't in view, otherwise it will not switch back on its own.

EDIT: Curse my slow typing fingers!!!
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991

Post » Tue Jan 13, 2015 9:39 pm

Cool, thats all I needed to know, thanks.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 25 guests