0 Favourites

Object Selection Question

This forum is currently in read-only mode.
  • Say you've got an enemy with a value of 0 who collides with another instance of itself with a value of 1. In turn, the actions to that event apply only to the enemy with a value of 0.

    How would you turn that into an event? (I'm using a family "PlatformEnemies" by the way)

    To be a bit more clear, what I'm trying to do is get my platform enemies to turn around when colliding with eachother, but change which one turns depending on how they collide and which enemy is doing what at the time.

    Examples:

    Two enemies facing eachother collide - turn both around. That's an easy one.

    One enemy collides with an enemy who's currently turning around - Only turn around the enemy that wasn't turning.

    One enemy falls on top of another enemy who's facing the same direction - have the enemy that fell turn around, leave the other one as it was.

    One enemy somehow ended up overlapping the other enemy, and they're both walking in the same direction - Have one of those enemies stop until they're no longer overlapping.

    As far as I know there's really no way to write events like this.. I've been messing around with the advanced collision condition, but I still haven't gotten anywhere. Any ideas?

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • You could try:

    enemy private variable =0

    ->enemy on collision with family "PlatformEnemies"

    -->enemy do stuff

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
353 32,064
yojona's avatar
yojona
Unread sticky
192 1,337,361
Kyatric's avatar
Kyatric Construct Team Support
Unread hot topic
167 14,484
DMT2005's avatar
DMT2005