Arrow keys to move. If you die (or win), double click the green flag to restart.
Not my best but I haven't posted in a while so I shared this. Made it for an assessment at school, hope you like it. There is a couple of different ways so experiment and see where you go!