On Screen Coin Animation

Posted by Siddharth on Game Development See other posts from Game Development or by Siddharth
Published on 2014-03-28T02:41:56Z Indexed on 2014/05/27 22:20 UTC
Read the original article Hit count: 248

Filed under:
|
|
|

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.

© Game Development or respective owner

Related posts about animation

Related posts about camera