On Screen Coin Animation
- by Siddharth
am working with side scrolling skater game. I want to perform coin animation such that as player collect coin it moves upside and attach with currency sprite.
My main character and coin present in game scene and currency sprite present in HUD layer.
This situation creates problem for me. Directly I can not apply modifier to coin because it is side scrolling game so based on main character speed it reaches at different position. That I have checked.
So that I have to generate other coin at same position at game layer coin has, in HUD layer and move upward to it.
But I didn't able to get its y position correct though I can able to get x position correctly.
Many time main character goes downward so it get minus value many time.
I also tried following code
float[] position = GameHUD.this
.convertSceneCoordinatesToLocalCoordinates(GameManager
.getInstance().getCoinX(), GameManager.getInstance()
.getCoinY());
But I am getting same coordinate as I provide. No difference in that so please some one provide me guidance in that. Because I am near to complete my game.
EDIT: Here game layer and hud layer is totally different. Actual coin present in game layer which player has to collect and at same position I want to generate another coin in hud layer to perform some animation. It is recommended to generate coin in hud layer because through that only I can able to complete my target.