I wish to do a running score animation for my iphone app in xcode such that whenever I increase the score by an integer scoreAdded, the score will run up to the new score instead of being updated to the new score. I try some for loop with sleep but to no available. So I'm wondering if there's any way of doing it. Thank you.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- Popover segue to static cell UITableView causes co
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- didBeginContact:(SKPhysicsContact *)contact not in
Try redrawing the view after each iteration where your score is being displayed:
Add a timer that will call a specific method every so often, like this:
This will call your updateScore method 15 times a second
Then in the main part of your game, instead of simply adding the amount to currentScore, I would instead store the additional amount in a separate member variable, say addToScore. e.g.
Your new method updateScore would have a bit of code like this: