made resource gain framerate-independent