Enemy Box and Animation

Get help using Construct 2

Post » Thu Jul 11, 2013 5:29 am

Hi

Im scratching my head with this one, as it shroud be very easy, yet I cant find anything on the tutorials or forums.

I use a red box as an enemy, and I have plenty. Yet I want the box to be invisible, and attach an animated spite to it (using the Pin behavior).

So, I do:

EnemuBox On Create -> EnemyBox Spawn EnemySprite
                   -> EnemySprite Pin to EnemyBox
                   -> EnemySprite Set Position to Enemy Box

EnemyBox is Moving    -> EnemySprite Set Animation to "WalkingAnimation"

The thing is that all my enemies are acting like choreographed dancers. When one plays the wlakingAnimation, all do. And I cant figure a simple way to encapsulate the Box and the sprite animation.

Thanks
B
7
S
3
G
3
Posts: 53
Reputation: 2,459

Post » Thu Jul 11, 2013 5:35 am

If you aren't using parenting, that solved similar problems that I was having. Parenting and event groups will help a lot. Also, make sure you delete all cloned and parented objects at the start of the layout.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu Jul 11, 2013 5:37 am

I always add a linking 'id' variable that is the moving object's UID. So 'enemyBox is moving + enemySprite.id = enemyBox.uid -> Set Animation...'

Maybe there is an easier way, but I use the id variable for so many things anyway that this is how I manage it.
B
28
S
8
G
5
Posts: 429
Reputation: 6,997

Post » Thu Jul 11, 2013 5:38 am

how do I use parenting?
B
7
S
3
G
3
Posts: 53
Reputation: 2,459

Post » Thu Jul 11, 2013 5:41 am

[QUOTE=perezbalen] how do I use parenting?[/QUOTE]
Click on an object and in the properties section there should be a "parent" thing. Anything that is parented to something will be created with the object and deleted with the object, so you don't even have to do those things when handling the original (parent) object.
I didn't have to use UIDs at all doing this, but always make sure you reference the parent object in the events and not just the actions when handling parented objects.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu Jul 11, 2013 7:22 am

@Sushin
@perezbalen

It is called containers
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
48
S
21
G
18
Posts: 2,112
Reputation: 16,873

Post » Thu Jul 11, 2013 8:12 am

[QUOTE=Aphrodite] @Sushin
@perezbalen

It is called containers[/QUOTE] I think that's what I meant...instead of parent.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests