Update gravity.js

Fixed an undeclared variable.