Updated main.js by adding gravity and keyboard controls