Animated Shield Overlay
xacto
Member Posts: 146
I am working on creating an animated glowing shield. I am trying to figure out the best way to do this. What I do in other programs is what is called Swap Actor. Game Salad does not have this - only Change Image.
The glowing animation are four transparent PNGs. I first tired just to place a Animate behavior into my player. This would work fine IF my graphics were the same size (the glow is larger in order to surround the player)
I then created an Actor called playerShield that would be spawned when the shield was enabled. The code in the playerShield contained the animation sequence with a Constrain Attribute for the X and Y of that of the Player. I was hopping that it would follow my Player exactly when it moved. It does, however it kind of skips; it will show then and stay there while my player moves and then back to the players center position.
I placed them in a timer as well, however this did not help at all. Still skips.
Any ideas on how to make this work better?
Xacto
-----------------------------------------------------------
StarFire
http://gamesalad.com/game/play/8901
The glowing animation are four transparent PNGs. I first tired just to place a Animate behavior into my player. This would work fine IF my graphics were the same size (the glow is larger in order to surround the player)
I then created an Actor called playerShield that would be spawned when the shield was enabled. The code in the playerShield contained the animation sequence with a Constrain Attribute for the X and Y of that of the Player. I was hopping that it would follow my Player exactly when it moved. It does, however it kind of skips; it will show then and stay there while my player moves and then back to the players center position.
I placed them in a timer as well, however this did not help at all. Still skips.
Any ideas on how to make this work better?
Xacto
-----------------------------------------------------------
StarFire
http://gamesalad.com/game/play/8901
Comments
As long as they don't animate independently, you could just make your graphics the same size.
Animation : 4 images at 30fps, looped, restored actor image when done
Constrain Atribute: self.Position.x TO game.PlayerX
Constrain Atribute: self.Position.y TO game.PlayerY
Again, I spawn playerShield on top of my Player.
It follows, however it lags like 1 second behind my player.
My graphics are NOT the same, because I need the SHIELD to have a larger hit radius.
I am a dork.
I have a shield on a ship in one of my games... but the ship doesn't move so i didn't have quite the same problem...
Don't ask why it doesn't move. It's a secret
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io