okay I will explain my project. that's a shooter game. you have player against monsters.
I want that every monsters that appears move to the player to bit him. but the monsters are in a different position on the map. they can move up, left right and down. they will try to reach the player but the problem is that in my eventsheet, every monsters is treated in the same why, even if they get bullet in their head. I want to dissociate each sprite of the instance monster.
First Lets Understand this concept:
Object types are a central part of game design in Construct 2. Object types define a 'class' of an object. For example, TrollEnemy and OgreEnemy could be different object types of the Sprite plugin. They have different animations and events can be applied separately to make them look and act differently, despite the fact they are both Sprite objects.
Then Lets Understand this concept:
Object instances are the actual objects you see in a game: an instance of an object type. For example, if there are four TrollEnemys in a layout, those are four instances of the TrollEnemy object type.
This concept is important:
All instances of an object type use its behaviors. You cannot add a behavior to only some of the instances - they all use the behavior - although you may be able to enable or disable the behavior for individual instances.
Finally This concept may be important:
Containers are an advanced feature to make it easy to build composite objects - that is, elements of your game made from multiple objects. For example, a tank in a strategy game might be composed of two parts: a sprite for the tank base, and a different sprite for the tank turret. This allows them to rotate independently. Adding them both to a container then allows events to treat both objects as if they were one, because they are always picked together.
Example to Complete 3 separate moving sprites with their own behavior.
1. File->New->New Empty Project-> Click Open
2. On the tile layout Tab -> Dbl Click inside the layout and choose Tiled Background -> Click Layout again and add a background image to create your background.
3. The window size of the project, the layout size, and the picture size should all be changed to be the same.
4. The position of the tiled background should be 0,0 as well
5. Find the Layers Tab on the right side and click on it to display the layers of the layout.
6. Rename Layer for the background whatever you want and lock it. Locking it prevents messing it up as you develop.
Background should be ready
Add a new layer
1. Click the "plus" sign. Add a new layer and rename it to something like "Main"
2. Make sure you remain in the layer that you create and rename to "main" or whatever you named it. We want to add the sprites to this layer. Not the background Layer.
3 Double click on the layout screen ->insert new object-> Sprite -> Click on layout screen again and Add the sprite
4. Name you sprite something like "Luke"
5. Add a behavior to Luke by using the behaviors link on left side. Add a behavior like "Fade"
Test the game. We should now have 1 sprite named Luke who fades away.
1. Now repeat that process naming a new sprite as "Jeb" and assigning him a different behavior like "Bullet"
Important: You do not create a new "instance" of Luke using the Ctl Drag method. This just creates another "Luke"
2. You will need to click on the Layout and add another actual sprite.
Got it?
Under the layers Tab you should have 3 objects listed. Luke, Jeb, and a tiled background
When you Play the game they should operate independent from each other.
Bonus Idea. Containers.
1. Click on the sprite "Luke" . In same area you added a behavior to "Luke" look for Container and choose Create
2. Choose the Other sprite you created and this will group both sprites into a Container that allows them to have independent behaviors and yet be grouped together.
Hope this help. Let me know if anything is unclear or needs reworded.