Serialize input state and implement basic map drawing and collision