Initial replay recording support.

- Added listener and events in Game state to record replay frames.
- Send more accurate keys.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-03-10 22:37:23 -04:00
parent 7536056a59
commit 790a66ec1e
6 changed files with 123 additions and 30 deletions

View File

@@ -237,9 +237,9 @@ public class Replay {
// life data
StringBuilder sb = new StringBuilder();
if (lifeFrames != null) {
NumberFormat nf = new DecimalFormat("##.##");
NumberFormat nf = new DecimalFormat("##.##");
for (int i = 0; i < lifeFrames.length; i++) {
LifeFrame frame = lifeFrames[i];
LifeFrame frame = lifeFrames[i];
sb.append(String.format("%d|%s,",
frame.getTime(), nf.format(frame.getPercentage())));
}