hawkthorne/hawkthorne-journey — pull request #2292 by AlfonZ42 (2014-11-04 23:16:15+00:00)
Title: Replay

I had an idea to implement a replay - record keystrokes and play them later.

Recording is started/stopped by *F7*, replay by *F8*; the transcript is saved into/read from *replay.json* in the saves folder.
There is an indicator (blinking *R*) in the top left corner when recording/replay is active.
There are new command line options for it - *--record* and *--replay* that start the recording/replay right away.

However, there is much inherent randomness (especially with enemies), which diminishes the usefulness.
Also, the same starting point is needed for record and replay, so passing a savepoint during recording voids usefulness of the record unless you backed-up the original save file somewhere safe, or
have other way of getting it done (e.g. specifying *--level=* in the command line).

An example (save as *replay.json*; uses default controls, save slot # 1 is empty; press *F8* at the title screen):
```
[[3.4421094415484,1," "],[3.571438516261,0," "],[4.2218633215762,1," "],[4.3663712089801,0," "],[5.2726453945706,1," "],[5.3605169659168,0," "],[6.2648465560123,1," "],[6.5842048197828,0," "],[7.4279534936595,1," "],[7.6457296594344,0," "],[9.4211851276123,1,"down"],[9.5344224914334,0,"down"],[9.6194345468921,1,"down"],[9.735668080355,0,"down"],[9.8098242075939,1,"down"],[9.8977700538726,0,"down"],[10.574482736722,1,"a"],[10.720925765738,0,"a"],[11.951402092196,1," "],[12.096919369807,0," "],[20.889030926886,1," "],[21.006187880535,0," "],[22.789428418318,1," "],[22.906597697118,0," "],[23.726920262558,1," "],[23.87047210773,0," "],[24.495546070966,1,"right"],[25.670303618004,0,"right"],[25.982866019496,1,"up"],[26.618560761004,0,"up"],[26.817131510275,1,"up"],[26.933048082155,0,"up"],[28.151831432268,1,"right"],[28.409631570614,0,"right"],[28.608850134346,1,"right"],[28.946717005587,1," "],[29.033613179898,0," "],[29.3207646377,0,"right"],[30.001445340898,1,"right"],[30.288545940955,0,"right"],[30.854998383849,1,"left"],[31.430132806063,0,"left"],[31.464027995613,1,"right"],[32.273885635326,0,"right"],[32.761222110064,1,"right"],[32.870574576295,1," "],[32.988801033764,0," "],[33.046376104438,0,"right"],[34.338417465964,1,"right"],[34.534656766631,1," "],[34.650857363022,0," "],[34.795418850426,0,"right"],[35.53178003147,1,"right"],[35.763263717614,0,"right"],[36.55719352473,1,"left"],[36.616750082341,0,"left"],[36.900186569414,1,"left"],[37.535691084167,0,"left"],[37.567264753045,1,"right"],[38.50152375055,0,"right"],[39.007368868761,1," "],[39.124529215727,0," "],[39.12944797081,1,"right"],[39.300339090649,0,"right"],[40.490828969037,1,"right"],[40.918540641793,0,"right"],[41.103129117051,1,"right"],[41.445870039204,0,"right"],[41.646106960983,1,"right"],[41.785708013414,1," "],[41.901909377875,0," "],[41.994737291814,0,"right"],[43.181277073527,1,"right"],[43.411726644154,0,"right"],[43.415606978318,1,"left"],[43.900035029603,0,"left"],[43.926366387197,1,"right"],[44.595303145294,0,"right"],[44.848258530463,1,"right"],[45.018160655995,1," "],[45.134360694332,0," "],[45.165607035657,0,"right"],[45.988930481179,1,"right"],[46.273137866201,0,"right"],[47.296577751256,1,"left"],[47.814080160482,0,"left"],[47.842411711759,1,"right"],[48.382459026176,1," "],[48.473284217194,0," "],[48.529936599749,0,"right"],[49.608109852254,1,"left"],[50.005527244542,0,"left"],[50.064141033163,1,"right"],[50.878556017229,0,"right"],[51.162859423213,1,"right"],[51.738945264226,0,"right"],[52.080754623432,1,"right"],[52.598289666703,0,"right"],[52.908882567373,1,"right"],[53.664738994974,0,"right"],[54.005595132212,1,"right"],[54.463560329632,0,"right"],[54.747820723602,1,"right"],[54.949923546532,0,"right"],[55.144244063113,1," "],[55.232117794661,0," "],[55.855191381195,1," "],[55.943459253531,1,"right"],[56.000697194739,0," "],[56.202864385676,0,"right"],[58.186301407464,1," "],[58.216568772419,1,"right"],[58.305396851039,0," "],[58.448962149467,0,"right"],[59.554467346952,1,"right"],[59.696050183351,1," "],[59.783941214513,0," "],[59.871856040898,0,"right"],[60.978383664809,1,"left"],[61.553471201645,0,"left"],[61.583769136452,1,"right"],[62.15311253517,1," "],[62.240002069861,0," "],[62.329877612245,0,"right"],[62.58477353653,1,"left"],[62.674325960757,0,"left"],[63.60923067853,1,"left"],[64.096478233969,0,"left"],[64.123873484859,1,"right"],[65.240033939835,0,"right"],[65.494981102904,1,"right"],[65.668792128266,0,"right"],[65.892402299549,1," "],[65.924656536943,1,"right"],[66.038938880296,0," "],[66.241063038216,0,"right"],[67.232322414759,1,"left"],[67.576039307003,0,"left"],[67.633673795221,1,"right"],[68.509604645767,0,"right"],[68.821147918139,1,"right"],[68.99497864634,0,"right"]]
```