Spawned actors and animate image
glynius
Member Posts: 231
Hi everybody,
i want to throw some actors using touch, when this actor reaches a specific speed i want to animate the image,
so far so good, the problem is that this actor is spawned, so if i change the image, it changes to all of the spawned actors,
is there any way to treat each spawned actor separately?
i want to throw some actors using touch, when this actor reaches a specific speed i want to animate the image,
so far so good, the problem is that this actor is spawned, so if i change the image, it changes to all of the spawned actors,
is there any way to treat each spawned actor separately?
Comments
one way:
give each spawned actor a unique name at runTime
gameAttribute: index type … spawnCount
on your touchActor that does spawn
Rule: when
Event: touch is pressed
Attribute: game.spawnCount ≤ the maximum number of spawns you want
-changeAttribute: game.spawnCount To: game.spawnCount+1
- do the spawn
on spawnActor:
1st behavior: changeAttribute: self.Name To: spawnCount
Rule: when
Attribute: self.Name is 1
-changeAttribute: self.Image To: image name (do not need to use .png)
-Rule: when
-Attribute: self.Motion.Linear Velocity.X ≥ ???
--Animate (drag in the image for #1 animation)
… rules for each of the spawns (when self.Name = 2; etc.)
MH