I have to move a triangle that starts off randomly on either four sides of the canvas ( up, down, left, right) , then as it moves 5 steps (10 pixel a step), the object will change its direction to one of the other three other directions, continue moves 5 steps, then change direction again.
I know i have to use the if/else statement, but I have no idea how to start! Can anyone give me any idea please?