Have a look at two examples below:
Magic castle - we coded our characters so that one set run away from the wizard at the start and the other characters run away when tapped on.
Sharkswipe - We learned how to code movement for a character when you swipe them.
Super coding click here