Change hero animations when a powerup attribute is true
Hi everyone!
Which is the best way to change the hero animations to give a different look when a powerup is active?
Now, I have the animations controlled by instructions like:
Actor Receives an event >
Key / touch (to move left-right, etc.) >
Animate
Then I have rules for:
A powerup attribute (boolean) that changes to true when the counter reaches 1000 points.
And what I do after is:
When atribute game.powerup is true >
Spawn Actor "Powerup hero" (the same hero actor with same controls/animations but with different design)>
Destroy Actor
But with this method, switching from one to another hero is very abrupt, does not match the frame of the animation neither orientation (for example, if it was moving to the left, the hero appears with powerup looking right).
I have seen many tutorials about powerups, but I haven't found info about changing a complete group of animations when a powerup rule is true.
If anyone can help me it would be great ...
Comments
@Ferry Hardest I would do it this way , if powerup is false do normal animation , if power up is true do the powerup animation , no need to spawn a new actor.
When atribute game.powerup is true + when animation frame is [specific frame]
You've not said how you are controlling the actor's orientation so it's hard to make any suggestions beyond a generic 'turn the actor the right way before changing to the new animation'.
@Icebox1910 @Socks many thanks!
Left control is:
Actor receives event > Key left is down >
Change attribute > self.Graphics.Flip Horizontally > True
Animate >
Interpolate > self.Motion.Linear velocity.X to -250
Otherwise:
Interpolate > self.Motion.Linear velocity.X to 0
@Ferry Hardest Is this a platformer game ?
What's the question ?
Yes!
Sorry, I thought you suggested that I explain the player controls to find out how to avoid the orientation problem when spawn a powerup actor from the hero.
Yes, but I don't know what you want, you've not said, you've only described a problem, without having described what you want to happen.
The question I was expecting was some form of 'how do I get my actor to . . . . . . . '
You've said as one animation changes to another the actor can often be facing the wrong way at the point where it changes to the new animation, is that basically the issue ?
If so, what would you want to happen to resolve this ?
Yes, this is the issue. How to spawn my actor to obtain a fine switch, with correct facing, and animation frames reproduced coordinately between actors (still I have to prove your suggestion about define a specific frame)...
@Icebox1910 You're right! It works, so for now it is OK for me. Many thanks!!
Thank you both @Icebox1910 and @Socks to listen and try to understand.