Compare colliding objects

Get help using Construct 2

Post » Fri Jan 18, 2013 2:05 am

Simple question. How do I compare the size of two objects when they've collided and do something only if one is larger than the other?
B
15
S
5
Posts: 28
Reputation: 1,533

Post » Fri Jan 18, 2013 4:20 am

give the sprite object an instance variable called coliddedUID

Sprite On collision with other object
->pick nearest (enemy)

-sub event->system compare 2 values
sprite.imagewidth*sprite.imageheight <= enemy.imagewidth*enemy.imageheight

-> do whatever ever action should happen if the sprite is smaller than the enemy it hit
B
50
S
21
G
8
Posts: 844
Reputation: 10,299


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 21 guests