I need to write these four ifs in Python. Notice what it does, is changing between four possible states in a loop: 1,0 -> 0,1 -> -1,0 -> 0,-1 and back to first.
if [dx, dy] == [1,0]:
dx, dy = 0, 1
if [dx, dy] == 0, 1:
dx, dy = -1, 0
if [dx, dy] == [-1, 0]
dx, dy = 0, -1
if [dx, dy] == [0, -1]:
dx, dy = 1, 0
Can anyone suggest me a better/nicer way to write this?

When in doubt, apply maths. ;)