Python Method Chaining Javascript Snake Game