Power Meter - Cocos2d/Box2d
How would I create a power meter that shoots a ball in the direction and power chosen by the player?
I also have a button that will "fire" the ball.
Any ideas开发者_如何学JAVA?
Not sure what you mean, but maybe you can look at CCProgressTimer
. With this you can set the percent of the image you want to show (using a horizontal type for your standard progress bar - or whatever).
The code that you need is:
timer.type = kCCProgressTimerTypeHorizontalBarLR;
timer.percentage = 0; //of whatever percent you want to show (you need to update this manually)
精彩评论