How do you apply collision to one sprite but not the other?

Get help using Construct 2

Post » Sat Jul 25, 2015 2:04 am

I found out agood way of making a enemy jump.

http://postimg.org/image/ethsvhxbl/

Here is my layout. I have set the enemy to move left and rigth. I have the solid platfroms lead the enemy into jumping. I have made the platforms invisible so it really looks like the enemy is jumping.

Here is images showing the enemy jumping.

http://postimg.org/image/jre2q5mqz/

http://postimg.org/image/4wbdg6f3l/

http://postimg.org/image/sjuras3al/

http://postimg.org/image/pi4l0bt4j/


The jumping works fine like this.


http://postimg.org/image/3s0cgsegj/


But of course so can the player also stand on the platforms and collide whit themso the player avoiding the jumping enemy doesnt work. Is there any way to make it so only the enemy collide whit the platforms and the player doesn't so the jump will be a jump. I would be grateful for help.

I don't use the Jump platform thing becuase it never works. I have asked for help about it so much and even if i have done exactly as i have been told it still doesn't work. If your answer is about Boooleans tell me how to set them up whit variables, events and actions and such clearly.
Last edited by Calfuso on Sun Jul 26, 2015 8:37 am, edited 1 time in total.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Sat Jul 25, 2015 3:23 am

Answer someone!
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Sat Jul 25, 2015 2:44 pm

Again answer someone!
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Sat Jul 25, 2015 2:51 pm

You could use a boolean to tell whether the specific object should enable collision or not.

is bCollision true -> object.setCollisionEnabled = true
is bCollision false -> object.setCollisionEnabled = false

Question: Why don't you use the regular platform behaviour to make the enemy jump? instead of using invisible platform sprites?

Or did I read you question wrong? It was kinda hard to follow.
B
20
S
8
G
4
Posts: 195
Reputation: 3,555

Post » Sat Jul 25, 2015 3:07 pm

Calfuso wrote:Again answer someone!


Sorry, I prefer helping people who ask politely..
But I hope @eliasfrost answer helped.. :)
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 » Sun Jul 26, 2015 6:53 am

eliasfrost wrote:You could use a boolean to tell whether the specific object should enable collision or not.

is bCollision true -> object.setCollisionEnabled = true
is bCollision false -> object.setCollisionEnabled = false

Question: Why don't you use the regular platform behaviour to make the enemy jump? instead of using invisible platform sprites?

Or did I read you question wrong? It was kinda hard to follow.



I can't use the platfrom behavior jump becuase it never works even if i do exactly as i have been told on the forums. If you now could give me the answer how to make a enemy jump that actually works that would be good to but making the colloision work for some objects but not others make alot of other things work so i would still want a answer to this. How do you make the boolean work? i am sure you need a instance variable to make the bolean work. Should i name it is bColllision true? After that how should i set up the events and actions? It seems hard to make it loom like you written it. So basically be clearer.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Sun Jul 26, 2015 11:00 am

To use the platform behavior to make the enemy jump you need to check for reasons to make the enemy jump. In the simple example below the enmy object will move to the right always, and when the enmy object overlaps with the plr at offset the event tells the enmy object to jump.

Image

With this method there's really no need to use a boolean to check collision because there's no invisible arc to disable collision on.
B
20
S
8
G
4
Posts: 195
Reputation: 3,555


Return to How do I....?

Who is online

Users browsing this forum: beohs, brunopalermo, MadSpy and 11 guests