Class InputLog
java.lang.Object
com.codename1.gaming.platformer.InputLog
A recorded run: one Input value per tick, run-length encoded.
A player rarely changes buttons, so a minute of play (3600 ticks) is typically a
few hundred bytes of text. The text form, bits*count pairs in hexadecimal
separated by commas ("2*3c,12*8,2*40"), is what the app uploads and the server
replays with Replay.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
InputLog
public InputLog()
-
-
Method Details
-
add
public void add(int bits) Appends one tick.
Parameters
bits: the tick'sInputbits
-
length
public int length()The number of ticks recorded.
Returns
the tick count
-
get
public int get(int tick) The input at a tick.
Parameters
tick: a tick in[0, length())
Returns
the
Inputbits -
toArray
public int[] toArray()Expands the log into one value per tick.
Returns
a new array of
length()values -
encode
The compact text form.
Returns
the encoded log
-
decode
-