How do I overlap with collision off?

Get help using Construct 2

Post » Mon May 29, 2017 1:44 pm

Greetings! ^_^
So basically we have a cat chasing a mouse situation where the cat has collision off to pass solid objects while the mouse cant. Anyhow, upon the cat reaching the mouse, it should be game over.

BUT since the collision is off on the cat, the trigger 'overlap mouse' does not work. Is there any other way?
If X and Y of the cat = same as mouse = doesnt work either.

Any solution for this?
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Mon May 29, 2017 2:04 pm

There are many ways of doing this and keeping the collision on to make it simple. But if you need it off then you can compare the distance. And when the distance between the objects is too short it is game over. Like this:

Compare two values

distance(mouse.X,mouse.Y,cat.X,cat.Y)
is less than 5
---> game over
B
55
S
24
G
13
Posts: 766
Reputation: 12,573

Post » Mon May 29, 2017 2:57 pm

Anonnymitet wrote:There are many ways of doing this and keeping the collision on to make it simple. But if you need it off then you can compare the distance. And when the distance between the objects is too short it is game over. Like this:

Compare two values

distance(mouse.X,mouse.Y,cat.X,cat.Y)
is less than 5
---> game over


Yes i need to keep the collision for several reasons. The object has bullet & 8 direction, which collision can not be ignored in this case.

There is no distance between values, all i can pick is the distance traveled.
'Compare two values'
-Distance traveled is the only option found.
Last edited by Greaver on Mon May 29, 2017 2:59 pm, edited 1 time in total.
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Mon May 29, 2017 2:58 pm

Use system --> compare two values

You can also use system --> pick by comparison if you need to also pick an object at the same time
Last edited by Anonnymitet on Mon May 29, 2017 3:00 pm, edited 1 time in total.
B
55
S
24
G
13
Posts: 766
Reputation: 12,573

Post » Mon May 29, 2017 3:00 pm

Anonnymitet wrote:Use system --> compare two values


Yes i did, there is only distance traveled.
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Mon May 29, 2017 3:01 pm

It is not an action it is an event. So create a new event and select system-compare two values
B
55
S
24
G
13
Posts: 766
Reputation: 12,573

Post » Mon May 29, 2017 3:06 pm

Anonnymitet wrote:It is not an action it is an event. So create a new event and select system-compare two values


I know its an event. It doesnt work. There is more than 1 cat on screen, when reveresed (say cat distance to hero is less than 50) then all cats on screen die and not just the 1.
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Mon May 29, 2017 3:12 pm

In that case you just have to use pick by comparison like I said in the post above.

Here is a capx that shows how it is done:
https://cdn.discordapp.com/attachments/ ... ision.capx
B
55
S
24
G
13
Posts: 766
Reputation: 12,573

Post » Mon May 29, 2017 3:46 pm

Anonnymitet wrote:In that case you just have to use pick by comparison like I said in the post above.

Here is a capx that shows how it is done:
https://cdn.discordapp.com/attachments/ ... ision.capx


Pick my comparison worked, thank you. ^_^
In any case, the 'cat' has 8 direction and bullet state, which makes it not possible to remove the solid bumps without turning of collision, am i correct? It seems, it comes automatically inbuilt with the 8 direction/bullet behaviour.
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Tue May 30, 2017 8:12 am

@Greaver Why are you using both the bullet and 8direction behaviour? What do you use to actually move the cats towards the mouse?
B
55
S
24
G
13
Posts: 766
Reputation: 12,573


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 60 guests