I'm still learning this myself, but read the Help documentation for SPCOL (initialize collision information) and SPHITSP (detecting when sprites touch). When you know sprites are touching, have the program behave accordingly.