Internal wait function added.

I will use this for the scrollTo() feature, and also for other game
components.